Skip to content

Commit

Permalink
Synchronize PRM with final version; replace abort() with error log in…
Browse files Browse the repository at this point in the history
… LCP_Solver
  • Loading branch information
caiiiycuk committed Dec 28, 2023
1 parent e7b013f commit b86332f
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 119 deletions.
10 changes: 6 additions & 4 deletions MechoSoma/Xreal/LCP_Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,13 @@ void LCP_Solver::drive_to_zero(int d)
return;
}

if(iterations++ > LCP_max_iterations)
abort("LCP_Solver: too many iterations");

mem_restore();
}

if(iterations++ > LCP_max_iterations) {
printf("ERR! LCP_Solver: too many iterations, terminating...");
return;
}
}
}

void LCP_Solver::fdirection(int d)
Expand Down
12 changes: 7 additions & 5 deletions MechoSoma/Xreal/LCP_frictional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,15 @@ void LCP_Solver::drive_to_zero_frictional(int d)
break;
}

if(index == d && drive_friction == prev_state){
if(index == d && drive_friction == prev_state) {
return;
}
}

if(iterations++ > LCP_max_iterations)
abort("LCP_Solver: too many iterations");
}
if(iterations++ > LCP_max_iterations) {
printf("ERR! LCP_Solver: too many iterations, terminating...");
return;
}
}
}

void LCP_Solver::fdirection_frictional(int d)
Expand Down
12 changes: 6 additions & 6 deletions MechoSoma/Xreal/gen_animalarcans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int bubble_time_to_hold_mechos = 4000;
int bubble_owner_protection_time = 2000;
float bubble_active_size = 0.5f;
float bubble_restitution_plus_one = 1.9f;
float bubble_buoyancy = 1.e-002f;
float bubble_buoyancy = 0.01f;
float bubble_freeHeight = -10.f;
float bubble_cargoHeight = 150.f;
float bubble_freeGravity = 2.f;
Expand Down Expand Up @@ -57,7 +57,7 @@ float suicide_average_stop_velocity = 20.f;
int suicide_average_stop_delay = 500;
float suicide_impact_velocity = 30.f;
float suicide_impact_normal_y = 0.8f;
float bonus_man_buoyancy = 4.5e-002f;
float bonus_man_buoyancy = 0.045f;
float bonus_man_submersion_threshould = 0.8f;
float bonus_man_mechos_hit_velocity = 10.f;
int bonus_man_switch_time_threshould = 1000;
Expand All @@ -74,21 +74,21 @@ float bonus_meteorite_buoyancy = 0.1f;
float snow_ball_scale_radius = 4.f;
float snow_ball_dragV = 0.5f;
int ball_time_to_live = 5000;
float ball_drag_vw = 5.e-002f;
float ball_drag_vw = 0.05f;
float ball_initial_V = 40.f;
float ball_initial_W = 1.f;
float ball_buoyancy = 0.2f;
float ball_traction_factor = 0.4f;
float ball_steering_factor = 2.5e-002f;
float ball_steering_factor = 0.025f;
float ball_max_Vxy = 40.f;
float clown_buoyancy = 5.e-002f;
float clown_buoyancy = 0.05f;
float tomato_mass = 3.f;
float tomato_TOI_scale = 10.f;
float tomato_radius_scale = 0.8f;
float tomato_linear_damping = 2.f;
float tomato_angular_damping = 4.f;
float tomato_return_force = 0.f;
float tomato_buoyancy = 4.e-002f;
float tomato_buoyancy = 0.04f;
float tomato_swing_lift_force = 10.f;
float tomato_swing_torque = 1.f;
float titanium_ball_damage = 0.f;
Expand Down
24 changes: 12 additions & 12 deletions MechoSoma/Xreal/gen_animals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ float frog_start_jump_phase = 0.f;
float frog_stop_jump_phase = 0.5f;
float frog_jump_animation_period = 1000.f;
float frog_stop_animation_period = 1000.f;
float frog_phase_incr = 5.e-002f;
float frog_phase_incr = 0.05f;
int frog_rest_time = 10000;
int frog_walk_distance = 10000;
float frog_Vy = 76.f;
Expand All @@ -23,7 +23,7 @@ float frog_radius = 60.f;
int frog_racer_recover_time = 2000;
float dragon_traction = 25.f;
float dragon_racer_traction = 52.f;
float dragon_rudder = 7.e-002f;
float dragon_rudder = 0.07f;
float dragon_width = 100.f;
float dragon_length = 150.f;
float dragon_height = 150.f;
Expand Down Expand Up @@ -52,7 +52,7 @@ float debris_Vz = 15.5034f;
float debris_W = 1.f;
float debris_damage_ability = 0.5f;
float debris_time_to_dwindle = 2000.f;
float smart_stone_damage_ability = 5.e-002f;
float smart_stone_damage_ability = 0.05f;
float smart_stone_traction = 2.f;
float smart_stone_rudder = 0.1f;
float smart_stone_restitution = 0.95f;
Expand All @@ -63,21 +63,21 @@ float smart_stone_fly_velocity = 60.f;
float shark_spheres_radius = 10.f;
float shark_distance = 500.f;
float shark_damage = 1.f;
float shark_buoyancy = 7.e-002f;
float shark_buoyancy = 0.07f;
float shark_traction = 4.f;
float shark_rudder = 4.e-002f;
float shark_rudder = 0.04f;
float shark_animation_period = 1500.f;
float shark_rudder_duration = 3000.f;
float fish_spheres_radius = 10.f;
float fish_distance = 500.f;
float fish_damage = 0.3f;
float fish_buoyancy = 2.e-002f;
float fish_buoyancy = 0.02f;
float fish_traction = 2.f;
float whale_TOI_scale = 3.f;
float whale_buoyancy = 1.5e-002f;
float whale_buoyancy = 0.015f;
float whale_sphere_offset_z = 20.f;
float whale_traction = 49.f;
float whale_rudder = 5.e-002f;
float whale_rudder = 0.05f;
int whale_jump_time = 2000;
int whale_jump_reverse_time = 1000;
float whale_jump_axis_z = 0.8f;
Expand All @@ -88,17 +88,17 @@ float dog_hit_velocity2sound_factor = 1.f;
float dog_activation_distance = 150.f;
float dog_animation_period = 8000.f;
float wicked_butterfly_traction = 100.f;
float wicked_butterfly_distance_to_traction_factor = 2.5e-002f;
float wicked_butterfly_distance_to_traction_factor = 0.025f;
float brevno_spheres_radius = 25.f;
float brevno_mass = 1.f;
float brevno_return_force = 2.f;
float brevno_linear_damping = 0.2f;
float brevno_angular_damping = 0.2f;
float brevno_buoyancy = 5.e-002f;
float brevno_torque = 5.e-002f;
float brevno_buoyancy = 0.05f;
float brevno_torque = 0.05f;
float raft_spheres_radius = 10.f;
float raft_mass = 1.25f;
float raft_buoyancy = 4.4e-002f;
float raft_buoyancy = 0.044f;
float ship_spheres_radius = 8.f;
float ship_buoyancy = 0.1f;
float ship_guard_distance = 500.f;
Expand Down
56 changes: 28 additions & 28 deletions MechoSoma/Xreal/gen_arcans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ float mechos_foot_speed_factor = 0.12f;
#define __XScript_struct_FlyingArcaneData__
#pragma pack( push, __XScript_struct_pack__, 4 )
struct FlyingArcaneData {
float height;
float traction_force;
float brake_force;
float zero_speed_rudder;
float rudder_torque_factor_manual;
float rudder_torque_factor_point_controlled;
float dragVx;
float dragVy;
float dragVz;
float dragWxy;
float dragWz;
float up_lift;
float down_lift;
float lift_offset_y;
float lift_offset_z;
float height;
float traction_force;
float brake_force;
float zero_speed_rudder;
float rudder_torque_factor_manual;
float rudder_torque_factor_point_controlled;
float dragVx;
float dragVy;
float dragVz;
float dragWxy;
float dragWz;
float up_lift;
float down_lift;
float lift_offset_y;
float lift_offset_z;
};
#pragma pack( pop, __XScript_struct_pack__)
#endif // __XScript_struct_FlyingArcaneData__
FlyingArcaneData butterfly_flying_data = { 70.f
, 24.f, 40.f, 40.f, 3.e-002f, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f
};
FlyingArcaneData butterfly_flying_data = { 70.f
, 24.f, 40.f, 40.f, 0.03f, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f
};
float butterfly_sweep_period = 300.f;
float butterfly_sound_phase = 0.25f;
FlyingArcaneData dirigible_flying_data = { 70.f
, 26.f, 40.f, 40.f, 3.e-002f, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f
};
FlyingArcaneData helicopter_flying_data = { 70.f, 29.f, 40.f, 40.f, 3.e-002f
, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f };
FlyingArcaneData dragon_power_flying_data = { 70.f
, 32.f, 40.f, 40.f, 3.e-002f, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f
};
FlyingArcaneData dirigible_flying_data = { 70.f
, 26.f, 40.f, 40.f, 0.03f, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f
};
FlyingArcaneData helicopter_flying_data = { 70.f, 29.f, 40.f, 40.f, 0.03f, 0.1f
, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f };
FlyingArcaneData dragon_power_flying_data = { 70.f
, 32.f, 40.f, 40.f, 0.03f, 0.1f, 4.f, 0.3f, 0.3f, 1.f, 2.f, 2.f, -0.2f, 2.f, 20.f
};
float dragon_power_sweep_period = 800.f;
float dragon_power_sound_phase = 0.f;
float cannon_ball_height = 70.f;
Expand Down Expand Up @@ -97,8 +97,8 @@ float magnetic_field_repulsion = 4.f;
float k_attraction_arcan = 4.f;
float magnetic_cushion_traction = 16.f;
float magnetic_cushion_rudder_modulation = 1.f;
float k_vortex_force = 5.e-002f;
float k_vortex_torque = 6.07753e-002f;
float k_vortex_force = 0.05f;
float k_vortex_torque = 0.0607753f;
float k_vortex_attraction = 4.f;
float k_vortex_lift = 1.2f;

Expand Down
34 changes: 17 additions & 17 deletions MechoSoma/Xreal/gen_camera.cpp
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
//////////////////////////////////////////////////////////////////////////////////////////////
// XScript definition
// Section: CameraPrm
// Number of variables: 87
// Number of variables: 85
// This is computer generated code, don't try to change it
//////////////////////////////////////////////////////////////////////////////////////////////
float fCamera = 512.f;
int camera_integration_steps = 1;
float camera_distance_min = 30.f;
int enable_zoom_by_wheel = 1;
float camera_mouse_wheel_sensitivity = 0.125f;
float camera_zoom_sensitivity = 1.e-002f;
float camera_slope_mass_inv = 2.e-003f;
float camera_water_slope_mass_inv = 1.e-003f;
float camera_turn_mass_inv = 3.e-003f;
float camera_distance_mass_inv = 1.e-003f;
float camera_centering_mass_inv = 1.e-003f;
float camera_const_input_mass_inv = 3.e-003f;
float camera_zoom_sensitivity = 0.01f;
float camera_slope_mass_inv = 0.002f;
float camera_water_slope_mass_inv = 0.001f;
float camera_turn_mass_inv = 0.025f;
float camera_distance_mass_inv = 0.001f; // orig 0.0001
float camera_centering_mass_inv = 0.001f;
float camera_const_input_mass_inv = 0.003f;
float camera_damping_factor = 1.9f;
float camera_position_mass_inv_cliped = 0.1f;
float camera_slope_mass_inv_cliped_up = 0.1f;
float camera_slope_mass_inv_cliped_down = 5.e-003f;
float camera_turn_mass_inv_cliped = 5.e-002f;
float camera_slope_mass_inv_cliped_down = 0.005f;
float camera_turn_mass_inv_cliped = 0.05f;
float camera_distance_mass_inv_cliped = 0.6f;
float camera_damping_factor_cliped = 3.f;
int camera_setMode_interpolation_time = 1000;
int camera_runStartTimeScenario_interpolation_time = 2000;
int camera_setObserver_interpolation_time = 1000;
int camera_enable_clipping = 0;
int camera_enable_clipping = 1;
int camera_enable_static_objects_clipping = 0;
int camera_enable_gears_clipping = 1;
float camera_angle_step = 0.1f;
Expand All @@ -35,14 +35,14 @@ float camera_theta_dominance = 10.f;
float camera_transparensy_distance = 35.f;
float camera_transparensy_power = 3.5f;
float clip_ray_radius = 20.f;
float clip_ray_t_min = 2.5e-002f;
float S2G_clip_ray_radius = 1.e-002f;
float clip_ray_t_min = 0.025f;
float S2G_clip_ray_radius = 0.01f;
float camera_scroll_damping_factor = 1.9f;
float camera_scroll_force_of_distance = 0.2f;
float camera_scroll_mass_inv = 1.f;
float camera_fly_stop_time_scale_x = 0.3f;
float camera_fly_stop_time_scale_y = 0.3f;
float camera_scroll_move_of_distance = 2.e-003f;
float camera_scroll_move_of_distance = 0.002f;
float camera_scroll_move_max = 200.f;
float centering_delta_default = 0.2f;
float centering_delta_max = 0.4f;
Expand All @@ -60,20 +60,20 @@ float track_fly_z_offset = 90.f;
int track_fly_enable_binary_search = 1;
float track_fly_distance = 5.f;
float track_fly_increment_initial = 1.f;
float track_fly_increment_epsilon = 5.e-003f;
float track_fly_increment_epsilon = 0.005f;
float track_fly_increment = 0.1f;
int rotation_when_stop_time_time = 250;
float rotation_when_stop_time_speed = 1.f;
float stop_time_z_offset = 50.f;
float stop_time_dxy = 1.e-003f;
float stop_time_dxy = 0.001f; // orig. 0.0001f
float stop_time_max_step = 5.f;
float stop_time_precision = 1.f;
int stop_time_max_iterations = 100;
float stop_time_hCamera = 512.f;
float stop_time_share_radius_factor = 0.45f;
float free_fly_body_radius = 40.f;
float free_fly_max_climb_angle = 1.8f;
float free_fly_roll_angle_decrement_factor = 1.e-002f;
float free_fly_roll_angle_decrement_factor = 0.01f;
int camera_new_clip = 1;
int camera_new_clip_reuse_clipping_number = 4;
int camera_new_clip_x_size = 15;
Expand Down
Loading

0 comments on commit b86332f

Please sign in to comment.