From 4ce4a04992c076ece78f55837764d055429a7197 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 21 Apr 2024 15:47:20 +0200 Subject: chore: create transform using fields --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index b8a14c4..95e2eae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,9 +36,10 @@ fn main() -> Result<(), Box> let mut engine = Engine::new(); - let mut transform = Transform::new(); - - transform.set_position(Vec3 { x: 1.6, y: 0.0, z: 0.0 }); + let transform = Transform { + position: Vec3 { x: 1.6, y: 0.0, z: 0.0 }, + ..Default::default() + }; let texture = Texture::open(Path::new("vent.png"))?; -- cgit v1.2.3-18-g5258