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 -
Method Summary
Modifier and TypeMethodDescriptionstatic CameraPosition.Builderbuilder()Creates a Builder for CameraPosition@Nullable CameraFadeGets theCameraFadeto be sent along the camera position instruction.floatGets the easing duration of the camera, in seconds.@Nullable CameraEaseTypeeaseType()Gets theCameraEaseTypeof the camera.@Nullable org.cloudburstmc.math.vector.Vector3fGets the position that the camera is facing.booleanControls whether the player position should be used for directional audio.org.cloudburstmc.math.vector.Vector3fposition()Gets the camera's position.booleanControls 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) intGets the x-axis rotation of the camera.intGets the y-axis rotation of the camera.
-
Method Details
-
position
org.cloudburstmc.math.vector.Vector3f position()Gets the camera's position.- Returns:
- camera position vector
-
easeType
@Nullable CameraEaseType easeType()Gets theCameraEaseTypeof the camera. If not set, there is no easing.- Returns:
- camera ease type
-
cameraFade
@Nullable CameraFade cameraFade()Gets theCameraFadeto 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 aCameraEaseTypeis 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 iffacingPosition()is set.- Returns:
- camera x-axis rotation
-
rotationY
int rotationY()Gets the y-axis rotation of the camera. Will be overridden iffacingPosition()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()androtationY()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
Creates a Builder for CameraPosition- Returns:
- a CameraPosition Builder
-