This commit is contained in:
Quaternions 2025-03-12 16:50:56 -07:00
parent 7c306da7b0
commit 2f574b297f
2 changed files with 3 additions and 2 deletions
engine/physics/src

@ -87,7 +87,7 @@ impl<F:Copy,M:MeshQuery<Normal=Vector3<F>,Offset=Fixed<4,128>>+std::fmt::Debug>
let face_n=mesh.face_nd(edge_face_id).0;
//edge_n gets parity from the order of edge_faces
let n=face_n.cross(edge_n)*((i as i64)*2-1);
println!("edge_face={edge_face_id:?} face_n={face_n:?} n={n:?}");
println!("edge_face={edge_face_id:?} face_n={face_n} n={n}");
//WARNING yada yada d *2
//wrap for speed
for dt in Fixed::<4,128>::zeroes2(n.dot(delta_pos).wrap_4(),n.dot(body.velocity).wrap_4()*2,n.dot(body.acceleration).wrap_4()){

@ -928,7 +928,8 @@ impl MeshQuery for MinkowskiMesh<'_>{
if d.is_negative(){
let edge1_nn=edge1_n.dot(edge1_n);
let dd=(d*d)/(edge_face0_nn*edge1_nn);
if best_d<dd{
if !dd.den.is_zero()&&best_d<dd{
println!("dd={dd:?}");
best_d=dd;
best_edge=Some(directed_edge_id1);
}