add rake to front wheel

This commit is contained in:
Joe Ardent 2023-02-18 17:03:33 -08:00
parent c41fc78b00
commit 507b82a771

View file

@ -78,7 +78,13 @@ pub fn spawn_tires(
let mass_props = ColliderMassProperties::Density(0.1); let mass_props = ColliderMassProperties::Density(0.1);
let damping = conf.damping; let damping = conf.damping;
let prismatic_builder = PrismaticJointBuilder::new(Vec3::Y) let prismatic_axis = if steering.is_some() {
Vec3::new(0.0, 1.0, 0.57).normalize() // about 30 degrees of rake
} else {
Vec3::Y
};
let prismatic_builder = PrismaticJointBuilder::new(prismatic_axis)
.local_anchor1(offset) .local_anchor1(offset)
.limits(limits) .limits(limits)
.motor_position(limits[0], stiffness, damping); .motor_position(limits[0], stiffness, damping);