You.i Engine
YiSceneNodeUtility.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_SCENE_NODE_UTILITY_H_
3 #define _YI_SCENE_NODE_UTILITY_H_
4 
6 
7 #include <glm/fwd.hpp>
8 
9 class CYIColor;
10 
17 
19 {
20 public:
30  {
32  pParent(nullptr)
33  {
34  }
35 
36  std::shared_ptr<CYIRenderTarget> pRenderTarget;
37  glm::mat4 cameraMatrix;
39  };
40 
44  static std::list<std::shared_ptr<CYISceneNodeProxy>> GetProxyList(const std::list<CYISceneNode *> &sceneNodeList);
45 
55  static glm::vec3 LocalToScreenSpace(const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate, bool bLogErrors = true);
56 
62  static glm::vec3 LocalToRelativeSpace(CYISceneNode *pLocalNode, CYISceneNode *pRelativeNode, const glm::vec3 &localSpaceCoordinate);
63 
71  static glm::vec3 LocalZeroToRelativeSpace(CYISceneNode *pLocalNode, CYISceneNode *pRelativeNode);
72 
78  static CYIAABB LocalSizeToRelativeSpace(const CYISceneNode *pLocalNode, const CYISceneNode *pRelativeNode);
79 
87  static glm::vec3 ScreenToLocalSpace(const CYISceneNode *pNode, const glm::vec2 &screenSpaceCoordinate);
88 
96  static std::unique_ptr<CYISceneNode> CreateSolid(CYISceneManager *pSceneManager, const CYIColor &color, float fWidth, float fHeight);
97 
101  static glm::vec3 LocalToScreenSpace(const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate, std::shared_ptr<CYIRenderTarget> pRenderTarget, const glm::mat4 &cameraMatrix, bool bLogErrors = true);
102 
108  static CYIAABB WorldToScreenSpace(const CYISceneNode *pNode, const RenderTargetInfo *pRenderTargetInfo = nullptr);
109 
116  static CYIAABB WorldToScreenSpace(const CYISceneNode *pNode, const CYIAABB &worldSpaceBox, const RenderTargetInfo *pRenderTargetInfo = nullptr);
117 
122  static std::pair<std::shared_ptr<CYIRenderTarget>, glm::mat4> GetRenderTargetAndCameraMatrix(const CYISceneNode *pNode);
123 
130 
137 
143  static std::shared_ptr<CYIRenderTarget> GetRenderTarget(const CYISceneNode *pNode);
144 
145 private:
147 };
148 
151 #endif // _YI_SCENE_NODE_UTILITY_H_
static glm::vec3 LocalZeroToRelativeSpace(CYISceneNode *pLocalNode, CYISceneNode *pRelativeNode)
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:73
static glm::vec3 LocalToScreenSpace(const CYISceneNode *pNode, const glm::vec3 &localSpaceCoordinate, bool bLogErrors=true)
static std::pair< std::shared_ptr< CYIRenderTarget >, glm::mat4 > GetRenderTargetAndCameraMatrix(const CYISceneNode *pNode)
static std::shared_ptr< CYIRenderTarget > GetRenderTarget(const CYISceneNode *pNode)
RenderTargetInfo()
Definition: YiSceneNodeUtility.h:31
Provides a base for the definition of camera objects.
Definition: YiAbstractCameraSceneNode.h:30
static std::list< std::shared_ptr< CYISceneNodeProxy > > GetProxyList(const std::list< CYISceneNode * > &sceneNodeList)
Definition: YiSceneNodeUtility.h:18
std::shared_ptr< CYIRenderTarget > pRenderTarget
Definition: YiSceneNodeUtility.h:36
glm::mat4 cameraMatrix
Definition: YiSceneNodeUtility.h:37
static glm::vec3 ScreenToLocalSpace(const CYISceneNode *pNode, const glm::vec2 &screenSpaceCoordinate)
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:114
static RenderTargetInfo GetRenderTargetInfo(const CYISceneNode *pNode)
static std::unique_ptr< CYISceneNode > CreateSolid(CYISceneManager *pSceneManager, const CYIColor &color, float fWidth, float fHeight)
static CYIAABB LocalSizeToRelativeSpace(const CYISceneNode *pLocalNode, const CYISceneNode *pRelativeNode)
const CYISceneNode * pParent
Definition: YiSceneNodeUtility.h:38
A container for a render targer&#39;s information. This struct contains the render target, the camera matrix, and the parent of the node for which this information was requested.
Definition: YiSceneNodeUtility.h:29
This class represents an Axis-Aligned Bounding Box.
Definition: YiAABB.h:24
static RenderTargetInfo GetRenderTargetInfoForChildrenOf(const CYISceneNode *pParent)
static glm::vec3 LocalToRelativeSpace(CYISceneNode *pLocalNode, CYISceneNode *pRelativeNode, const glm::vec3 &localSpaceCoordinate)
A class used to represent a color value.
Definition: YiColor.h:31
static CYIAABB WorldToScreenSpace(const CYISceneNode *pNode, const RenderTargetInfo *pRenderTargetInfo=nullptr)