diff --git a/src/integer.rs b/src/integer.rs index 46d2d67..ff16b84 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -653,8 +653,10 @@ impl Planar64Vec3{ )) } #[inline] - pub fn slope(&self,up:Self)->Planar64{ - self.dot(up)/self.cross(up).length() + pub fn slope_cmp(&self,slope:Planar64,up:Self)->bool{ + let y=self.dot(up); + let x=self.cross(up).length(); + yPlanar64{ diff --git a/src/physics.rs b/src/physics.rs index 3281baf..51084e5 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1235,7 +1235,7 @@ impl crate::instruction::InstructionConsumer for PhysicsStat self.touching.constrain_acceleration(&self.models,&mut a); self.body.acceleration=a; } - None=>if self.style.surf_slope.map_or(true,|s|sif self.style.surf_slope.map_or(true,|s|self.models.mesh(model_id).face_nd(c.face_id().unwrap()).0.slope_cmp(s,Planar64Vec3::Y)){ //ground let mut target_velocity=self.style.get_walk_target_velocity(&self.camera,self.controls,&self.next_mouse,self.time); self.touching.constrain_velocity(&self.models,&mut target_velocity);