@@ 344,12 344,21 @@ fn dragging(
);
// create the joint...
- let joint = FixedJoint::new(target_part.2, source_part.2)
+ let joint = PrismaticJoint::new(target_part.2, source_part.2)
+ .with_slider_axis(source_joint.2.translation.xy().normalize())
.with_local_anchor1(target_joint.2.translation.xy())
.with_local_basis1(target_joint.0.transform.rotation.to_euler(EulerRot::ZYX).0 + PI
- - source_joint.0.transform.rotation.to_euler(EulerRot::ZYX).0);
+ - source_joint.0.transform.rotation.to_euler(EulerRot::ZYX).0)
+ .with_limits(0.0, 0.0)
+ .with_align_compliance(0.0002)
+ .with_angle_compliance(0.00000002)
+ .with_limit_compliance(0.006);
+ let joint_damping = JointDamping {
+ linear: 4.0,
+ angular: 0.1,
+ };
- let joint_id = commands.spawn(joint).id();
+ let joint_id = commands.spawn((joint, joint_damping)).id();
// create the peering component...
commands.entity(source_joint.4).insert(Peer {
@@ 418,4 427,4 @@ fn magic_fuel_regen(players: Query<&mut PlayerStorage, With<Player>>, time: Res<
for mut storage in players {
storage.fuel = (storage.fuel + 5.0 * time.delta_secs()).min(storage.fuel_capacity);
}
-}>
\ No newline at end of file
+}