diff options
author | HampusM <hampus@hampusmat.com> | 2024-04-20 14:30:57 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-04-20 14:30:57 +0200 |
commit | 8efb76ed360796b614cec5d7eaa28b159832dbdd (patch) | |
tree | e0e14f7630cc9e8336fb88c30e2ceb26341754b6 /engine/src/renderer/mod.rs | |
parent | 7da31da573f6bbc044d28bd961f67d0db90f8d0e (diff) |
refactor(engine): make LightSource fields public
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r-- | engine/src/renderer/mod.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index 3052969..afed816 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -340,16 +340,14 @@ fn apply_light( { gl_shader_program.set_uniform_vec_3fv( cstr!("light.position"), - &light_source.map_or_else(Vec3::default, |light_source| { - light_source.position().clone() - }), + &light_source.map_or_else(Vec3::default, |light_source| light_source.position), ); gl_shader_program.set_uniform_vec_3fv( cstr!("light.ambient"), &light_source .map_or(Color::WHITE_F32, |light_source| { - light_source.ambient().clone() + light_source.ambient.clone() }) .into(), ); @@ -358,7 +356,7 @@ fn apply_light( cstr!("light.diffuse"), &light_source .map_or(Color::WHITE_F32, |light_source| { - light_source.diffuse().clone() + light_source.diffuse.clone() }) .into(), ); @@ -367,7 +365,7 @@ fn apply_light( cstr!("light.specular"), &light_source .map_or(Color::WHITE_F32, |light_source| { - light_source.specular().clone() + light_source.specular.clone() }) .into(), ); |