From 27a46093ae6768a2311068551885fd06db542033 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 8 Nov 2023 20:23:22 -0800 Subject: [PATCH] introduce dot128 --- src/integer.rs | 6 ++++++ src/physics.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/integer.rs b/src/integer.rs index ad50166..e106b70 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -645,6 +645,12 @@ impl Planar64Vec3{ )>>32) as i64) } #[inline] + pub fn dot128(&self,rhs:Self)->i128{ + (self.0.x as i128)*(rhs.0.x as i128)+ + (self.0.y as i128)*(rhs.0.y as i128)+ + (self.0.z as i128)*(rhs.0.z as i128) + } + #[inline] pub fn cross(&self,rhs:Self)->Planar64Vec3{ Planar64Vec3(glam::i64vec3( (((self.0.y as i128)*(rhs.0.z as i128)-(self.0.z as i128)*(rhs.0.y as i128))>>32) as i64, diff --git a/src/physics.rs b/src/physics.rs index e7ba49d..9239b2b 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -794,9 +794,9 @@ impl TouchingState{ //TODO: trey push solve for contact in &self.contacts{ let n=models.mesh(contact.model_id).face_nd(contact.face_id).0; - let d=n.dot(*velocity); - if d