Class ViewportEvent.ComputeCameraAngles

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ViewportEvent
net.neoforged.neoforge.client.event.ViewportEvent.ComputeCameraAngles
Enclosing class:
ViewportEvent

public static class ViewportEvent.ComputeCameraAngles extends ViewportEvent
Fired to allow altering the angles of the player's camera. This can be used to alter the player's view for different effects, such as applying roll.

This event is not cancellable, and does not

invalid reference
have a result
.

This event is fired on the main Forge event bus, only on the logical client.

  • Field Details

    • yaw

      private float yaw
    • pitch

      private float pitch
    • roll

      private float roll
  • Constructor Details

    • ComputeCameraAngles

      @Internal public ComputeCameraAngles(Camera camera, double renderPartialTicks, float yaw, float pitch, float roll)
  • Method Details

    • getYaw

      public float getYaw()
      Returns the yaw of the player's camera.
      Returns:
      the yaw of the player's camera
    • setYaw

      public void setYaw(float yaw)
      Sets the yaw of the player's camera.
      Parameters:
      yaw - the new yaw
    • getPitch

      public float getPitch()
      Returns the pitch of the player's camera.
      Returns:
      the pitch of the player's camera
    • setPitch

      public void setPitch(float pitch)
      Sets the pitch of the player's camera.
      Parameters:
      pitch - the new pitch
    • getRoll

      public float getRoll()
      Returns the roll of the player's camera.
      Returns:
      the roll of the player's camera
    • setRoll

      public void setRoll(float roll)
      Sets the roll of the player's camera.
      Parameters:
      roll - the new roll