going to switch the lights over to using position, or maybe flesh out directional light more

This commit is contained in:
2021-02-13 23:05:45 -08:00
parent 2c9ce75b8b
commit 9665a70bac
7 changed files with 220 additions and 105 deletions

View File

@@ -157,15 +157,16 @@ impl CameraController {
(1.0 * camera.pitch.0.sin() * camera.yaw.0.cos()),
);
let yaw_offset = camera.yaw.0 - Rad(PI).0;
let right_vector = Vector3::new(
(1.0 * camera.pitch.0.sin() * yaw_offset.sin()),
(1.0 * camera.pitch.0.cos()),
(1.0 * camera.pitch.0.sin() * yaw_offset.cos()),
let offset = camera.yaw.0 + PI/2.0;
let pitch = PI/2.0;
let left_vector = Vector3::new(
(1.0 * pitch.sin() * offset.sin()),
(1.0 * pitch.cos()),
(1.0 * pitch.sin() * offset.cos()),
);
camera.position += view_vector * (self.amount_forward - self.amount_backward) * self.speed * dt;
camera.position += right_vector * (self.amount_right - self.amount_left) * self.speed * dt;
camera.position += left_vector * (self.amount_left - self.amount_right) * self.speed * dt;
// I'm not a huge fan of this
// // Move in/out (aka. "zoom")