Aligns the camera to the plane defined by the provided position and normal. This will place the camera at the provided position, set the up vector to the provided normal, and place the lookAt on the defined plane. The point chosen for the lookAt will be determined using the current view vector.
The position to place the camera at.
The normal of the plane to align to.
Updates the position of the camera such that the given bounding box will be contained within the camera's view.
The bounding box to position to.
Specifies that the next render of the camera will be repositioned to one of
the options specified in options
.
An object or query describing how the camera should be positioned.
Shifts the position of the camera by the given delta.
The number of units to shift the camera on the X, Y, and Z axis.
Queues the rendering for a new frame using this camera. The returned promise will resolve when a frame is received that contains this camera.
Repositions the camera by rotating its current position around an axis placed
at the lookAt
point. This method internally will call Camera.rotateAroundAxisAtPoint
with the point
parameter set to the current lookAt
point.
The angle, in radians, to rotate.
A normalized vector to rotate around.
Repositions the camera by rotating its current position around an axis defined at a specific world point.
The angle, in radians, to rotate.
The point in world space to place the axis at.
A normalized vector to rotate around.
Returns the distance from the camera's position to the center of the provided bounding box (or the scene's visible bounding box if not provided).
The bounding box to determine distance from.
Updates the position
and up
vectors of the camera to the given standard
view, and sets the lookAt
point to the origin.
The standard view to apply.
A new camera.
Updates the position
and up
vectors of the camera to the given standard
view, maintaining the existing lookAt
point.
The standard view to apply.
A new camera.
Returns a FrameCameraBase
representation.
Updates the position
, lookAt
and/or up
vectors of the camera. Each
vector can be omitted in the payload, and the resulting camera will keep
the previous position
, lookAt
, or up
vectors.
The values to update the camera to.
Performs a flyTo
operation with the current visible bounding box of
the scene.
The
Camera
class contains properties that reflect a world space position, a view direction (lookAt), and normalized vector representing the up direction.It also provides utility methods to update orientation of the camera and rerender the scene.
This class in intended to treated as an immutable type. Any mutations return a new instance of the class with the updated properties.