PerspectiveCamera class Scene graph
A standard pinhole-style perspective camera.
Defined by an eye position, a look-at target, an up direction, a vertical field-of-view (fovRadiansY), and a near/far frustum (fovNear/fovFar). The horizontal field of view is derived from the render target's aspect ratio at draw time.
Default placement is at (0, 0, -5) looking at the origin with +Y
up, suitable for inspecting a model that fits within a unit cube
centered on the origin.
Constructors
- PerspectiveCamera({double fovRadiansY = 45 * degrees2Radians, Vector3? position, Vector3? target, Vector3? up, double fovNear = 0.1, double fovFar = 1000.0})
- Creates a PerspectiveCamera.
Properties
- forward → Vector3
-
The world-space direction the camera looks along (unit length).
no setteroverride
- fovFar ↔ double
-
Distance to the far clipping plane. Geometry beyond this is clipped
away. Must be greater than fovNear.
getter/setter pair
- fovNear ↔ double
-
Distance to the near clipping plane. Geometry closer than this is
clipped away.
getter/setter pair
- fovRadiansY ↔ double
-
Vertical field of view, in radians.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- position ↔ Vector3
-
World-space position of the camera (the eye point).
getter/setter pairoverride-getter
- projection → CameraProjection
-
The lens projection paired with this camera's view.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- target ↔ Vector3
-
World-space point the camera is looking at.
getter/setter pair
- up ↔ Vector3
-
World-space "up" direction used to orient the camera around the
view vector. Typically
Vector3(0, 1, 0).getter/setter pairoverride-getter
Methods
-
getFrustum(
Size dimensions) → Frustum -
Returns the view frustum (six normalized clip planes) for a render
target of the given
dimensions.inherited -
getViewMatrix(
) → Matrix4 -
Returns the world-to-view transform (the view matrix), independent of
the render target size.
override
-
getViewTransform(
Size dimensions) → Matrix4 -
Returns the combined projection-and-view transform for a render target
of the given
dimensions.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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).inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited