You.i Engine
CYISceneNodeUtility Class Reference

#include <utility/YiSceneNodeUtility.h>

Classes

struct  RenderTargetInfo
 A container for a render targer's information. This struct contains the render target, the camera matrix, and the parent of the node for which this information was requested. More...
 

Static Public Member Functions

static std::list< std::shared_ptr< CYISceneNodeProxy > > GetProxyList (const std::list< CYISceneNode *> &sceneNodeList)
 
static glm::vec3 LocalToScreenSpace (const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate, bool logErrors=true)
 
static glm::vec3 LocalToRelativeSpace (const CYISceneNode *pLocalNode, const CYISceneNode *pRelativeNode, const glm::vec3 &localSpaceCoordinate)
 
static glm::vec3 LocalZeroToRelativeSpace (const CYISceneNode *pLocalNode, const CYISceneNode *pRelativeNode)
 
static CYIAABB LocalSizeToRelativeSpace (const CYISceneNode *pLocalNode, const CYISceneNode *pRelativeNode)
 
static glm::vec3 ScreenToLocalSpace (const CYISceneNode *pNode, const glm::vec2 &screenSpaceCoordinate)
 
static std::unique_ptr< CYISceneNodeCreateSolid (CYISceneManager *pSceneManager, const CYIColor &color, float width, float height)
 
static glm::vec3 LocalToScreenSpace (const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate, std::shared_ptr< CYIRenderTarget > pRenderTarget, const glm::mat4 &cameraMatrix, bool logErrors=true)
 
static CYIAABB WorldToScreenSpace (const CYISceneNode *pNode, const RenderTargetInfo *pRenderTargetInfo=nullptr)
 
static CYIAABB WorldToScreenSpace (const CYISceneNode *pNode, const CYIAABB &worldSpaceBox, const RenderTargetInfo *pRenderTargetInfo=nullptr)
 
static std::pair< std::shared_ptr< CYIRenderTarget >, glm::mat4 > GetRenderTargetAndCameraMatrix (const CYISceneNode *pNode)
 
static RenderTargetInfo GetRenderTargetInfo (const CYISceneNode *pNode)
 
static RenderTargetInfo GetRenderTargetInfoForChildrenOf (const CYISceneNode *pParent, const CYISceneNode *pTargetChild=nullptr)
 
static std::shared_ptr< CYIRenderTargetGetRenderTarget (const CYISceneNode *pNode)
 
static CYIString GetNodeHierarchyPath (const CYISceneNode *pSceneNode)
 

Member Function Documentation

◆ CreateSolid()

static std::unique_ptr<CYISceneNode> CYISceneNodeUtility::CreateSolid ( CYISceneManager pSceneManager,
const CYIColor color,
float  width,
float  height 
)
static

Creates a "solid" node given a color and a size.

An asset will be added to the asset manager named after the color (eg, #FF0000FF) if it doesn't already exist.

Note
The returned node is initialized by this function by calling CYISceneNode::Init.
Deprecated:
This function is deprecated and will be removed in a future release, please use CYISceneBuilder::CreateSolid instead.
See also
CYISceneBuilder::CreateSolid

◆ GetNodeHierarchyPath()

static CYIString CYISceneNodeUtility::GetNodeHierarchyPath ( const CYISceneNode pSceneNode)
static

Returns the path from the logical root to the SceneNode (eg. /Grandparent/Parent/pSceneNode).

If a node in the path is unnamed, "<unnamed>" will be used in its place.

◆ GetProxyList()

static std::list<std::shared_ptr<CYISceneNodeProxy> > CYISceneNodeUtility::GetProxyList ( const std::list< CYISceneNode *> &  sceneNodeList)
static

GetProxyList should be called when modification of the list returned by GetNodes is required. GetProxyList returns a list of SceneNodeProxy of each SceneNode.

◆ GetRenderTarget()

static std::shared_ptr<CYIRenderTarget> CYISceneNodeUtility::GetRenderTarget ( const CYISceneNode pNode)
static

Locates and returns the render target in effect for pNode.

See also
GetRenderTargetInfo

◆ GetRenderTargetAndCameraMatrix()

static std::pair<std::shared_ptr<CYIRenderTarget>, glm::mat4> CYISceneNodeUtility::GetRenderTargetAndCameraMatrix ( const CYISceneNode pNode)
static
Deprecated:
This function has been deprecated and may be removed in a future release. GetRenderTargetInfo(const CYISceneNode*) should be used instead.
See also
GetRenderTargetInfo(const CYISceneNode*)

◆ GetRenderTargetInfo()

static RenderTargetInfo CYISceneNodeUtility::GetRenderTargetInfo ( const CYISceneNode pNode)
static

This helper function is used to cache the work of finding the Node's RenderTarget and Camera

See also
LocalToScreenSpace(const CYISceneNode *, const glm::vec3 &, bool)

◆ GetRenderTargetInfoForChildrenOf()

static RenderTargetInfo CYISceneNodeUtility::GetRenderTargetInfoForChildrenOf ( const CYISceneNode pParent,
const CYISceneNode pTargetChild = nullptr 
)
static

This helper function is used to cache the work of finding a node's RenderTarget and Camera, given the node's parent. The optional parameter pTargetChild specifies the node to target in the case that the active camera is dependent on the node.

See also
LocalToScreenSpace(const CYISceneNode *, const glm::vec3 &, bool)

◆ LocalSizeToRelativeSpace()

static CYIAABB CYISceneNodeUtility::LocalSizeToRelativeSpace ( const CYISceneNode pLocalNode,
const CYISceneNode pRelativeNode 
)
static

Converts from the size of a node from its local space to the local space of another node.

In case of failure, a message will be logged a non-transformed AABB will be returned.

◆ LocalToRelativeSpace()

static glm::vec3 CYISceneNodeUtility::LocalToRelativeSpace ( const CYISceneNode pLocalNode,
const CYISceneNode pRelativeNode,
const glm::vec3 &  localSpaceCoordinate 
)
static

Convert from the local space of one node to the local space of another node

In case of failure a message will be logged and a default vec3 of (0,0,0) will be returned

◆ LocalToScreenSpace() [1/2]

static glm::vec3 CYISceneNodeUtility::LocalToScreenSpace ( const CYISceneNode pNode,
const glm::vec3 &  localSpaceCoordinate,
bool  logErrors = true 
)
static

Convert from the local space of a specific node to screen space. Screen space is defined by the render target to which the node will be drawn, if the node will be drawn into a framebuffer texture the coordinates returned will be in that texture's coordinate system.

In case of failure a message will be logged (unless logErrors is false ) and a default vec3 of (0,0,0) will be returned

Warning
this is an expensive function as it uses iteration, matrix math, and projection

◆ LocalToScreenSpace() [2/2]

static glm::vec3 CYISceneNodeUtility::LocalToScreenSpace ( const CYISceneNode pNode,
const glm::vec3 &  localSpaceCoordinate,
std::shared_ptr< CYIRenderTarget pRenderTarget,
const glm::mat4 &  cameraMatrix,
bool  logErrors = true 
)
static

◆ LocalZeroToRelativeSpace()

static glm::vec3 CYISceneNodeUtility::LocalZeroToRelativeSpace ( const CYISceneNode pLocalNode,
const CYISceneNode pRelativeNode 
)
static

Convert from the local space of one node to the local space of another node, assuming a local position of (0,0,0)

In case of failure a message will be logged and a default vec3 of (0,0,0) will be returned

See also
LocalToRelativeSpace

◆ ScreenToLocalSpace()

static glm::vec3 CYISceneNodeUtility::ScreenToLocalSpace ( const CYISceneNode pNode,
const glm::vec2 &  screenSpaceCoordinate 
)
static

Convert from a screen space coordinate to a coordinate in the local space of the node.

In case of failure a message will be logged and a default vec3 of (0,0,0) will be returned

Warning
this is an expensive function as it uses iteration, matrix math, and projection

◆ WorldToScreenSpace() [1/2]

static CYIAABB CYISceneNodeUtility::WorldToScreenSpace ( const CYISceneNode pNode,
const RenderTargetInfo pRenderTargetInfo = nullptr 
)
static

Convert from a world space bounding box to screen space, given pNode. This will use the WorldAABB of the given pNode.

A RenderTargetInfo object can optionally be passed to accelerate this function. The passed-in value should be the result of calling GetRenderTargetInfo on pNode, or the result of calling GetRenderTargetInfoForChildrenOf on the parent of pNode.

◆ WorldToScreenSpace() [2/2]

static CYIAABB CYISceneNodeUtility::WorldToScreenSpace ( const CYISceneNode pNode,
const CYIAABB worldSpaceBox,
const RenderTargetInfo pRenderTargetInfo = nullptr 
)
static

Convert from a world space bounding box to screen space, given pNode.

A RenderTargetInfo object can optionally be passed to accelerate this function. The passed-in value should be the result of calling GetRenderTargetInfo on pNode, or the result of calling GetRenderTargetInfoForChildrenOf on the parent of pNode.


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