Interface CameraPosition


public interface CameraPosition
This interface represents a camera position instruction. Can be built with the builder().

Any camera position instruction pins the client camera to a specific position and rotation. You can set CameraEaseType to ensure a smooth transition that will last easeSeconds() seconds. A CameraFade can also be sent, which will transition the player to a coloured transition during the transition.

Use CameraData.sendCameraPosition(CameraPosition) to send such an instruction to any connection.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a Builder for CameraPosition
    @Nullable CameraFade
    Gets the CameraFade to be sent along the camera position instruction.
    float
    Gets the easing duration of the camera, in seconds.
    @Nullable CameraEaseType
    Gets the CameraEaseType of the camera.
    @Nullable org.cloudburstmc.math.vector.Vector3f
    Gets the position that the camera is facing.
    boolean
    Controls whether the player position should be used for directional audio.
    @NonNull org.cloudburstmc.math.vector.Vector3f
    Gets the camera's position.
    boolean
    Controls whether player effects, such as night vision or blindness, should be rendered on the camera.
    @org.checkerframework.common.value.qual.IntRange(from=-90L, to=90L) int
    Gets the x-axis rotation of the camera.
    int
    Gets the y-axis rotation of the camera.
  • Method Details

    • position

      @NonNull org.cloudburstmc.math.vector.Vector3f position()
      Gets the camera's position.
      Returns:
      camera position vector
    • easeType

      @Nullable CameraEaseType easeType()
      Gets the CameraEaseType of the camera. If not set, there is no easing.
      Returns:
      camera ease type
    • cameraFade

      @Nullable CameraFade cameraFade()
      Gets the CameraFade to be sent along the camera position instruction. If set, they will run at once.
      Returns:
      camera fade, or null if not present
    • easeSeconds

      float easeSeconds()
      Gets the easing duration of the camera, in seconds. Is only used if a CameraEaseType is set.
      Returns:
      camera easing duration in seconds
    • rotationX

      @org.checkerframework.common.value.qual.IntRange(from=-90L, to=90L) int rotationX()
      Gets the x-axis rotation of the camera. To prevent the camera from being upside down, Bedrock limits the range to -90 to 90. Will be overridden if facingPosition() is set.
      Returns:
      camera x-axis rotation
    • rotationY

      int rotationY()
      Gets the y-axis rotation of the camera. Will be overridden if facingPosition() is set.
      Returns:
      camera y-axis rotation
    • facingPosition

      @Nullable org.cloudburstmc.math.vector.Vector3f facingPosition()
      Gets the position that the camera is facing. Can be used instead of manually setting rotation values.

      If set, the rotation values set via rotationX() and rotationY() will be ignored.

      Returns:
      Camera's facing position
    • renderPlayerEffects

      boolean renderPlayerEffects()
      Controls whether player effects, such as night vision or blindness, should be rendered on the camera. Defaults to false.
      Returns:
      whether player effects should be rendered
    • playerPositionForAudio

      boolean playerPositionForAudio()
      Controls whether the player position should be used for directional audio. If false, the camera position will be used instead.
      Returns:
      whether the players position should be used for directional audio
    • builder

      static CameraPosition.Builder builder()
      Creates a Builder for CameraPosition
      Returns:
      a CameraPosition Builder