diff options
author | HampusM <hampus@hampusmat.com> | 2024-04-21 15:47:20 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-04-21 15:47:20 +0200 |
commit | 4ce4a04992c076ece78f55837764d055429a7197 (patch) | |
tree | 7e28afd8cdcbe85ef1e331557ff6c84c0485ca7a | |
parent | 219c4383e175af263141613afb9563120b2da3f3 (diff) |
chore: create transform using fields
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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<dyn Error>> 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"))?; |