Responsible for selecting a camera and blending when the active camera changes. The execution of the camera director is split into multiple layers.
- The Pre-Camera layer - These modifiers run before everything else and allow default values to be set before the rest of the camera system evaluates.
- The Main layer - The camera_component with the highest priority (defined by the priority given to AddCamera) executes here.
- The Post-Camera layer - These modifiers run on the accumulated result of the PreCamera and Main layers. This layer runs after any blending that may occur between active cameras, if we are currently transitioning between active camera_components. Intended to be the final Gameplay state of the camera system.
- The Presentation layer - These modifiers run on the accumulated result of the PreCamera, Main layer and Post-Camera layers. Intended for cosmetic effects like camera shake, that don't affect gameplay. '
Since a camera_director_component is a camera_component, camera directors can be nested. If the active camera is a camera director, then each layer of the entire active camera system will be evaluated in order. The entire Pre-Camera layer of all directors will evaluate, starting with the outermost director. The active camera of the innermost director will then evaluate, followed by any modifiers on the Main layer of the camera_director_component (the CameraModifiers modifier stack we inherit from camera_component). The entire Post-Camera layer of all directors will evaluate, starting with the outermost director. The entire Presentation layer of all directors will evaluate, starting with the outermost director.
Verse using statement |
using { /Verse.org/SceneGraph } |
Inheritance Hierarchy
This class is derived from the following hierarchy, starting with component:
| Name | Description |
|---|---|
component |
Base class for authoring logic and data in the SceneGraph. Using components you can author re-usable building blocks of logic and data which can then be added to entities in the scene. Components are a very low level building block which can be used in many ways. For example:
As components are generic there is no specific way that they must be used. It is up to the needs of your experience if you use one big game component or if you break up logic into many small components. Classes deriving from component must also specify Only one instance of a component from each subclass group can be added to an entity at a time. For example, given this group of components, only one light_component can exist on a single entity. To create multiple lights you should use multiple entities. light_component := class ============================================================================== Component Lifetime Components move through a series of lifetime functions as they are added to entities, added to the scene, and begin running in the simulation. Components should override these methods to perform setup and run their simulation. As a component shuts down it will then move through shutdown version of these
functions, giving users the opportunity to clean up any retained state on the
component before it is disposed
.
Lifetime Methods:
OnAddedToScene
OnBeginSimulation -> OnSimulate |
camera_component |
Represents the physical body, lens of the camera and other cinematographic qualities, such as sensor size, aspect ratio lock/constraint, focal length, focus distance, post-process settings, etc. |
Members
This class has both data members and functions.
Data
| Data Member Name | Type | Description |
|---|---|---|
CameraModifiers |
modifier_stack(t) |
Camera modifiers allow the behavior of a camera to be modified with custom logic. A camera modifier has an Evaluate function that takes in the current state of the camera (taking into account all previously executed modifiers) and returns the desired output camera state |
Entity |
entity |
The parent entity of this component.
|
FarClippingPlaneDistance |
?float |
Optionally override the far clipping plane distance, in centimeters. If value is |
NearClippingPlaneDistance |
?float |
Optionally override the near clipping plane distance, in centimeters. If value is <= |
PostCameraModifiers |
modifier_stack(t) |
Modifier stack containing modifiers that should run after the Pre-Camera and Main layers (the active camera_component) have been evaluated. In the case where we are blending between cameras, the Post Camera modifiers will run on the blended output state after all blending cameras have been evaluated. The Post Camera layer is useful for modifiers that you don't want to run multiple times when blending. Such as collision detection, or weapon recoil. |
PreCameraModifiers |
modifier_stack(t) |
Modifier stack containing modifiers that should run on the Pre-Camera layer before any camera_components are evaluated. Useful for setting default values that you want to be shared by the entire camera system. |
PresentationCameraModifiers |
modifier_stack(t) |
Modifier stack containing modifiers that should run after the Pre-Camera, Main and Post-Camera layers. The Presentation layer is intended to be used for purely cosmetic effects like camera shake. In future the intention is that you can use the PostCameraModifiers layer to define the "Gameplay" state of the camera system (for uses like aiming and character movement). Purely cosmetic effects that you don't want to affect the player's aim or movement direction can live in the Presentation layer. |
TickEvents |
?tick_events |
Set callbacks to |
Functions
| Function Name | Description |
|---|---|
AddCamera |
Add a camera to the director. The camera with the highest priority will be chosen to be the active camera. Fails if:
|
GetEnterTransition |
Get transition to use when entering this camera mode from |
GetExitTransition |
Get transition to use when exiting this camera mode to transition to |
IsInScene |
Succeeds if the component is currently in the scene.
|
IsSimulating |
Succeeds if the component is currently simulating.
|
OnAddedToScene |
Called when the component is added to the scene by parenting it under the simulation entity or another entity already in the scene.
|
OnBeginSimulation |
Called when the component begins simulating within the scene.
|
OnEndSimulation |
Called when the component ends simulation within the scene.
|
OnReceive |
Respond to a scene event. Return true to consume the event and halt propagation to the next entity. |
OnRemovingFromScene |
Called when the component is about to be removed from the scene.
|
OnSimulate |
Called when the component begins simulating within the scene.
|
RemoveFromEntity |
Removes the component from the entity.
|
SendDown |
Send a scene event to this component, invoking OnReceive. Returns true if any participant consumed the event. |