halfsize
This commit is contained in:
parent
fd5d71e1af
commit
5b55873bd5
@ -90,7 +90,7 @@ impl MouseInterpolationState {
|
|||||||
|
|
||||||
pub struct PhysicsState {
|
pub struct PhysicsState {
|
||||||
pub body: Body,
|
pub body: Body,
|
||||||
pub hitbox_size: glam::Vec3,
|
pub hitbox_halfsize: glam::Vec3,
|
||||||
pub contacts: std::collections::HashSet::<RelativeCollision>,
|
pub contacts: std::collections::HashSet::<RelativeCollision>,
|
||||||
//pub intersections: Vec<ModelId>,
|
//pub intersections: Vec<ModelId>,
|
||||||
//temp
|
//temp
|
||||||
@ -358,7 +358,7 @@ impl PhysicsState {
|
|||||||
fn mesh(&self) -> TreyMesh {
|
fn mesh(&self) -> TreyMesh {
|
||||||
let mut aabb=Aabb::new();
|
let mut aabb=Aabb::new();
|
||||||
for vertex in Aabb::unit_vertices(){
|
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
|
aabb
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ impl strafe_client::framework::Example for Skybox {
|
|||||||
contacts: std::collections::HashSet::new(),
|
contacts: std::collections::HashSet::new(),
|
||||||
models_cringe_clone: modeldatas.iter().map(|m|strafe_client::body::Model::new(m.transform)).collect(),
|
models_cringe_clone: modeldatas.iter().map(|m|strafe_client::body::Model::new(m.transform)).collect(),
|
||||||
walk_target_velocity: glam::Vec3::ZERO,
|
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));
|
let camera_uniforms = camera.to_uniform_data(physics.body.extrapolated_position(0));
|
||||||
|
Loading…
Reference in New Issue
Block a user