diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-03-19 16:23:09 +0100 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2022-03-20 21:49:16 +0100 |
| commit | a9e3441ecd64d50b478ab5370fabe187ec9a5c39 (patch) | |
| tree | 92b2e4ee3d3599a446f15551cc74e8e71b9c6150 /src_testbed | |
| parent | db6a8c526d939a125485c89cfb6e540422fe6b4b (diff) | |
| download | rapier-a9e3441ecd64d50b478ab5370fabe187ec9a5c39.tar.gz rapier-a9e3441ecd64d50b478ab5370fabe187ec9a5c39.tar.bz2 rapier-a9e3441ecd64d50b478ab5370fabe187ec9a5c39.zip | |
Rename rigid-body `static` to `fixed`
Diffstat (limited to 'src_testbed')
| -rw-r--r-- | src_testbed/graphics.rs | 4 | ||||
| -rw-r--r-- | src_testbed/physx_backend.rs | 8 | ||||
| -rw-r--r-- | src_testbed/testbed.rs | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src_testbed/graphics.rs b/src_testbed/graphics.rs index 8bf787d..847258d 100644 --- a/src_testbed/graphics.rs +++ b/src_testbed/graphics.rs @@ -170,11 +170,11 @@ impl GraphicsManager { &mut self, materials: &mut Assets<BevyMaterial>, handle: RigidBodyHandle, - is_static: bool, + is_fixed: bool, ) -> Point3<f32> { let mut color = self.ground_color; - if !is_static { + if !is_fixed { match self.b2color.get(&handle).cloned() { Some(c) => color = c, None => color = Self::gen_color(&mut self.rand), diff --git a/src_testbed/physx_backend.rs b/src_testbed/physx_backend.rs index 827c81d..2d42a68 100644 --- a/src_testbed/physx_backend.rs +++ b/src_testbed/physx_backend.rs @@ -213,7 +213,7 @@ impl PhysxWorld { rapier2dynamic.insert(rapier_handle, actor); } else { - let actor = physics.create_static(pos, ()).unwrap(); + let actor = physics.create_fixed(pos, ()).unwrap(); rapier2static.insert(rapier_handle, actor); } } @@ -231,7 +231,7 @@ impl PhysxWorld { let rb_handle = link.rigid_body_handle(); let rb = bodies.get(rb_handle).unwrap(); - if is_root && rb.is_static() { + if is_root && rb.is_fixed() { articulation.set_articulation_flag(ArticulationFlag::FixBase, true); } @@ -382,7 +382,7 @@ impl PhysxWorld { ); for (_, actor) in rapier2static { - scene.add_static_actor(actor); + scene.add_fixed_actor(actor); } for (_, actor) in rapier2dynamic { @@ -712,7 +712,7 @@ type PxPhysicsFoundation = PhysicsFoundation<DefaultAllocator, PxShape>; type PxMaterial = physx::material::PxMaterial<()>; type PxShape = physx::shape::PxShape<(), PxMaterial>; type PxArticulationLink = physx::articulation_link::PxArticulationLink<RigidBodyHandle, PxShape>; -type PxRigidStatic = physx::rigid_static::PxRigidStatic<(), PxShape>; +type PxRigidStatic = physx::rigid_fixed::PxRigidStatic<(), PxShape>; type PxRigidDynamic = physx::rigid_dynamic::PxRigidDynamic<RigidBodyHandle, PxShape>; type PxArticulation = physx::articulation::PxArticulation<(), PxArticulationLink>; type PxArticulationReducedCoordinate = diff --git a/src_testbed/testbed.rs b/src_testbed/testbed.rs index 7fce70d..cd0ff3a 100644 --- a/src_testbed/testbed.rs +++ b/src_testbed/testbed.rs @@ -668,7 +668,7 @@ impl<'a, 'b, 'c, 'd, 'e, 'f> Testbed<'a, 'b, 'c, 'd, 'e, 'f> { .physics .bodies .iter() - .filter(|e| !e.1.is_static()) + .filter(|e| !e.1.is_fixed()) .map(|e| e.0) .collect(); let num_to_delete = (dynamic_bodies.len() / 10).max(1); @@ -773,7 +773,7 @@ impl<'a, 'b, 'c, 'd, 'e, 'f> Testbed<'a, 'b, 'c, 'd, 'e, 'f> { // // let collider = ColliderBuilder::cuboid(4.0, 2.0, 0.4).density(20.0).build(); // // let collider = ColliderBuilder::ball(2.0).density(1.0).build(); - // let body = RigidBodyBuilder::new_dynamic() + // let body = RigidBodyBuilder::dynamic() // .position(cam_pos) // .linvel(vel.x, vel.y, vel.z) // .ccd_enabled(true) |
