use rake angle for neck too

This commit is contained in:
Joe Ardent 2023-02-19 16:28:26 -08:00
parent b6443e8cbe
commit 80e2a79de1

View file

@ -22,6 +22,7 @@ pub fn spawn_tires(
let ccd = Ccd { enabled: true };
let limits = conf.limits;
let (meshes, materials) = meshterials;
let rake_vec: Vec3 = Vec3::new(0.0, 1.0, 0.57).normalize(); // about 30 degrees of rake
let tire = Tire {
radius: wheel_rad,
@ -78,7 +79,7 @@ pub fn spawn_tires(
let damping = conf.damping;
let prismatic_axis = if steering.is_some() {
Vec3::new(0.0, 1.0, 0.57).normalize() // about 30 degrees of rake
rake_vec
} else {
Vec3::Y
};
@ -96,7 +97,7 @@ pub fn spawn_tires(
let axel_parent_entity = if let Some(steering) = steering {
let neck_builder =
RevoluteJointBuilder::new(Vec3::Y).local_anchor1(Vec3::new(0.0, 0.0, 0.1)); // this adds another 0.1m of trail
RevoluteJointBuilder::new(rake_vec).local_anchor1(Vec3::new(0.0, 0.0, 0.1)); // this adds another 0.1m of trail
let neck_joint = MultibodyJoint::new(fork_rb_entity, neck_builder);
let neck = commands
.spawn(RigidBody::Dynamic)