36 int64_t delta_x_squared_wide = (int64_t)delta_vec->
x * delta_vec->
x;
37 int64_t delta_y_squared_wide = (int64_t)delta_vec->
y * delta_vec->
y;
38 int64_t delta_z_squared_wide = (int64_t)delta_vec->
z * delta_vec->
z;
57 int64_t normal_dot_x_wide = (int64_t)(int32_t)out_normal->
x * delta_vec->
x;
58 int64_t normal_dot_y_wide = (int64_t)(int32_t)out_normal->
y * delta_vec->
y;
59 int64_t normal_dot_z_wide = (int64_t)(int32_t)out_normal->
z * delta_vec->
z;
61 if (((int32_t)(((uint64_t)normal_dot_z_wide + (uint64_t)normal_dot_x_wide + (uint64_t)normal_dot_y_wide) >>
PHYSICS_FIXED_FRACTION_BITS)) < 0)
78 if (!pending_ground_actor)
90 int32_t twice_normal_velocity = ((int32_t)(((uint64_t)contact_dot_z_wide + (uint64_t)contact_dot_x_wide + (uint64_t)contact_dot_y_wide) >>
PHYSICS_FIXED_FRACTION_BITS)) * 2;
98 if (twice_normal_velocity < 0)
100 int64_t reflection_x_wide = (int64_t)twice_normal_velocity * (int32_t)record->
contact_normal_q12.
x;
104 int64_t reflection_y_wide = (int64_t)twice_normal_velocity * (int32_t)record->
contact_normal_q12.
y;
105 int64_t reflection_z_wide = (int64_t)twice_normal_velocity * (int32_t)record->
contact_normal_q12.
z;
110 response_x = velocity_x;
111 reflected_y = velocity_y;
112 reflected_z = velocity_z;
119 response_x = velocity_x;
120 reflected_y = velocity_y;
121 reflected_z = velocity_z;
126 int32_t previous_velocity_y = actor->
velocity.
y;
128 if (velocity_y > previous_velocity_y)
130 velocity_y = previous_velocity_y;
146 if ((int32_t)(uintptr_t)platform_impulse_bits < 0)
148 int64_t corrected_dot_x_wide = (int64_t)(int32_t)record->
contact_normal_q12.
x * response_x;
149 int64_t corrected_dot_y_wide = (int64_t)(int32_t)record->
contact_normal_q12.
y * response_y;
150 int64_t corrected_dot_z_wide = (int64_t)(int32_t)record->
contact_normal_q12.
z * response_z;
151 int32_t corrected_normal_velocity = (int32_t)(((uint64_t)corrected_dot_z_wide + (uint64_t)corrected_dot_x_wide + (uint64_t)corrected_dot_y_wide) >>
PHYSICS_FIXED_FRACTION_BITS);
153 if (corrected_normal_velocity < 0)
155 int64_t inward_velocity_x_wide = (int64_t)corrected_normal_velocity * (int32_t)record->
contact_normal_q12.
x;
156 int64_t inward_velocity_y_wide = (int64_t)corrected_normal_velocity * (int32_t)record->
contact_normal_q12.
y;
157 int64_t inward_velocity_z_wide = (int64_t)corrected_normal_velocity * (int32_t)record->
contact_normal_q12.
z;
165 int64_t response_x_squared_wide = (int64_t)response_x * response_x;
166 int64_t response_y_squared_wide = (int64_t)response_y * response_y;
167 int64_t response_z_squared_wide = (int64_t)response_z * response_z;
168 int32_t response_speed =
170 int32_t platform_speed_limit_bits = (int32_t)pending_ground_actor->
scene_anim_data;
172 if (response_speed <= platform_speed_limit_bits)
173 velocity_z = response_z;
176 int32_t speed_clamp_ratio_q12 = ((int64_t)platform_speed_limit_bits *
PHYSICS_FIXED_ONE) / response_speed;
177 int64_t clamped_response_x_wide = (int64_t)speed_clamp_ratio_q12 * response_x;
181 int64_t clamped_response_y_wide = (int64_t)speed_clamp_ratio_q12 * response_y;
185 int64_t clamped_response_z_wide = (int64_t)speed_clamp_ratio_q12 * response_z;
190 velocity_y = response_y;
191 velocity_x = response_x;
201 uint8_t configured_jump_hold_ticks = record->configured_jump_hold_ticks;
203 record->jump_cache_ticks = 0;
204 record->jump_hold_ticks = configured_jump_hold_ticks + 1;
206 if (!(record->input_flags & g_inputLandingFlagsPtr[3]))
208 record->jump_cache_ticks = 0;
209 record->jump_hold_ticks = 0;
216 int32_t landing_sound_offset = -(((uint8_t)record->jump_cache_ticks != UINT8_MAX ? 1 : 0));
218 landing_sound_offset &= ~ACTOR_SOUND_VARIANT_LOW_BIT;
219 Audio_PlaySound3D(&g_soundDefinitionTable[landing_sound_offset + ACTOR_LANDING_SOUND_BASE_INDEX], &actor->position);
223 record->pending_state_2c = 0;
225 return ((pending_ground_actor->actor_type ==
ACTOR_OBJECT_RUNTIME && pending_ground_actor != actor) ? -1 : 1);
234 if (!ground_collision_node)
241 return ground_normal_up_q12;
244 int32_t jump_velocity;
248 int64_t slope_jump_product_wide = (int64_t)ground_normal_up_q12 * controller_record->
ground_jump_velocity;
263 return jump_velocity;
266 int64_t modified_jump_product_wide = (int64_t)jump_modifier->
jump_multiplier_q12 * jump_velocity;