summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-06-20 20:26:04 +0200
committerHampusM <hampus@hampusmat.com>2024-06-20 20:26:20 +0200
commit87a4230d5cbe8741c88edecbecff510bc1736fef (patch)
tree5cd8c42cec02f67da7817393d501a5a6ead3b6e6
parent3ff91ac64308141968fdcbf3b3c09a01b0c60c97 (diff)
chore: use Position struct instead of removed Transform struct
-rw-r--r--src/main.rs14
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(),