Add a 2D demo for locking rotation.
This commit is contained in:
@@ -219,7 +219,7 @@ impl Box2dWorld {
|
||||
}
|
||||
|
||||
pub fn sync(&self, bodies: &mut RigidBodySet, colliders: &mut ColliderSet) {
|
||||
for (handle, mut body) in bodies.iter_mut() {
|
||||
for (handle, body) in bodies.iter_mut() {
|
||||
if let Some(pb2_handle) = self.rapier2box2d.get(&handle) {
|
||||
let b2_body = self.world.body(*pb2_handle);
|
||||
let pos = b2_transform_to_na_isometry(b2_body.transform().clone());
|
||||
|
||||
@@ -20,12 +20,11 @@ use na::{self, Point2, Point3, Vector3};
|
||||
use rapier::dynamics::{
|
||||
ActivationStatus, IntegrationParameters, JointSet, RigidBodyHandle, RigidBodySet,
|
||||
};
|
||||
#[cfg(feature = "dim3")]
|
||||
use rapier::geometry::Ray;
|
||||
use rapier::geometry::{
|
||||
BroadPhase, ColliderHandle, ColliderSet, ContactEvent, InteractionGroups, NarrowPhase,
|
||||
ProximityEvent,
|
||||
BroadPhase, ColliderHandle, ColliderSet, ContactEvent, NarrowPhase, ProximityEvent,
|
||||
};
|
||||
#[cfg(feature = "dim3")]
|
||||
use rapier::geometry::{InteractionGroups, Ray};
|
||||
use rapier::math::Vector;
|
||||
use rapier::pipeline::{ChannelEventCollector, PhysicsPipeline, QueryPipeline};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user