Merge branch 'azymohliad/sun-movement-direction' into 'master'

Fix Sun and Moon movement direction

See merge request veloren/veloren!1568
This commit is contained in:
Marcel 2020-11-30 21:13:03 +00:00
commit a189163910

View File

@ -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()
}
}