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 bLogErrors=true)
 
static glm::vec3 LocalToRelativeSpace (CYISceneNode *pLocalNode, CYISceneNode *pRelativeNode, const glm::vec3 &localSpaceCoordinate)
 
static glm::vec3 LocalZeroToRelativeSpace (CYISceneNode *pLocalNode, 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 fWidth, float fHeight)
 
static glm::vec3 LocalToScreenSpace (const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate, std::shared_ptr< CYIRenderTarget > pRenderTarget, const glm::mat4 &cameraMatrix, bool bLogErrors=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)
 
static std::shared_ptr< CYIRenderTargetGetRenderTarget (const CYISceneNode *pNode)
 

Member Function Documentation

static std::unique_ptr<CYISceneNode> CYISceneNodeUtility::CreateSolid ( CYISceneManager pSceneManager,
const CYIColor color,
float  fWidth,
float  fHeight 
)
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.
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.

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

Locates and returns the render target in effect for pNode.

See also
GetRenderTargetInfo
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*)
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 *pNode, const glm::vec3 &localSpaceCoordinate)
static RenderTargetInfo CYISceneNodeUtility::GetRenderTargetInfoForChildrenOf ( const CYISceneNode pParent)
static

This helper function is used to cache the work of finding a node's RenderTarget and Camera, given the node's parent.

See also
LocalToScreenSpace(const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate)
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.

static glm::vec3 CYISceneNodeUtility::LocalToRelativeSpace ( CYISceneNode pLocalNode,
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

static glm::vec3 CYISceneNodeUtility::LocalToScreenSpace ( const CYISceneNode pNode,
const glm::vec3 &  localSpaceCoordinate,
bool  bLogErrors = 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 bLogErrors 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
static glm::vec3 CYISceneNodeUtility::LocalToScreenSpace ( const CYISceneNode pNode,
const glm::vec3 &  localSpaceCoordinate,
std::shared_ptr< CYIRenderTarget pRenderTarget,
const glm::mat4 &  cameraMatrix,
bool  bLogErrors = true 
)
static
See also
LocalToScreenSpace(const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate)
static glm::vec3 CYISceneNodeUtility::LocalZeroToRelativeSpace ( CYISceneNode pLocalNode,
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
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
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.

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: