feat: implement new "small-steps" solver + joint improvements
This commit is contained in:
@@ -90,7 +90,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
* depending on their position.
|
||||
*/
|
||||
testbed.add_callback(move |graphics, physics, _, run_state| {
|
||||
if run_state.timestep_id % 50 == 0 && physics.bodies.len() <= 7 {
|
||||
if run_state.timestep_id % 200 == 0 && physics.bodies.len() <= 7 {
|
||||
// Spawn a new cube.
|
||||
let collider = ColliderBuilder::cuboid(1.5, 2.0);
|
||||
let body = RigidBodyBuilder::dynamic().translation(vector![20.0, 10.0]);
|
||||
|
||||
@@ -51,9 +51,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let collider = ColliderBuilder::ball(rad);
|
||||
colliders.insert_with_parent(collider, child_handle, &mut bodies);
|
||||
|
||||
let joint = RopeJointBuilder::new()
|
||||
.local_anchor2(point![0.0, 0.0])
|
||||
.limits([2.0, 2.0]);
|
||||
let joint = RopeJointBuilder::new(2.0).local_anchor2(point![0.0, 0.0]);
|
||||
impulse_joints.insert(character_handle, child_handle, joint, true);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user