diff --git a/src/model_physics.rs b/src/model_physics.rs index 9051133..b8e73b7 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -171,6 +171,28 @@ impl PhysicsMesh{ pub fn verts<'a>(&'a self)->impl Iterator+'a{ self.verts.iter().map(|Vert(pos)|*pos) } + pub fn brute_t(&self,body:&crate::physics::Body,time_limit:crate::integer::Time)->Option<(FaceId,crate::integer::Time)>{ + //check each face + let mut best_time=time_limit; + let mut best_face=None; + for (i,f) in self.face_topology.iter().enumerate(){ + let (n,d)=self.face_nd(FaceId(i)); + for t in crate::zeroes::zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){ + let t=body.time+crate::integer::Time::from(t); + if body.time for PhysicsMesh{ fn closest_fev(&self,point:Planar64Vec3)->FEV{