wip: engine enhancements and fixes
This commit is contained in:
parent
9816f14f53
commit
cc7921a5fe
27 changed files with 347 additions and 32 deletions
8
ecs/Cargo.toml
Normal file
8
ecs/Cargo.toml
Normal 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
15
ecs/src/components.rs
Normal 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
3
ecs/src/lib.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub mod components;
|
||||
|
||||
pub use components::{Transform, ModelID};
|
||||
Loading…
Add table
Add a link
Reference in a new issue