You.i Engine
YiTransform.h
Go to the documentation of this file.
1 #ifndef _YI_TRANSFORM_H_
2 #define _YI_TRANSFORM_H_
3 
4 #include "framework/YiPredef.h"
6 
7 #include <glm/glm.hpp>
8 #include <glm/gtc/quaternion.hpp>
9 
20 {
21 public:
22  CYITransform();
23  CYITransform(CYITransformSystem *pTransformSystem, CYIComponentPoolUID transformID);
24 
25  bool IsValid() const;
26 
32 
37 
42 
48  bool SetParent(const CYITransform *pTransform);
49 
55  bool GetParent(CYITransform &parent) const;
56 
61  bool SetPosition(glm::vec3 position);
62 
67  bool SetRotation(glm::vec3 eulerAngles);
68 
73  bool SetScale(glm::vec3 scale);
74 
79  bool SetAnchorPoint(glm::vec3 anchorPoint);
80 
85  bool SetOrientation(glm::quat orientation);
86 
87  const glm::vec3 &GetPosition() const;
88  const glm::vec3 &GetRotation() const;
89  const glm::vec3 &GetScale() const;
90  const glm::vec3 &GetAnchorPoint() const;
91  const glm::quat &GetOrientation() const;
92 
98  const glm::mat4x4 &GetLocalMatrix() const;
99 
106  const glm::mat4x4 &GetWorldMatrix() const;
107 
112 
118 
119 private:
120  mutable CYITransformSystem *m_pTransformSystem;
121  CYIComponentPoolUID m_transformID;
122 };
123 
126 #include "scenetree/YiTransform.inl"
127 
128 #endif // _YI_TRANSFORM_H_
bool SetParent(const CYITransform *pTransform)
bool SetOrientation(glm::quat orientation)
bool IsValid() const
const glm::vec3 & GetScale() const
CYITransformComponent * GetTransformComponent()
bool SetScale(glm::vec3 scale)
const glm::vec3 & GetRotation() const
const glm::vec3 & GetPosition() const
CYIComponentPoolUID GetTransformID() const
The transform system maintains a component pool of CYITransformComponent data.
Definition: YiTransformSystem.h:21
An identifier for an element in a CYIComponentPool object.
Definition: YiComponentPoolUID.h:17
Provides transformation APIs.
Definition: YiTransform.h:19
A minimal transform component.
Definition: YiTransformComponent.h:18
const glm::mat4x4 & GetLocalMatrix() const
const glm::mat4x4 & GetWorldMatrix() const
bool SetPosition(glm::vec3 position)
void RemoveFromTransformSystem()
CYITransformSystem * GetTransformSystem()
const glm::quat & GetOrientation() const
bool SetAnchorPoint(glm::vec3 anchorPoint)
void RemoveDescendantsFromTransformSystem()
bool SetRotation(glm::vec3 eulerAngles)
const glm::vec3 & GetAnchorPoint() const
bool GetParent(CYITransform &parent) const