VirtualCameraComponent class
Makes its entity a virtual camera.
A virtual camera is a shot, not the camera: the brain picks the enabled one with the highest priority and blends to it. Its entity's transform is where the shot sits when nothing moves it; the stage components on the same entity — framing, confiner, noise — are what move it.
The target is an EntityTarget — an entity name or a tag — looked up each frame. That is what lets a level's camera follow a player who does not exist until the game spawns one.
Constructors
- VirtualCameraComponent({int priority = 10, bool enabled = true, EntityTarget follow = EntityTarget.none, double zoom = 1.0, double dutch = 0.0, CameraStandbyUpdate standbyUpdate = CameraStandbyUpdate.never, CameraProjection projection = CameraProjection.orthographic, double fieldOfView = math.pi / 3, double nearClip = -10000, double farClip = 10000})
-
An enabled 2-D shot at priority 10 and zoom 1, following nothing,
evaluated only while live, unless told otherwise.
fieldOfView(60°) matters only onceprojectionis perspective.
Properties
- componentType → Type
-
Type identifier for this component
no setterinherited
- dutch ↔ double
-
Roll added to the entity's own rotation, in radians.
getter/setter pair
- enabled ↔ bool
-
A disabled camera is never live and never evaluated.
getter/setter pair
- farClip ↔ double
-
Furthest distance drawn.
getter/setter pair
- fieldOfView ↔ double
-
Vertical field of view in radians, for a perspective shot.
getter/setter pair
- follow ↔ EntityTarget
-
Who it follows: an entity by name, or the first entity with a tag.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasTarget → bool
-
Whether follow names anything. The entity it names may still not
exist this frame.
no setter
- lens → CameraLens
-
The lens these describe.
no setter
- nearClip ↔ double
-
Nearest distance drawn. At or behind the camera, a perspective shot
uses 1 instead (an orthographic one sees behind itself).
getter/setter pair
- priority ↔ int
-
Higher wins. Between equals, the one activated most recently.
getter/setter pair
- projection ↔ CameraProjection
-
Orthographic — a 2-D shot, sized by zoom — or perspective.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- standbyUpdate ↔ CameraStandbyUpdate
-
Whether it keeps evaluating while not live, so it is settled when it
goes live, or snaps to its target then.
getter/setter pair
- zoom ↔ double
-
The lens:
1= one world unit per pixel, larger is closer.getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAttach(
EntityId entityId) → void -
Called when this component is added to an entity.
inherited
-
onDetach(
EntityId entityId) → void -
Called when this component is removed from an entity.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited