You.i Engine
CYIAbstractCameraSceneNode Class Referenceabstract

Detailed Description

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>

Inheritance diagram for CYIAbstractCameraSceneNode:

Public Member Functions

void SetUpVector (const glm::vec3 &fCamUp)
 
const glm::vec3 & GetUpVector () const
 
void SetTarget (CYISceneNode *pTargetNode)
 
CYISceneNodeGetTarget () const
 
void RemoveTarget ()
 
const glm::mat4 & GetCameraMatrix () const
 
void SetViewport (const CYIViewport &viewport)
 
const CYIViewportGetViewport () const
 
const glm::mat4 & GetViewMatrix () const
 
const glm::mat4 & GetProjectionMatrix () const
 
- Public Member Functions inherited from CYISceneNode
 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
virtual bool Init ()
 
void ForceDirty ()
 
void ClearDirtyFlag ()
 
void SetDirtyFlag (DirtyFlag eDirtyFlag)
 
DirtyFlag GetDirtyFlag () const
 
DirtyFlag GetPreviousDirtyFlag () const
 
const CYIStringGetName () const
 
CYIString GetUniqueName () const
 
void SetSceneManager (CYISceneManager *pSceneManager)
 
void SetName (const CYIString &name)
 
int32_t GetID () const
 
void SetID (int32_t nID)
 
uint64_t GetUniqueID () const
 
bool AddChild (std::unique_ptr< CYISceneNode > pSceneNode)
 
bool AddChild (std::unique_ptr< CYISceneNode >, int32_t nIndex)
 
bool InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
 
std::unique_ptr< CYISceneNodeRemoveChild (CYISceneNode *pSceneNode)
 
bool ReorderChild (uint32_t uFromIndex, uint32_t uToIndex)
 
CYISceneNodeGetParent () const
 
bool ChangeParent (CYISceneNode *pParent)
 
CYISceneNodeGetDrawParent () const
 
bool IsAncestorOf (const CYISceneNode *pNode) const
 
CYISceneManagerGetSceneManager () const
 
uint32_t GetChildCount () const
 
uint32_t GetChildCountRecursive () const
 
CYISceneNodeGetChild (uint32_t nIndex) const
 
Iterator begin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
Iterator end (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
ReverseIterator rbegin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
ReverseIterator rend (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
CYISceneNodeGetChild (const CYIString &sName) const
 
uint32_t GetDrawChildCount () const
 
CYISceneNodeGetDrawChild (uint32_t uIndex) const
 
CYISceneNodeGetDrawChildByID (int32_t nID) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetChild (uint32_t uTargetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren () const
 
int32_t GetIndexOfChild (const CYISceneNode *pSceneNode) const
 
void Show ()
 
void Hide ()
 
void SetVisibility (bool bVisible)
 
void SetOpacity (float fOpacity)
 
float GetCompositeOpacity () const
 
float GetLocalOpacity () const
 
bool IsVisible () const
 
bool IsTrulyVisible () const
 
CYISceneNodeGetNode (const CYIString &name)
 
CYISceneNodeGetNode (const CYIString &name, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNode (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget)
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (const CYIString &name)
 
CYISceneNodeGetNode (const int32_t nID)
 
CYISceneNodeGetNode (const int32_t nID, const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
bool FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, const CYIString &nodeName, FETCH_TYPE eType, const CYIString &tag)
 
std::list< CYISceneNode * > GetNodes (const CYIString &name)
 
std::list< CYISceneNode * > GetNodes (int32_t nID)
 
std::list< CYISceneNode * > GetNodes (const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
const YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t uTargetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t uTargetMatchedNodeCount=1)
 
void SetMesh (const std::shared_ptr< CYIMesh > &pMesh)
 
void SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, uint32_t nIndex=0)
 
void AddEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
void RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
uint32_t GetEffectCount () const
 
std::shared_ptr< CYIEffectGetEffect (uint32_t uIndex) const
 
void ConnectEffectsToTimelines (const CYITimelineTrack *pTrack)
 
void AddMask (std::unique_ptr< CYIMask > pMask)
 
std::unique_ptr< CYIMaskRemoveMask (const CYIMask *pMask)
 
uint32_t GetMaskCount () const
 
const CYIMaskGetMask (uint32_t uIndex) const
 
CYIMaskGetMask (uint32_t uIndex)
 
const std::shared_ptr< CYIMesh > & GetMesh () const
 
uint32_t GetMaterialCount () const
 
const std::shared_ptr< CYIMaterialGetMaterial (uint32_t nIndex=0) const
 
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms () const
 
void SetMeshTransform (const glm::mat4 &rTransform)
 
void DestroyChildren ()
 
const glm::mat4 & GetLocalTransform () const
 
const glm::mat4 & GetEffectTransform () const
 
const glm::mat4 & GetWorldTransform () const
 
bool Intersects (const CYISceneNode *pNode) const
 
void SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget)
 
const std::shared_ptr< CYIRenderTargetGetRenderTarget () const
 
virtual void BuildDrawList (std::vector< IYIRenderer::Command > &drawList, CYIAbstractCameraSceneNode *pCameraToDrawWith=nullptr)
 
const CYIAABBGetWorldAABB () const
 
const CYIAABBGetLocalAABB () const
 
void SetAnchorPoint (const glm::vec3 &ref)
 
void SetAnchorPoint (float fX, float fY, float fZ)
 
void SetAnchorPointX (float fX)
 
void SetAnchorPointY (float fY)
 
void SetAnchorPointZ (float fZ)
 
void SetPosition (const glm::vec3 &ref)
 
void SetPosition (float fX, float fY, float fZ)
 
void SetPositionX (float fX)
 
void SetPositionY (float fY)
 
void SetPositionZ (float fZ)
 
void SetRotation (const glm::vec3 &fEulerDegrees)
 
void SetRotation (float fPitchDegrees, float fYawDegrees, float fRollDegrees)
 
void SetRotationX (float fPitchDegrees)
 
void SetRotationY (float fYawDegrees)
 
void SetRotationZ (float fRollDegrees)
 
void SetOrientation (float fPitchDegrees, float fYawDegrees, float fRollDegrees)
 
void SetOrientation (const glm::quat &orient)
 
void SetScale (const glm::vec3 &fScaleFactors)
 
void SetScale (float fFactorX, float fFactorY, float fFactorZ)
 
void SetScaleX (float fFactor)
 
void SetScaleY (float fFactor)
 
void SetScaleZ (float fFactor)
 
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 &vSize, bool bDirtyLayout=true)
 
const glm::vec3 & GetSize () const
 
const glm::vec3 & GetInitialSize () const
 
void SetMeasuredSize (const glm::vec3 &vMeasuredSize)
 
const glm::vec3 & GetMeasuredSize () const
 
void SetInternalCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value)
 
virtual void SetCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value)
 
void SetClippingOn ()
 
void SetClippingOff ()
 
bool GetClipping () const
 
void SetClippingBox (const CYIAABB &rWorldBox)
 
const CYIAABBGetClippingBox () const
 
void StartPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType, float fFrom, float fTo, uint32_t nDurMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool bDirtyLayout=true)
 
void StopPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType)
 
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 &rWorldSpaceRay) const
 
bool IsMeshHit (const CYIRay &rWorldSpaceRay) const
 
void DumpTree () const
 
void StartCaptureKeyboardEvents ()
 
void StopCaptureKeyboardEvents ()
 
void StartCaptureTrackpadEvents ()
 
void StopCaptureTrackpadEvents ()
 
void StartCapturePointerEvents (uint8_t uPointerID)
 
void StopCapturePointerEvents (uint8_t uPointerID)
 
bool DrawBehindChildren (CYISceneNode *pSceneNode)
 
bool DrawInFrontOfChildren (CYISceneNode *pSceneNode)
 
bool DrawBehind (CYISceneNode *pSceneNode)
 
bool DrawInFront (CYISceneNode *pSceneNode)
 
bool IsFocusRoot () const
 
void SetIsFocusRoot (bool bIsFocusRoot)
 
virtual void OnFocusGainedInDescendants ()
 
virtual void FocusGainedInDescendants ()
 
virtual void OnFocusLostInDescendants ()
 
virtual void FocusLostInDescendants ()
 
virtual void OnFocusChangedInDescendants ()
 
virtual void FocusChangedInDescendants ()
 
virtual bool ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
void ShowPointerDebugNode (CYIActionEvent *pActionEvent)
 
void SetUseLocalTransformAndAlpha (bool bUse)
 
virtual bool GetProperty (const CYIString &rPropertyName, CYIString *pValue) const override
 
virtual const std::map< CYIString, CYIString > & GetProperties () const override
 
void SetProperty (const CYIString &rPropertyName, const CYIString &rPropertyValue)
 
const std::shared_ptr< CYISceneNodeProxy > & GetSceneNodeProxy () const
 
void SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig)
 
const CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE) const
 
CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE)
 
void SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState)
 
const CYILayoutStateGetLayoutState () const
 
CYILayoutStateGetLayoutState ()
 
void RequestLayout ()
 
LayoutDirtyFlag GetLayoutDirtyFlag () const
 
virtual void SetLayoutDirtyFlag (LayoutDirtyFlag eFlag)
 
virtual void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec)
 
virtual void ApplyMeasurements ()
 
CYIAbstractCameraSceneNodeFindActiveCamera () const
 
template<typename T >
bool CanCastTo () const
 
- Public Member Functions inherited from CYIEventTarget
 CYIEventTarget ()
 
virtual ~CYIEventTarget ()
 
bool AddEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE)
 
bool RemoveEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE)
 
void SetSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType)
 
void ClearSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType)
 
YI_SPECIAL_EVENT_TARGET_TYPE GetSpecialTypes () const
 
- Public Member Functions inherited from CYIScriptableRTTIObject
 CYIScriptableRTTIObject ()
 
virtual ~CYIScriptableRTTIObject ()
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const override
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
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 &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()
 

Protected Member Functions

 CYIAbstractCameraSceneNode ()
 
void DirtyProjectionMatrix ()
 
virtual glm::mat4 CalculateProjectionMatrix () const =0
 
glm::mat4 CalculateViewMatrix () const
 
glm::mat4 CalculateViewportMatrix () const
 
const glm::mat4 & GetViewportWorldMatrix () const
 
virtual void UpdateEnd () override
 
virtual CYIString GetDumpTreeString () const override
 
- Protected Member Functions inherited from CYISceneNode
void Update (bool bForceDirty=false)
 
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 CalculateLocalTransform (glm::mat4 *pTransform) const
 
virtual void ChildNeedsLayout ()
 
virtual void LayoutDirtied ()
 
virtual void OnChildVisibilityChanged (CYISceneNode *pChild)
 
virtual void ChildVisibilityChanged (CYISceneNode *pChild)
 
virtual bool ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
LayoutDirtyFlag GetCurrentLayoutDirtyFlag () const
 
void DumpTree (int32_t nIndentLevel) const
 
void SetShaderUniforms ()
 
virtual void SetCustomUniforms ()
 
template<class T >
void SetNodeType ()
 
virtual CYISceneNodeGetNodeFromChildren (const CYIString &name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t nID)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pbTargetReached, CYISceneNode *pStartAfterTarget)
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Additional Inherited Members

- Public Types inherited from CYISceneNode
enum  DirtyFlag {
  DirtyClean = 0x0000,
  DirtySceneGraph = 0x0001,
  DirtyVisibility = 0x0002,
  DirtyOpacity = 0x0004,
  DirtyLocalTransform = 0x0008,
  DirtyWorldTransform = 0x0010,
  DirtyUniform = 0x0020,
  DirtyWorldBoundingBox = 0x0040,
  DirtyMesh = 0x0080,
  DirtyWorldSurfaceScale = 0x0100,
  DirtyWorldScale = 0x0200,
  DirtyLocalBoundingBox = 0x0400,
  DirtyEverything = (DirtySceneGraph | DirtyVisibility | DirtyOpacity | DirtyLocalTransform | DirtyWorldTransform | DirtyUniform | DirtyWorldBoundingBox | DirtyWorldSurfaceScale | DirtyWorldScale | DirtyLocalBoundingBox)
}
 
enum  LayoutDirtyFlag {
  LayoutClean,
  LayoutChildDirty,
  LayoutDirty
}
 
enum  LayoutConfigFetchMode {
  LAYOUT_CONFIG_DO_NOT_LAZY_INSTANTIATE = 0,
  LAYOUT_CONFIG_LAZY_INSTANTIATE
}
 
enum  MeasureMode {
  MEASURE_UNSPECIFIED,
  MEASURE_UP_TO,
  MEASURE_EXACTLY
}
 
enum  FETCH_TYPE {
  FETCH_OPTIONAL = 0,
  FETCH_MANDATORY
}
 
typedef std::reverse_iterator< IteratorReverseIterator
 
- Public Types inherited from CYIEventTarget
enum  EVENT_PHASE {
  BUBBLE,
  CAPTURE
}
 
- Static Public Member Functions inherited from CYISceneNode
static void RegisterAllSceneNodes ()
 
- Public Attributes inherited from CYISceneNode
CYISignal< CYISceneNode *, YI_NODE_PROPERTY_TYPEPropertyAnimationComplete
 
CYISignal DescendantGainedFocus
 Emitted when focus has entered this tree. More...
 
CYISignal DescendantLostFocus
 Emitted when focus has left this tree. More...
 
CYISignal DescendantsChangedFocus
 Emitted when focus has changed within this tree. More...
 
- Static Public Attributes inherited from CYISceneNode
static const float OPACITY_NOT_VISIBLE_EPSILON
 
- Protected Attributes inherited from CYISceneNode
CYIString m_name
 
CYISceneNodem_pParent
 
CYISceneNodem_pDrawParent
 
CYISceneManagerm_pSceneManager
 
std::vector< std::unique_ptr< CYISceneNode > > m_children
 
std::vector< CYISceneNode * > m_drawChildren
 
std::map< CYIString, CYIStringm_Properties
 
std::vector< std::shared_ptr< CYIMaterial > > m_pMaterials
 
std::vector< std::unique_ptr< CYIMask > > m_Masks
 
std::vector< std::shared_ptr< CYIEffect > > m_Effects
 
std::vector< PropertyAnimation * > m_propertyAnimations
 
float m_fLocalOpacity
 
CYIAABB m_WSClipBox
 
glm::mat4 m_EffectTransform
 
glm::quat m_Orientation
 
glm::vec3 m_Rotate
 
glm::vec3 m_AnchorPoint
 
glm::vec3 m_Position
 
glm::vec3 m_Scale
 
glm::vec3 m_vSize
 
glm::vec3 m_vInitialSize
 
glm::vec3 m_vMeasuredSize
 
glm::vec3 m_vlsLastCollision
 
bool m_bClip
 
bool m_bIsRotated
 
bool m_bIsOriented
 
bool m_bLocalVisibility
 
int32_t m_nID
 
uint64_t m_uGUID
 
std::shared_ptr< CYIRenderTargetm_pRenderTarget
 
std::shared_ptr< CYIMeshm_pMesh
 
std::shared_ptr< IYIUniformBufferObjectm_pShaderUniforms
 
- Protected Attributes inherited from CYIEventTarget
YI_SPECIAL_EVENT_TARGET_TYPE m_eSpecialTypes
 
std::vector< EventListenerEntry > m_listeners
 

Constructor & Destructor Documentation

CYIAbstractCameraSceneNode::CYIAbstractCameraSceneNode ( )
protected

Member Function Documentation

virtual glm::mat4 CYIAbstractCameraSceneNode::CalculateProjectionMatrix ( ) const
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.

glm::mat4 CYIAbstractCameraSceneNode::CalculateViewMatrix ( ) const
protected

The view matrix represents the transformation required to center the world coordinate system on the position and orientation of the camera.

glm::mat4 CYIAbstractCameraSceneNode::CalculateViewportMatrix ( ) const
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.

void CYIAbstractCameraSceneNode::DirtyProjectionMatrix ( )
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.

virtual CYIString CYIAbstractCameraSceneNode::GetDumpTreeString ( ) const
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.

See also
DumpTree()

Reimplemented from CYISceneNode.

Reimplemented in CYIPerspectiveCameraSceneNode, and CYIOrthographicCameraSceneNode.

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 CYIViewport& CYIAbstractCameraSceneNode::GetViewport ( ) const
const glm::mat4& CYIAbstractCameraSceneNode::GetViewportWorldMatrix ( ) const
protected

This function is called during camera matrix calculation to place the generated viewport in the right world-space coordinates Will return the camera's parent's world transformation, or identity if the camera has no parent.

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::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.

Warning
The camera does not take ownership of this memory, clean-up is the responsibility of the target node's parent.
Be sure to remove the target by calling SetTarget(nullptr) or RemoveTarget() if the target node is going to be deleted.
void CYIAbstractCameraSceneNode::SetUpVector ( const glm::vec3 &  fCamUp)

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 CYIViewport 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.

See also
const glm::mat4 &GetCameraMatrix() const
virtual void CYIAbstractCameraSceneNode::UpdateEnd ( )
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.

Warning
The dirty flag will be cleared prior to calling this function to allow new dirty state to be recorded from this function. If querying information about the dirty state of the node, use GetPreviousDirtyFlag().
Overrides must call the base class implementation.
See also
Update()
OnUpdateEnd()

Reimplemented from CYISceneNode.


The documentation for this class was generated from the following file: