mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix sun & moon movement direction
They were rising on the west and setting on the east
This commit is contained in:
parent
9065d0ca02
commit
8a6f08df91
@ -139,12 +139,12 @@ impl Globals {
|
||||
|
||||
pub fn get_sun_dir(time_of_day: f64) -> Vec3<f32> {
|
||||
let angle_rad = Self::get_angle_rad(time_of_day);
|
||||
Vec3::new(angle_rad.sin(), 0.0, angle_rad.cos())
|
||||
Vec3::new(-angle_rad.sin(), 0.0, angle_rad.cos())
|
||||
}
|
||||
|
||||
pub fn get_moon_dir(time_of_day: f64) -> Vec3<f32> {
|
||||
let angle_rad = Self::get_angle_rad(time_of_day);
|
||||
-Vec3::new(angle_rad.sin(), 0.0, angle_rad.cos() - 0.5).normalized()
|
||||
-Vec3::new(-angle_rad.sin(), 0.0, angle_rad.cos() - 0.5).normalized()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user