Provides a base for the definition of camera objects.
In 3D rendering, a camera is something that defines a view and a projection using a pair of matrices. This class provides the APIs and behaviours describing the view component of a camera. Subclasses like CYIOrthographicCameraSceneNode and CYIPerspectiveCameraSceneNode add additional APIs and behaviours to describe the projection component.
By virtue of being a scene node a camera can be positioned and oriented spatially relative to other nodes. The view matrix of a camera is the undoing of this positioning and orientation such that the rest of the scene becomes centered and oriented around the camera. The effect of this view matrix, when applied to the world transformation of another node in the scene, is to re-position the node in the location and orientation from which the camera object is seeing it.
Additionally, a camera can have an optional target scene node which it will face before having its transformations applied. The camera will continue to follow this target if either the camera node or its target move.
#include <scenetree/YiAbstractCameraSceneNode.h>
Public Member Functions | |
virtual | ~CYIAbstractCameraSceneNode () |
virtual bool | Init () override |
void | SetUpVector (const glm::vec3 &camUp) |
const glm::vec3 & | GetUpVector () const |
void | SetNearPlane (float nearZ) |
float | GetNearPlane () const |
void | SetFarPlane (float farZ) |
float | GetFarPlane () const |
void | SetTarget (CYISceneNode *pTargetNode) |
CYISceneNode * | GetTarget () const |
void | RemoveTarget () |
const glm::mat4 & | GetCameraMatrix () const |
void | SetViewport (const YI_FLOAT_RECT_REL &viewport) |
const YI_FLOAT_RECT_REL & | GetViewport () const |
const glm::mat4 & | GetViewMatrix () const |
const glm::mat4 & | GetProjectionMatrix () const |
bool | IsEnabled () const |
void | SetEnabled (bool enabled, bool rerender=true) |
![]() | |
CYISceneNode () | |
virtual | ~CYISceneNode () |
bool | IsInitialized () const |
void | ForceDirty () |
void | SetDirtyFlag (DirtyFlag dirtyFlag) |
DirtyFlag | GetDirtyFlag () const |
DirtyFlag | GetPreviousDirtyFlag () const |
const CYIString & | GetName () const |
CYIString | GetUniqueName () const |
void | SetSceneManager (CYISceneManager *pSceneManager) |
void | SetName (const CYIString &name) |
int32_t | GetID () const |
void | SetID (int32_t id) |
uint64_t | GetUniqueID () const |
bool | AddChild (std::unique_ptr< CYISceneNode > pSceneNode) |
bool | AddChild (std::unique_ptr< CYISceneNode >, size_t index) |
bool | InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode) |
std::unique_ptr< CYISceneNode > | RemoveChild (CYISceneNode *pSceneNode) |
bool | ReorderChild (size_t fromIndex, size_t toIndex) |
CYITransform * | GetTransform () |
CYISceneNode * | GetParent () const |
bool | ChangeParent (CYISceneNode *pParent) |
CYISceneNode * | GetDrawParent () const |
bool | IsAncestorOf (const CYISceneNode *pNode) const |
CYISceneManager * | GetSceneManager () const |
size_t | GetChildCount () const |
uint32_t | GetChildCountRecursive () const |
CYISceneNode * | GetChild (size_t index) const |
Iterator | begin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const |
Iterator | end (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const |
ReverseIterator | rbegin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const |
ReverseIterator | rend (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const |
CYISceneNode * | GetChild (const CYIString &name) const |
size_t | GetDrawChildCount () const |
CYISceneNode * | GetDrawChild (size_t index) const |
CYISceneNode * | GetDrawChildByID (int32_t id) const |
template<class YI_SCENE_NODE_SUBCLASS > | |
YI_SCENE_NODE_SUBCLASS * | GetChild (uint32_t targetMatchedNodeCount=1) const |
template<class YI_SCENE_NODE_SUBCLASS > | |
std::list< YI_SCENE_NODE_SUBCLASS * > | GetChildren () const |
template<class YI_SCENE_NODE_SUBCLASS > | |
std::list< YI_SCENE_NODE_SUBCLASS * > | GetDrawChildren () const |
size_t | GetIndexOfChild (const CYISceneNode *pSceneNode) const |
size_t | GetIndexOfDrawChild (const CYISceneNode *pSceneNode) const |
void | Show () |
void | Hide () |
void | SetVisibility (bool visible) |
void | SetOpacity (float opacity) |
float | GetCompositeOpacity () const |
float | GetLocalOpacity () const |
bool | IsVisible () const |
bool | IsTrulyVisible () const |
bool | IsPerceptible () const |
CYISceneNode * | GetNode (CYIStringView name) |
CYISceneNode * | GetNode (CYIStringView name, const CYIRuntimeTypeInfo &enforceClassType) |
CYISceneNode * | GetNode (const CYIRuntimeTypeInfo &enforceClassType) |
CYISceneNode * | GetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget) |
template<class YI_SCENE_NODE_SUBCLASS > | |
YI_SCENE_NODE_SUBCLASS * | GetNode (CYIStringView name) |
CYISceneNode * | GetNode (const int32_t id) |
CYISceneNode * | GetNode (const int32_t id, const CYIRuntimeTypeInfo &enforceClassType) |
CYISceneNode * | GetNodeWithUniqueID (uint64_t uniqueID) |
template<class YI_SCENE_NODE_SUBCLASS > | |
bool | FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, CYIStringView nodeName, FetchType type, const CYIString &tag) |
std::list< CYISceneNode * > | GetNodes (CYIStringView name) |
std::list< CYISceneNode * > | GetNodes (int32_t id) |
std::list< CYISceneNode * > | GetNodes (const CYIRuntimeTypeInfo &enforceClassType) |
template<class YI_SCENE_NODE_SUBCLASS > | |
const YI_SCENE_NODE_SUBCLASS * | GetNode (uint32_t targetMatchedNodeCount=1) const |
template<class YI_SCENE_NODE_SUBCLASS > | |
YI_SCENE_NODE_SUBCLASS * | GetNode (uint32_t targetMatchedNodeCount=1) |
void | SetMesh (const std::shared_ptr< CYIMesh > &pMesh) |
bool | SetNPatchBitmap (const std::shared_ptr< CYIBitmap > &pNPatchBitmap) |
void | ClearNPatch () |
void | SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, size_t index=0) |
void | AddEffect (const std::shared_ptr< CYIEffect > &pEffect) |
void | RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect) |
size_t | GetEffectCount () const |
const std::shared_ptr< CYIEffect > & | GetEffect (size_t index) const |
void | ConnectEffectsToTimelines (const CYITimelineTrack *pTrack) |
void | AddMask (std::unique_ptr< CYIMask > pMask) |
std::unique_ptr< CYIMask > | RemoveMask (const CYIMask *pMask) |
size_t | GetMaskCount () const |
const CYIMask * | GetMask (size_t index) const |
CYIMask * | GetMask (size_t index) |
const std::shared_ptr< CYIMesh > & | GetMesh () const |
const std::shared_ptr< CYIBitmap > & | GetNPatchBitmap () const |
size_t | GetMaterialCount () const |
const std::shared_ptr< CYIMaterial > & | GetMaterial (size_t index=0) const |
const std::shared_ptr< IYIUniformBufferObject > & | GetShaderUniforms () const |
void | SetMeshTransform (const glm::mat4 &transform) |
void | DestroyChildren () |
glm::mat4 | GetLocalTransform () const |
glm::mat4 | GetWorldTransform () const |
bool | Intersects (const CYISceneNode *pNode) const |
void | SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget) |
const std::shared_ptr< CYIRenderTarget > & | GetRenderTarget () const |
virtual void | OnPreBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList, std::vector< CYIAbstractCameraSceneNode *> *pDrawWithCameraList) |
virtual void | OnPostBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList) |
const CYIAABB & | GetWorldAABB () const |
const CYIAABB & | GetLocalAABB () const |
void | SetAnchorPoint (const glm::vec3 &anchorPoint) |
void | SetAnchorPoint (float x, float y, float z) |
void | SetAnchorPointX (float x) |
void | SetAnchorPointY (float y) |
void | SetAnchorPointZ (float z) |
void | SetPosition (const glm::vec3 &position) |
void | SetPosition (float x, float y, float z) |
void | SetPositionX (float x) |
void | SetPositionY (float y) |
void | SetPositionZ (float z) |
void | SetRotation (const glm::vec3 &rotation) |
void | SetRotation (float pitchDegrees, float yawDegrees, float rollDegrees) |
void | SetRotationX (float pitchDegrees) |
void | SetRotationY (float yawDegrees) |
void | SetRotationZ (float rollDegrees) |
void | SetOrientation (float pitchDegrees, float yawDegrees, float rollDegrees) |
void | SetOrientation (const glm::quat &orientation) |
void | SetScale (const glm::vec3 &scale) |
void | SetScale (float factorX, float factorY, float factorZ) |
void | SetScaleX (float factor) |
void | SetScaleY (float factor) |
void | SetScaleZ (float factor) |
const glm::vec3 & | GetPosition () const |
const glm::vec3 & | GetScale () const |
const glm::vec3 & | GetWorldScale () const |
const glm::vec3 & | GetWorldSurfaceScale () const |
const glm::vec3 & | GetRotation () const |
const glm::quat & | GetOrientation () const |
const glm::vec3 & | GetAnchorPoint () const |
virtual void | SetSize (const glm::vec3 &size, bool dirtyLayout=true) |
const glm::vec3 & | GetSize () const |
const glm::vec3 & | GetInitialSize () const |
void | SetMeasuredSize (const glm::vec3 &measuredSize) |
const glm::vec3 & | GetMeasuredSize () const |
void | SetInternalCustomTimelineValue (uint32_t trackID, const CYIVariant &value) |
virtual void | SetCustomTimelineValue (uint32_t trackID, const CYIVariant &value) |
void | SetClippingOn () |
void | SetClippingOff () |
bool | GetClipping () const |
void | SetClippingBox (const CYIAABB &worldBox) |
const CYIAABB & | GetClippingBox () const |
void | StartPropertyAnimation (PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool dirtyLayout=true) |
void | StopPropertyAnimation (PropertyAnimation::Type propType) |
void | UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent) |
virtual bool | BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) |
void | UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const |
bool | IsBoundingBoxHit (const CYIRay &worldSpaceRay) const |
bool | IsMeshHit (const CYIRay &worldSpaceRay) const |
void | DumpTree () const |
void | StartCaptureKeyboardEvents () |
void | StopCaptureKeyboardEvents () |
void | StartCaptureTrackpadEvents () |
void | StopCaptureTrackpadEvents () |
void | StartCapturePointerEvents (uint8_t pointerID) |
void | StopCapturePointerEvents (uint8_t pointerID) |
bool | DrawBehindChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | DrawInFrontOfChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | DrawBehind (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | DrawInFront (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | IsFocusRoot () const |
void | SetIsFocusRoot (bool isFocusRoot) |
virtual void | OnFocusGainedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | FocusGainedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | OnFocusLostInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | FocusLostInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | OnFocusChangedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | FocusChangedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual bool | ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const |
void | SetUseLocalTransformAndAlpha (bool use) |
virtual CYIOptional< CYIStringView > | GetProperty (CYIStringView propertyName) const override |
bool | GetProperty (CYIStringView propertyName, CYIString *pValue) const |
virtual std::map< CYIString, CYIString > | GetProperties () const override |
virtual void | ForEachProperty (const std::function< void(const CYIString &, const CYIString &)> &action) const override |
virtual bool | HasProperties () const override |
void | SetProperty (const CYIString &propertyName, const CYIString &propertyValue) |
std::shared_ptr< CYISceneNodeProxy > | GetSceneNodeProxy () const |
void | SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig) |
const CYILayoutConfig * | GetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) const |
CYILayoutConfig * | GetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) |
void | SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState) |
const CYILayoutState * | GetLayoutState () const |
CYILayoutState * | GetLayoutState () |
void | RequestLayout () |
LayoutDirtyFlag | GetLayoutDirtyFlag () const |
virtual void | SetLayoutDirtyFlag (LayoutDirtyFlag flag) |
virtual void | Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec) |
virtual void | ApplyMeasurements () |
virtual CYIAbstractCameraSceneNode * | FindActiveCamera (const CYISceneNode *pTargetSceneNode=nullptr) const |
CYIAccessibilityAttributes::Accessible | GetAccessible () const |
void | SetAccessible (CYIAccessibilityAttributes::Accessible accessible) |
const CYIAccessibilityAttributes * | GetAccessibilityAttributes () const |
std::unique_ptr< CYIAccessibilityAttributes > | TakeAccessibilityAttributes () |
void | SetAccessibilityAttributes (std::unique_ptr< CYIAccessibilityAttributes > pAttributes) |
const CYIRenderable * | GetRenderable () const |
template<typename T > | |
bool | CanCastTo () const |
CYIAdjustmentLayerSceneNode * | GetLastAdjustmentLayer () const |
![]() | |
CYIEventTarget () | |
virtual | ~CYIEventTarget () |
bool | AddEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble) |
bool | RemoveEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble) |
void | SetSpecialTypeFlag (SpecialEventTargetType type) |
void | ClearSpecialTypeFlag (SpecialEventTargetType type) |
SpecialEventTargetType | GetSpecialTypes () const |
const std::shared_ptr< CYIEventTargetProxy > & | GetProxy () const |
![]() | |
CYISignalHandler () | |
CYISignalHandler (const CYISignalHandler &signalHandler) | |
virtual | ~CYISignalHandler () |
CYISignalHandler & | operator= (const CYISignalHandler &signalHandler) |
void | MoveToThread (CYIThread *pThread) |
This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More... | |
CYIThreadHandle | GetThreadAffinity () const |
void | SetThreadAffinity (const CYIThreadHandle &threadAffinity) |
virtual bool | IsConnected () const |
virtual bool | IsConnected (const CYISignalBase &signal) const |
void | Disconnect (CYISignalBase &signal) |
void | DisconnectFromAllSignals () |
![]() | |
Listener () | |
virtual | ~Listener () |
virtual void | OnThreadStarted (CYIThread *) |
virtual void | OnThreadTerminated (CYIThread *) |
virtual void | OnThreadFinished (CYIThread *) |
![]() | |
virtual | ~IYIPropertiesSource ()=default |
bool | GetProperty (CYIStringView propertyName, CYIString *pValue) const |
![]() | |
UpdateListener () | |
virtual | ~UpdateListener () |
virtual bool | GetDisablesInput () |
Protected Member Functions | |
CYIAbstractCameraSceneNode () | |
void | DirtyProjectionMatrix () |
virtual glm::mat4 | CalculateProjectionMatrix () const =0 |
glm::mat4 | CalculateViewMatrix () const |
glm::mat4 | CalculateViewportMatrix () const |
virtual bool | OnFrameTimeUpdated (std::chrono::microseconds frameTime) override |
virtual void | UpdateEnd () override |
virtual CYIString | GetDumpTreeString () const override |
![]() | |
void | Update () |
virtual void | OnUpdateBegin () |
virtual void | UpdateBegin () |
virtual void | OnUpdateEnd () |
virtual void | OnDirtyFlagChanged () |
virtual void | DirtyFlagChanged () |
virtual void | OnTransformUpdated () |
virtual void | TransformUpdated () |
virtual void | OnWorldScaleUpdated () |
virtual void | WorldScaleUpdated () |
virtual void | OnWorldSurfaceScaleUpdated () |
virtual void | WorldSurfaceScaleUpdated () |
virtual void | OnVisibilityUpdated () |
virtual void | VisibilityUpdated () |
virtual void | OnCompositeOpacityUpdated () |
virtual void | CompositeOpacityUpdated () |
virtual void | OnWorldBoundingBoxUpdated () |
virtual void | WorldBoundingBoxUpdated () |
virtual void | OnLocalBoundingBoxUpdated () |
virtual void | LocalBoundingBoxUpdated () |
virtual void | OnChildAdded (CYISceneNode *pChild) |
virtual void | ChildAdded (CYISceneNode *pChild) |
virtual void | OnChildRemoved (CYISceneNode *pChild) |
virtual void | ChildRemoved (CYISceneNode *pChild) |
virtual void | OnSizeChanged () |
virtual void | SizeChanged () |
virtual void | ChildNeedsLayout () |
virtual void | LayoutDirtied () |
virtual void | OnChildVisibilityChanged (CYISceneNode *pChild) |
virtual void | ChildVisibilityChanged (CYISceneNode *pChild) |
virtual void | OnDrawOrderChanged () |
virtual bool | ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override |
LayoutDirtyFlag | GetCurrentLayoutDirtyFlag () const |
void | DumpTree (int32_t indentLevel) const |
virtual void | SetCustomUniforms () |
template<class T > | |
void | SetNodeType () |
virtual CYISceneNode * | GetNodeFromChildren (CYIStringView name) |
virtual CYISceneNode * | GetNodeFromChildren (const int32_t id) |
virtual CYISceneNode * | GetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType) |
CYISceneNode * | GetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget) |
Additional Inherited Members | |
![]() | |
enum | LayoutDirtyFlag : uint8_t { LayoutDirtyFlag::Clean, LayoutDirtyFlag::ChildDirty, LayoutDirtyFlag::Dirty } |
enum | LayoutConfigFetchMode { LayoutConfigFetchMode::DoNotLazyInstantiate = 0, LayoutConfigFetchMode::LazyInstantiate } |
enum | MeasureMode { MeasureMode::Unspecified, MeasureMode::UpTo, MeasureMode::Exactly } |
enum | FetchType { FetchType::Optional = 0, FetchType::Mandatory } |
typedef std::reverse_iterator< Iterator > | ReverseIterator |
typedef uint16_t | DirtyFlag |
![]() | |
enum | SpecialEventTargetType : uint8_t { SpecialEventTargetType::None = 0x00, SpecialEventTargetType::NoPick = 0x20 } |
enum | Phase : uint8_t { Phase::Bubble, Phase::Capture } |
![]() | |
static void | RegisterAllSceneNodes () |
![]() | |
CYISignal< CYISceneNode *, PropertyAnimation::Type > | PropertyAnimationComplete |
CYISignal< CYISceneNode *, CYISceneNode *> | DescendantGainedFocus |
Emitted when focus has entered this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More... | |
CYISignal< CYISceneNode *, CYISceneNode *> | DescendantLostFocus |
Emitted when focus has left this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More... | |
CYISignal< CYISceneNode *, CYISceneNode *> | DescendantsChangedFocus |
Emitted when focus has changed within this tree. This signal is called only if focus was previously within this tree and focus is now on a different node (but still within this tree). The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More... | |
CYISignal< CYIAccessibilityAttributes::Accessible > | AccessibleStateChanged |
Emitted when accessible state changed. More... | |
![]() | |
CYIString | m_name |
CYISceneNode * | m_pParent |
CYISceneNode * | m_pDrawParent |
std::vector< std::unique_ptr< CYISceneNode > > | m_children |
std::vector< CYISceneNode * > | m_drawChildren |
std::map< CYIString, CYIString, std::less< void > > | m_Properties |
std::vector< std::shared_ptr< CYIEffect > > | m_Effects |
std::vector< std::unique_ptr< PropertyAnimation > > | m_propertyAnimations |
float | m_localOpacity |
std::unique_ptr< CYITransform > | m_pTransform |
glm::vec3 | m_size |
glm::vec3 | m_initialSize |
glm::vec3 | m_measuredSize |
glm::vec3 | m_vlsLastCollision |
bool | m_clip |
bool | m_localVisibility |
int32_t | m_id |
uint64_t | m_guid |
std::unique_ptr< CYINPatch > | m_pNPatch |
std::shared_ptr< CYIBitmap > | m_pNPatchBitmap |
std::shared_ptr< CYIRenderable > | m_pRenderable |
![]() | |
std::vector< EventListenerEntry > | m_listeners |
SpecialEventTargetType | m_specialTypes |
std::shared_ptr< CYIEventTargetProxy > | m_pEventTargetProxy |
|
virtual |
|
protected |
|
protectedpure virtual |
Subclasses must implement this function to return their calculated projection matrix. This function will be called if the result of IsProjectionDirty() is true on a given frame.
Implemented in CYIPerspectiveCameraSceneNode, and CYIOrthographicCameraSceneNode.
|
protected |
The view matrix represents the transformation required to center the world coordinate system on the position and orientation of the camera.
|
protected |
The viewport transform, when applied to a vertex that has undergone the view and projection transforms, will place that vertex into a viewport sized rectangle placed at the origin of the camera's parent node.
The view and projection matrices will result in a bottom-left oriented coordinate system, with +Y being "up," but the coordinate system of the user interface is top-left anchored, so this matrix contains a flip on Y.
|
protected |
Subclasses must call this function if their projection matrix needs to be recalculated
const glm::mat4& CYIAbstractCameraSceneNode::GetCameraMatrix | ( | ) | const |
The camera matrix represents the transformations required to display the point of view of the camera inside the region which is represented by the camera's viewport.
This matrix is a concatenation of the camera's view, then projection, and then viewport and viewport world matrices. The effect of applying this matrix on top of world-space vertex coordinates is to map those coordinates on to the viewport of this camera, which is described as a rectangle also defined in world-space.
|
overrideprotectedvirtual |
Returns a string containing useful information about this node, displayed by DumpTree
Subclasses can implement this method to specify different or additional information. Appending to the default string is recommended.
Reimplemented from CYISceneNode.
Reimplemented in CYIPerspectiveCameraSceneNode, and CYIOrthographicCameraSceneNode.
float CYIAbstractCameraSceneNode::GetFarPlane | ( | ) | const |
Get the far plane for the camera's view frustum in eye coordinates.
Eye space refers to a coordinate system in which the camera's position is the origin and the camera is facing +Z.
Objects that are farther than the far plane won't be visible.
float CYIAbstractCameraSceneNode::GetNearPlane | ( | ) | const |
Get the near plane for the camera's view frustum in eye coordinates.
Eye space refers to a coordinate system in which the camera's position is the origin and the camera is facing +Z.
Objects that are closer than the near plane will not be visible.
const glm::mat4& CYIAbstractCameraSceneNode::GetProjectionMatrix | ( | ) | const |
The projection matrix is calculated based on the camera's projection properties. This differs based on the type of camera and details can be found in the concrete implementations of CYIAbstractCameraSceneNode.
CYISceneNode* CYIAbstractCameraSceneNode::GetTarget | ( | ) | const |
Returns the target for the camera, or nullptr if the camera has no target.
const glm::vec3& CYIAbstractCameraSceneNode::GetUpVector | ( | ) | const |
Returns the up vector of the camera. The up vector, expressed in world coordinates, represents which direction "up" will be from the camera's point of view. Imagining the camera as an object in the scene, its up vector determines which direction the top of the camera will be facing.
const glm::mat4& CYIAbstractCameraSceneNode::GetViewMatrix | ( | ) | const |
The view matrix is calculated from the camera's world transformation, and represents the transform required to center the world coordinate system on the location and orientation of the camera.
const YI_FLOAT_RECT_REL& CYIAbstractCameraSceneNode::GetViewport | ( | ) | const |
|
overridevirtual |
Initializes the scene node. Children of the scene node are also recursively initialized.
Subclasses must call CYISceneNode::Init.
Reimplemented from CYISceneNode.
bool CYIAbstractCameraSceneNode::IsEnabled | ( | ) | const |
Returns whether this camera scene node is enabled. Only enabled cameras are considered when finding the active camera of a scene node.
|
overrideprotectedvirtual |
Implement this function to receive frame time update notifications. Return true if you want to keep receiving notifications. Return false if you want the listener to unregister.
Implements CYITime::UpdateListener.
void CYIAbstractCameraSceneNode::RemoveTarget | ( | ) |
Equivalent to calling SetTarget(nullptr)
Remove the target of the camera. The camera will stop tracking the target and return to the orientation defined by its own rotation properties.
This function does not release any memory, the target is not owned by the camera and it is up to the allocating class to delete the target.
void CYIAbstractCameraSceneNode::SetEnabled | ( | bool | enabled, |
bool | rerender = true |
||
) |
Sets whether this camera scene node is enabled. Only enabled cameras are considered when finding the active camera of a scene node.
void CYIAbstractCameraSceneNode::SetFarPlane | ( | float | farZ | ) |
Set the far plane of the camera's view frustum in eye coordinates.
Eye space refers to a coordinate system in which the camera's position is the origin and the camera is facing +Z.
Objects that are farther than the far plane won't be visible.
void CYIAbstractCameraSceneNode::SetNearPlane | ( | float | nearZ | ) |
Set the near plane for the camera's view frustum in eye coordinates.
Eye space refers to a coordinate system in which the camera's position is the origin and the camera is facing +Z.
Objects that are closer than the near plane will not be visible.
void CYIAbstractCameraSceneNode::SetTarget | ( | CYISceneNode * | pTargetNode | ) |
Specify a node to use as the camera's point of interest. The transformations of the camera will be applied after the camera has been made to face the target. If no target is provided, the transformations of the camera will be applied from the default pose which is facing +Z.
Setting the camera's target and applying no additional transforms to the camera will result in the target being kept centered on the camera's view. An additional transform, like a 10 degree rotation on Y, will cause the target to move off of the center of the camera; the camera will be looking at a point 10 degrees beside the target from its position. Generally: the camera will orient toward the target and then apply its local orientation overtop.
By default this target will be null and the camera's rotation transforms will dictate where it faces. Adding a target will re-orient the camera to follow the target.
void CYIAbstractCameraSceneNode::SetUpVector | ( | const glm::vec3 & | camUp | ) |
Set the up vector for the camera. The up vector, expressed in world coordinates, represents which direction "up" will be from the camera's point of view. Imagining the camera as an object in the scene, its up vector determines which direction the top of the camera will be facing.
void CYIAbstractCameraSceneNode::SetViewport | ( | const YI_FLOAT_RECT_REL & | viewport | ) |
Sets the viewport for this camera.
The objects affected by the camera will be rendered to fit inside of this viewport, which will be placed at the origin of the node (that is, the point (0,0,0)) which is the parent of this camera.
Generally, the viewport is specified to be (0, 0, view.width, view.height), where "view" is a CYISceneView which is the parent of this camera.
|
overrideprotectedvirtual |
This hook provides subclasses a means to do operations subsequent to update. This hook is called after all children of the current node have been updated, and after all other update hooks have been called.
Reimplemented from CYISceneNode.
|
static |
The frustum distance defines the distance between the near and far planes of the cameras.
Things outside this range, i.e. closer than the near plane or further than the far plane, will be clipped by the render pipeline.