From 3a7aaa20f8ef13ca65fdc4d8afef46fa3875fe84 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 5 Dec 2025 10:15:15 -0800 Subject: [PATCH] fix constraints epsilon these were supposed to be 3 voxels but were on the order of 3 units --- engine/physics/src/minimum_difference.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/physics/src/minimum_difference.rs b/engine/physics/src/minimum_difference.rs index eb6bf7d1..c44b82ca 100644 --- a/engine/physics/src/minimum_difference.rs +++ b/engine/physics/src/minimum_difference.rs @@ -1,6 +1,6 @@ use strafesnet_common::integer::vec3; use strafesnet_common::integer::vec3::Vector3; -use strafesnet_common::integer::{Fixed,Planar64Vec3}; +use strafesnet_common::integer::{Fixed,Planar64,Planar64Vec3}; use crate::model::{DirectedEdge,FEV,MeshQuery,MinkowskiMesh,MinkowskiVert}; @@ -557,7 +557,7 @@ impl ThickPlane{ let normal=(p1-p0).cross(p2-p0); // Allow ~ 2*sqrt(3) units of thickness on the plane // This is to account for the variance of two voxels across the longest diagonal - let epsilon=normal.length().wrap_3()*3; + let epsilon=(normal.length()*(Planar64::EPSILON*3)).wrap_3(); Self{point,normal,epsilon} } } @@ -570,7 +570,7 @@ impl Contains for ThickPlane{ struct ThickLine{ point:Planar64Vec3, dir:Planar64Vec3, - epsilon:Fixed<2,64>, + epsilon:Fixed<4,128>, } impl ThickLine{ fn new(mesh:&MinkowskiMesh,[v0,v1]:Simplex<2>)->Self{ @@ -580,7 +580,7 @@ impl ThickLine{ let dir=p1-p0; // Allow ~ 2*sqrt(3) units of thickness on the plane // This is to account for the variance of two voxels across the longest diagonal - let epsilon=dir.length_squared()*3; + let epsilon=(dir.length_squared()*(Planar64::EPSILON*3)).widen_4(); Self{point,dir,epsilon} } }