wip: engine enhancements and fixes

This commit is contained in:
reo 2025-08-24 18:49:41 +03:00
parent 9816f14f53
commit cc7921a5fe
27 changed files with 347 additions and 32 deletions

8
ecs/Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "raidillon_ecs"
version = "0.1.0"
edition = "2024"
[dependencies]
glam = "0.30.5"
raidillon_assets = { path = "../asset" }

15
ecs/src/components.rs Normal file
View file

@ -0,0 +1,15 @@
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)
}
}

3
ecs/src/lib.rs Normal file
View file

@ -0,0 +1,3 @@
pub mod components;
pub use components::{Transform, ModelID};