Camera class abstract Scene graph
A view onto a scene: a world-space eye position and orientation paired with a lens projection, used by Scene.render to map the scene into clip space.
A camera separates its view (where it is and which way it looks, from getViewMatrix) from its projection (the lens, a CameraProjection). PerspectiveCamera is the built-in free camera, positioned by eye/target/up. Attach a CameraComponent to a Node to drive the view from that node's transform instead.
Constructors
- Camera()
Properties
- forward → Vector3
-
The world-space direction the camera looks along (unit length).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- position → Vector3
-
The world-space position of the camera (the eye point). Used by
materials for view-dependent shading (e.g. specular reflections).
no setter
- projection → CameraProjection
-
The lens projection paired with this camera's view.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- up → Vector3
-
The world-space up direction used to orient the camera around
forward.
no setter
Methods
-
getFrustum(
Size dimensions) → Frustum -
Returns the view frustum (six normalized clip planes) for a render
target of the given
dimensions. -
getViewMatrix(
) → Matrix4 - Returns the world-to-view transform (the view matrix), independent of the render target size.
-
getViewTransform(
Size dimensions, {Vector2? jitter}) → Matrix4 -
Returns the combined projection-and-view transform for a view of the
given
dimensions, in logical pixels (see CameraProjection.getProjectionMatrixForViewport). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
projectToScreenUv(
Vector3 worldPoint, Size viewport) → Vector2? -
Maps a world-space point to screen UV (origin top-left,
0..1acrossviewport). The projection worldToScreen scales to pixels, so the two cannot disagree. Returns null whenworldPointis at or behind the camera plane. Values outside0..1are a point off screen; callers decide whether to clamp or cull. -
screenPointToRay(
Offset screenPosition, Size viewSize) → Ray -
Maps a position inside a view (logical pixels, origin top-left) to the
world-space ray leaving the camera through that point, for picking
(
Scene.raycast) and pointer input.viewSizeis the view's logical size (the constraintsSceneViewrenders into). -
toString(
) → String -
A string representation of this object.
inherited
-
worldToScreen(
Vector3 worldPoint, Size viewSize) → Offset? - Maps a world-space point to its position inside a view (logical pixels, origin top-left), the forward counterpart of screenPointToRay.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited