From 6fec6b9f59a5e6c3db9b715aaacff12bbc1db912 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 1 Nov 2023 18:02:29 -0700 Subject: [PATCH] cling thing --- src/model.rs | 1 + src/physics.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/model.rs b/src/model.rs index 76f7ba5..78bd5a1 100644 --- a/src/model.rs +++ b/src/model.rs @@ -90,6 +90,7 @@ pub struct ContactingLadder{ #[derive(Clone)] pub enum ContactingBehaviour{ Surf, + Cling,//usable as a zipline, or other weird and wonderful things Ladder(ContactingLadder), Elastic(u32),//[1/2^32,1] 0=None (elasticity+1)/2^32 } diff --git a/src/physics.rs b/src/physics.rs index caff5ec..4039dfb 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1108,6 +1108,7 @@ impl crate::instruction::InstructionConsumer for PhysicsStat let mut v=self.body.velocity; match &contacting.contact_behaviour{ 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);