Skip to content

Commit

Permalink
Use wheels_with_contact if available
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed May 5, 2024
1 parent 26af9a3 commit 33063c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ fn calc_car_wheel_update(
angular_velocity *= -1.;
}

if target_car.state.is_on_ground {
if target_car.state.is_on_ground || target_car.state.wheels_with_contact.into_iter().any(|b| b) {
// determine if the velocity is in the same direction as the car's forward vector
let forward = car_transform.rotation.mul_vec3(Vec3::X);
let forward_dot = forward.dot(car_vel);
Expand Down

0 comments on commit 33063c7

Please sign in to comment.