raidillon/ecs/src/components.rs
2025-08-30 12:55:42 +03:00

17 lines
385 B
Rust

use glam::{Vec3, Quat, Mat4};
pub use raidillon_assets::ModelID;
#[derive(Copy, Clone)]
pub struct Transform {
pub translation: Vec3,
pub rotation: Quat,
pub scale: Vec3,
}
impl Transform {
pub fn matrix(&self) -> Mat4 {
Mat4::from_scale_rotation_translation(self.scale, self.rotation, self.translation)
}
}
pub struct ModelHandle(pub ModelID);