implement ModelPhysics

This commit is contained in:
Quaternions 2023-10-11 22:16:19 -07:00
parent 7309949dd0
commit 3b7a1d5dff

View File

@ -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
//in this iteration, all it needs is extents.
mesh: TreyMesh,
transform:glam::Affine3A,
transform:crate::integer::Planar64Affine3,
attributes:PhysicsCollisionAttributes,
}
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();
for indexed_vertex in &model.unique_vertices {
aabb.grow(transform.transform_point3(Planar64Vec3::from_array(model.unique_pos[indexed_vertex.pos as usize])));