debug things

This commit is contained in:
Quaternions 2024-09-26 16:10:12 -07:00
parent 6005485789
commit 84b364313b
2 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,7 @@ use crate::physics::Body;
use crate::model_physics::{FEV,MeshQuery,DirectedEdge,MinkowskiMesh,MinkowskiFace,MinkowskiDirectedEdge,MinkowskiVert}; use crate::model_physics::{FEV,MeshQuery,DirectedEdge,MinkowskiMesh,MinkowskiFace,MinkowskiDirectedEdge,MinkowskiVert};
use strafesnet_common::integer::{Time,Fixed,Ratio}; use strafesnet_common::integer::{Time,Fixed,Ratio};
#[derive(Debug)]
enum Transition<F,E:DirectedEdge,V>{ enum Transition<F,E:DirectedEdge,V>{
Miss, Miss,
Next(FEV<F,E,V>,Ratio<Fixed<4,128>,Fixed<4,128>>), Next(FEV<F,E,V>,Ratio<Fixed<4,128>,Fixed<4,128>>),

View File

@ -9,7 +9,7 @@ pub trait UndirectedEdge{
fn as_directed(&self,parity:bool)->Self::DirectedEdge; fn as_directed(&self,parity:bool)->Self::DirectedEdge;
} }
pub trait DirectedEdge{ pub trait DirectedEdge{
type UndirectedEdge:Copy+UndirectedEdge; type UndirectedEdge:Copy+std::fmt::Debug+UndirectedEdge;
fn as_undirected(&self)->Self::UndirectedEdge; fn as_undirected(&self)->Self::UndirectedEdge;
fn parity(&self)->bool; fn parity(&self)->bool;
//this is stupid but may work fine //this is stupid but may work fine
@ -50,6 +50,7 @@ impl DirectedEdge for SubmeshDirectedEdgeId{
} }
//Vertex <-> Edge <-> Face -> Collide //Vertex <-> Edge <-> Face -> Collide
#[derive(Debug)]
pub enum FEV<F,E:DirectedEdge,V>{ pub enum FEV<F,E:DirectedEdge,V>{
Face(F), Face(F),
Edge(E::UndirectedEdge), Edge(E::UndirectedEdge),
@ -532,11 +533,11 @@ impl MeshQuery<SubmeshFaceId,SubmeshDirectedEdgeId,SubmeshVertId> for Transforme
//(face,vertex) //(face,vertex)
//(edge,edge) //(edge,edge)
//(vertex,face) //(vertex,face)
#[derive(Clone,Copy)] #[derive(Clone,Copy,Debug)]
pub enum MinkowskiVert{ pub enum MinkowskiVert{
VertVert(SubmeshVertId,SubmeshVertId), VertVert(SubmeshVertId,SubmeshVertId),
} }
#[derive(Clone,Copy)] #[derive(Clone,Copy,Debug)]
pub enum MinkowskiEdge{ pub enum MinkowskiEdge{
VertEdge(SubmeshVertId,SubmeshEdgeId), VertEdge(SubmeshVertId,SubmeshEdgeId),
EdgeVert(SubmeshEdgeId,SubmeshVertId), EdgeVert(SubmeshEdgeId,SubmeshVertId),
@ -551,7 +552,7 @@ impl UndirectedEdge for MinkowskiEdge{
} }
} }
} }
#[derive(Clone,Copy)] #[derive(Clone,Copy,Debug)]
pub enum MinkowskiDirectedEdge{ pub enum MinkowskiDirectedEdge{
VertEdge(SubmeshVertId,SubmeshDirectedEdgeId), VertEdge(SubmeshVertId,SubmeshDirectedEdgeId),
EdgeVert(SubmeshDirectedEdgeId,SubmeshVertId), 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{ pub enum MinkowskiFace{
VertFace(SubmeshVertId,SubmeshFaceId), VertFace(SubmeshVertId,SubmeshFaceId),
EdgeEdge(SubmeshEdgeId,SubmeshEdgeId,bool), EdgeEdge(SubmeshEdgeId,SubmeshEdgeId,bool),
@ -588,6 +589,7 @@ pub struct MinkowskiMesh<'a>{
} }
//infinity fev algorithm state transition //infinity fev algorithm state transition
#[derive(Debug)]
enum Transition{ enum Transition{
Done,//found closest vert, no edges are better Done,//found closest vert, no edges are better
Vert(MinkowskiVert),//transition to vert Vert(MinkowskiVert),//transition to vert