diff --git a/src/face_crawler.rs b/src/face_crawler.rs index 40cee50..5cdc1e1 100644 --- a/src/face_crawler.rs +++ b/src/face_crawler.rs @@ -2,6 +2,7 @@ use crate::physics::Body; use crate::model_physics::{FEV,MeshQuery,DirectedEdge,MinkowskiMesh,MinkowskiFace,MinkowskiDirectedEdge,MinkowskiVert}; use strafesnet_common::integer::{Time,Fixed,Ratio}; +#[derive(Debug)] enum Transition{ Miss, Next(FEV,Ratio,Fixed<4,128>>), diff --git a/src/model_physics.rs b/src/model_physics.rs index 16de46b..79aea53 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -9,7 +9,7 @@ pub trait UndirectedEdge{ fn as_directed(&self,parity:bool)->Self::DirectedEdge; } pub trait DirectedEdge{ - type UndirectedEdge:Copy+UndirectedEdge; + type UndirectedEdge:Copy+std::fmt::Debug+UndirectedEdge; fn as_undirected(&self)->Self::UndirectedEdge; fn parity(&self)->bool; //this is stupid but may work fine @@ -50,6 +50,7 @@ impl DirectedEdge for SubmeshDirectedEdgeId{ } //Vertex <-> Edge <-> Face -> Collide +#[derive(Debug)] pub enum FEV{ Face(F), Edge(E::UndirectedEdge), @@ -532,11 +533,11 @@ impl MeshQuery for Transforme //(face,vertex) //(edge,edge) //(vertex,face) -#[derive(Clone,Copy)] +#[derive(Clone,Copy,Debug)] pub enum MinkowskiVert{ VertVert(SubmeshVertId,SubmeshVertId), } -#[derive(Clone,Copy)] +#[derive(Clone,Copy,Debug)] pub enum MinkowskiEdge{ VertEdge(SubmeshVertId,SubmeshEdgeId), EdgeVert(SubmeshEdgeId,SubmeshVertId), @@ -551,7 +552,7 @@ impl UndirectedEdge for MinkowskiEdge{ } } } -#[derive(Clone,Copy)] +#[derive(Clone,Copy,Debug)] pub enum MinkowskiDirectedEdge{ VertEdge(SubmeshVertId,SubmeshDirectedEdgeId), EdgeVert(SubmeshDirectedEdgeId,SubmeshVertId), @@ -572,7 +573,7 @@ impl DirectedEdge for MinkowskiDirectedEdge{ } } } -#[derive(Debug,Clone,Copy,Hash,Eq,PartialEq)] +#[derive(Clone,Copy,Debug,Hash,Eq,PartialEq)] pub enum MinkowskiFace{ VertFace(SubmeshVertId,SubmeshFaceId), EdgeEdge(SubmeshEdgeId,SubmeshEdgeId,bool), @@ -588,6 +589,7 @@ pub struct MinkowskiMesh<'a>{ } //infinity fev algorithm state transition +#[derive(Debug)] enum Transition{ Done,//found closest vert, no edges are better Vert(MinkowskiVert),//transition to vert