From 543ff75be9938cb562f5fcab0146927489391133 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 18 Sep 2023 13:44:59 -0700 Subject: [PATCH] algebra wrong --- src/body.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/body.rs b/src/body.rs index a370a86..2658ae4 100644 --- a/src/body.rs +++ b/src/body.rs @@ -382,7 +382,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Left); @@ -398,7 +398,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Right); @@ -415,7 +415,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.x&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.x+dp.xmesh1.max.x&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Top); @@ -431,7 +431,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.x&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.x+dp.xmesh1.max.x&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Bottom); @@ -448,7 +448,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.x-mesh1.min.xdp.x { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.x+dp.xmesh1.max.x { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Back); @@ -464,7 +464,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.x-mesh1.min.xdp.x { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.x+dp.xmesh1.max.x { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Front); @@ -500,7 +500,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Left); @@ -516,7 +516,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Right); @@ -533,7 +533,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.x&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.x+dp.xmesh1.max.x&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Top); @@ -549,7 +549,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.x&&mesh0.max.z-mesh1.min.zdp.z { + if mesh0.max.x+dp.xmesh1.max.x&&mesh0.max.z+dp.zmesh1.max.z { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Bottom); @@ -566,7 +566,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.x-mesh1.min.xdp.x { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.x+dp.xmesh1.max.x { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Back); @@ -582,7 +582,7 @@ impl PhysicsState { if 0<=t_time&&t_timedp.y&&mesh0.max.x-mesh1.min.xdp.x { + if mesh0.max.y+dp.ymesh1.max.y&&mesh0.max.x+dp.xmesh1.max.x { //collect valid t best_time=t_time; best_face=Some(TreyMeshFace::Front);