From 535ae1a5f04bf55ece9aeb0637b6a1ccb6e6bd87 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 6 Nov 2023 16:35:42 -0800 Subject: [PATCH] fix constrain --- src/physics.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index 51084e5..3c88061 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -748,7 +748,9 @@ impl TouchingState{ for contact in &self.contacts{ let (n,_)=models.mesh(contact.model_id).face_nd(contact.face_id); let d=n.dot(*velocity); - *velocity-=n*(d/n.dot(n)); + if d(MoveState,Planar64Vec3){