From a6dfa1d72b0c491be6d76a1b02caae55ec41d69f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 7 Nov 2023 20:23:07 -0800 Subject: [PATCH] elasticity calc --- src/physics.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index f8dd549..130635b 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1326,10 +1326,9 @@ impl crate::instruction::InstructionConsumer for PhysicsStat Some(crate::model::ContactingBehaviour::Surf)=>println!("I'm surfing!"), Some(crate::model::ContactingBehaviour::Cling)=>println!("Unimplemented!"), &Some(crate::model::ContactingBehaviour::Elastic(elasticity))=>{ - // let n=c.normal(&self.models); - // let d=n.dot(v)*Planar64::raw(-1-elasticity as i64); - // v-=n*(d/n.dot(n)); - todo!() + let n=self.models.mesh(contact.model_id).face_nd(contact.face_id).0; + let d=n.dot(v)*Planar64::raw(-1-elasticity as i64); + v-=n*(d/n.dot(n)); }, Some(crate::model::ContactingBehaviour::Ladder(contacting_ladder))=>{ if contacting_ladder.sticky{