From 87a4230d5cbe8741c88edecbecff510bc1736fef Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 20 Jun 2024 20:26:04 +0200 Subject: chore: use Position struct instead of removed Transform struct --- src/main.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3c08f82..81d9b6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use engine::lighting::{AttenuationParams, GlobalLight, PointLight}; use engine::material::{Builder as MaterialBuilder, Flags as MaterialFlags}; use engine::renderer::opengl::Extension as OpenglRendererExtension; use engine::shader::Program as ShaderProgram; -use engine::transform::Transform; +use engine::transform::Position; use engine::vector::Vec3; use engine::window::{ Builder as WindowBuilder, @@ -49,11 +49,6 @@ fn main() -> Result<(), Box> let mut engine = Engine::new(); - let transform = Transform { - position: Vec3 { x: 1.6, y: 0.0, z: 0.0 }, - ..Default::default() - }; - let teapot_obj = parse_obj(&read_to_string(Path::new(RESOURCE_DIR).join("teapot.obj"))?)?; @@ -72,7 +67,7 @@ fn main() -> Result<(), Box> engine.spawn(( teapot_obj.to_mesh()?, teapot_mat.material, - transform, + Position::from(Vec3 { x: 1.6, y: 0.0, z: 0.0 }), ShaderProgram::new()?, )); @@ -86,10 +81,7 @@ fn main() -> Result<(), Box> ..Default::default() }) .build(), - Transform { - position: Vec3 { x: -6.0, y: 3.0, z: 3.0 }, - ..Default::default() - }, + Position::from(Vec3 { x: -6.0, y: 3.0, z: 3.0 }), parse_obj(&read_to_string(Path::new(RESOURCE_DIR).join("cube.obj"))?)? .to_mesh()?, MaterialBuilder::new().ambient(YELLOW * 5.0).build(), -- cgit v1.2.3-18-g5258