pub fn direction(&self) -> DVec3 {
        let rotation_x = f64::from(self.yaw.to_radians());
        let rotation_y = f64::from(self.pitch.to_radians());

        let y = -rotation_y.sin();

        let xz = rotation_y.cos();

        let x = -xz * rotation_x.sin();
        let z = xz * rotation_x.cos();

        glm::vec3(x, y, z)
    }
/// Returns a unit vector representing
/// the direction of this position's pitch
/// and yaw.
Returns a unit vector representing
the direction of this position's pitch
and yaw.
Returns a unit vector representing the direction of this position ' s pitch and yaw .
pub fn direction(&self) -> DVec3 {
        let rotation_x = f64::from(self.yaw.to_radians());
        let rotation_y = f64::from(self.pitch.to_radians());
        let y = -rotation_y.sin();
        let xz = rotation_y.cos();
        let x = -xz * rotation_x.sin();
        let z = xz * rotation_x.cos();
        glm::vec3(x, y, z)
    }
pub fn direction ( & self ) -> DVec3 { let rotation_x = f64 :: from ( self . yaw . to_radians ( ) ) ; let rotation_y = f64 :: from ( self . pitch . to_radians ( ) ) ; let y = - rotation_y . sin ( ) ; let xz = rotation_y . cos ( ) ; let x = - xz * rotation_x . sin ( ) ; let z = xz * rotation_x . cos ( ) ; glm :: vec3 ( x , y , z ) }
Returns a unit vector representing
the direction of this position's pitch
and yaw.
Returns a unit vector representing the direction of this position ' s pitch and yaw .
&self
&self