PlanarReflectionCamera class Rendering
The camera a planar reflection capture renders with: source reflected
across plane, with an oblique projection that clips geometry behind the
mirror (offset clipBias world units in front of it).
The reflected basis is proper (built from the reflected position, aim, and up through the engine's look-at), so the capture draws with unflipped winding; sampling projects the fragment's world position through the capture's view-projection, which makes the mirroring consistent by construction.
Also usable for a custom mirror: render a RenderView with it into a texture and sample that texture through the camera's view-projection. The plane's normal points to the side that stays.
Constructors
- PlanarReflectionCamera({required Camera source, required Plane plane, double clipBias = 0.0})
Properties
- forward → Vector3
-
The world-space direction the camera looks along (unit length).
no setteroverride
- 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 setteroverride
- 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
- up → Vector3
-
The world-space up direction used to orient the camera around
forward.
no setteroverride
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, {Vector2? jitter}) → Matrix4 -
Returns the combined projection-and-view transform for a view of the
given
dimensions, in logical pixels (see CameraProjection.getProjectionMatrixForViewport).inherited -
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.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
-
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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited