implement ModelPhysics
This commit is contained in:
parent
7309949dd0
commit
3b7a1d5dff
@ -332,12 +332,12 @@ pub struct ModelPhysics {
|
|||||||
//A model is a thing that has a hitbox. can be represented by a list of TreyMesh-es
|
//A model is a thing that has a hitbox. can be represented by a list of TreyMesh-es
|
||||||
//in this iteration, all it needs is extents.
|
//in this iteration, all it needs is extents.
|
||||||
mesh: TreyMesh,
|
mesh: TreyMesh,
|
||||||
transform:glam::Affine3A,
|
transform:crate::integer::Planar64Affine3,
|
||||||
attributes:PhysicsCollisionAttributes,
|
attributes:PhysicsCollisionAttributes,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ModelPhysics {
|
impl ModelPhysics {
|
||||||
fn from_model_transform_attributes(model:&crate::model::IndexedModel,transform:&glam::Affine3A,attributes:PhysicsCollisionAttributes)->Self{
|
fn from_model_transform_attributes(model:&crate::model::IndexedModel,transform:&crate::integer::Planar64Affine3,attributes:PhysicsCollisionAttributes)->Self{
|
||||||
let mut aabb=TreyMesh::default();
|
let mut aabb=TreyMesh::default();
|
||||||
for indexed_vertex in &model.unique_vertices {
|
for indexed_vertex in &model.unique_vertices {
|
||||||
aabb.grow(transform.transform_point3(Planar64Vec3::from_array(model.unique_pos[indexed_vertex.pos as usize])));
|
aabb.grow(transform.transform_point3(Planar64Vec3::from_array(model.unique_pos[indexed_vertex.pos as usize])));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user