diff --git a/src/body.rs b/src/body.rs index 87d69db..095da52 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 51f1848..55c8184 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));