Major Refactor: separate project into multiple crates
This commit is contained in:
parent
f943e4c945
commit
d0440f3da3
24 changed files with 209 additions and 2232 deletions
8
raidillon_ecs/Cargo.toml
Normal file
8
raidillon_ecs/Cargo.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "raidillon_ecs"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
glam = "0.30.4"
|
||||
hecs = "0.10.5"
|
||||
17
raidillon_ecs/src/lib.rs
Normal file
17
raidillon_ecs/src/lib.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use glam::{Mat4, Quat, Vec3};
|
||||
|
||||
#[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)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ModelHandle(pub usize);
|
||||
Loading…
Add table
Add a link
Reference in a new issue