diff options
-rw-r--r-- | src/main.rs | 14 |
1 files 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<dyn Error>> 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<dyn Error>> 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<dyn Error>> ..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(), |