From 5b55873bd566371cd03bc03a227aeb950a563ca1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 18 Sep 2023 13:56:23 -0700 Subject: [PATCH] halfsize --- src/body.rs | 4 ++-- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/body.rs b/src/body.rs index 87d69dbf..095da525 100644 --- a/src/body.rs +++ b/src/body.rs @@ -90,7 +90,7 @@ impl MouseInterpolationState { pub struct PhysicsState { pub body: Body, - pub hitbox_size: glam::Vec3, + pub hitbox_halfsize: glam::Vec3, pub contacts: std::collections::HashSet::, //pub intersections: Vec, //temp @@ -358,7 +358,7 @@ impl PhysicsState { fn mesh(&self) -> TreyMesh { let mut aabb=Aabb::new(); for vertex in Aabb::unit_vertices(){ - aabb.grow(self.body.position+self.hitbox_size*vertex); + aabb.grow(self.body.position+self.hitbox_halfsize*vertex); } aabb } diff --git a/src/main.rs b/src/main.rs index 51f18486..55c8184c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -307,7 +307,7 @@ impl strafe_client::framework::Example for Skybox { contacts: std::collections::HashSet::new(), models_cringe_clone: modeldatas.iter().map(|m|strafe_client::body::Model::new(m.transform)).collect(), walk_target_velocity: glam::Vec3::ZERO, - hitbox_size: glam::vec3(2.0,5.0,2.0), + hitbox_halfsize: glam::vec3(1.0,2.5,1.0), }; let camera_uniforms = camera.to_uniform_data(physics.body.extrapolated_position(0));