Ensure correct up direction of cameras
@@ -23,7 +23,8 @@ impl BaseCamera
{
self.position = position;
self.target = target;
- self.up = up;
+ let dir = (target - position).normalize();
+ self.up = dir.cross(&up.normalize().cross(&dir));
self.view = Mat4::look_at_rh(&na::Point::from_coordinates(self.position), &na::Point::from_coordinates(self.target), &up);
}
}
