pub fn spin(&mut self, delta: impl Into<Vec2f>) {
        self.rotation.tilt += delta.into();

        if self.rotation.tilt.x < -FRAC_PI_2 {
            self.rotation.tilt.x = -FRAC_PI_2;
        } else if self.rotation.tilt.x > FRAC_PI_2 {
            self.rotation.tilt.x = FRAC_PI_2;
        }

        if self.rotation.tilt.y < 0. {
            self.rotation.tilt.y += 2. * PI;
        } else if self.rotation.tilt.y >= 2. * PI {
            self.rotation.tilt.y -= 2. * PI;
        }
    }
/// Rotate the player by the given delta.
/// The pitch will be clamped to prevent
/// obtuse rotation angles.
Rotate the player by the given delta.
The pitch will be clamped to prevent
obtuse rotation angles.
Rotate the player by the given delta . The pitch will be clamped to prevent obtuse rotation angles .
pub fn spin(&mut self, delta: impl Into<Vec2f>) {
        self.rotation.tilt += delta.into();
        if self.rotation.tilt.x < -FRAC_PI_2 {
            self.rotation.tilt.x = -FRAC_PI_2;
        } else if self.rotation.tilt.x > FRAC_PI_2 {
            self.rotation.tilt.x = FRAC_PI_2;
        }
        if self.rotation.tilt.y < 0. {
            self.rotation.tilt.y += 2. * PI;
        } else if self.rotation.tilt.y >= 2. * PI {
            self.rotation.tilt.y -= 2. * PI;
        }
    }
pub fn spin ( & mut self , delta : impl Into < Vec2f > ) { self . rotation . tilt += delta . into ( ) ; if self . rotation . tilt . x < - FRAC_PI_2 { self . rotation . tilt . x = - FRAC_PI_2 ; } else if self . rotation . tilt . x > FRAC_PI_2 { self . rotation . tilt . x = FRAC_PI_2 ; } if self . rotation . tilt . y < 0. { self . rotation . tilt . y += 2. * PI ; } else if self . rotation . tilt . y >= 2. * PI { self . rotation . tilt . y -= 2. * PI ; } }
Rotate the player by the given delta.
Rotate the player by the given delta .
&mut self
delta
impl Into<Vec2f>
&mut self
delta
impl Into<Vec2f>