2022-11-07 17:06:11 +00:00
|
|
|
#ifndef _CGUIOBJECT
|
|
|
|
#define _CGUIOBJECT
|
|
|
|
|
|
|
|
#include "Kyoto/Math/CTransform4f.hpp"
|
|
|
|
|
|
|
|
class CGuiWidgetDrawParms;
|
|
|
|
class CMatrix4f;
|
|
|
|
class CVector2f;
|
|
|
|
|
|
|
|
class CGuiObject {
|
|
|
|
public:
|
2022-12-29 03:32:27 +00:00
|
|
|
CGuiObject();
|
2022-11-07 17:06:11 +00:00
|
|
|
virtual ~CGuiObject();
|
|
|
|
virtual void Update(float dt);
|
2022-12-29 03:32:27 +00:00
|
|
|
virtual void Draw(const CGuiWidgetDrawParms& parms) const;
|
2022-11-07 17:06:11 +00:00
|
|
|
virtual void Initialize() = 0;
|
2022-12-29 03:32:27 +00:00
|
|
|
void MoveInWorld(const CVector3f& offset);
|
|
|
|
CVector3f GetWorldPosition() const;
|
|
|
|
CVector3f GetLocalPosition() const;
|
2023-01-14 00:53:27 +00:00
|
|
|
const CTransform4f& GetWorldTransform() const { return x34_worldXF; }
|
2022-12-29 03:32:27 +00:00
|
|
|
void SetLocalPosition(const CVector3f& pos);
|
|
|
|
void SetLocalTransform(const CTransform4f& xf);
|
2023-01-14 00:53:27 +00:00
|
|
|
void SetO2WTransform(const CTransform4f& xf);
|
2022-11-07 17:06:11 +00:00
|
|
|
|
2022-12-29 03:32:27 +00:00
|
|
|
void RotateReset();
|
2022-11-07 17:06:11 +00:00
|
|
|
|
2022-12-29 03:32:27 +00:00
|
|
|
CVector3f RotateO2P(const CVector3f& vec) const;
|
|
|
|
CVector3f RotateW2O(const CVector3f& offset) const {
|
2023-01-14 00:53:27 +00:00
|
|
|
return x34_worldXF.TransposeRotate(offset);
|
2022-11-07 17:06:11 +00:00
|
|
|
}
|
2022-12-29 03:32:27 +00:00
|
|
|
CVector3f RotateTranslateW2O(const CVector3f& vec) const;
|
|
|
|
void MultiplyO2P(const CTransform4f& xf);
|
|
|
|
void RecalculateTransforms();
|
2022-11-07 17:06:11 +00:00
|
|
|
|
2022-12-29 03:32:27 +00:00
|
|
|
void AddChildObject(CGuiObject* child, bool a, bool b);
|
|
|
|
|
|
|
|
void SetParent(CGuiObject* obj) {
|
|
|
|
x64_parent = obj;
|
|
|
|
}
|
|
|
|
|
2023-01-14 00:53:27 +00:00
|
|
|
CGuiObject* Parent();
|
|
|
|
const CGuiObject* GetChildObject() const;
|
|
|
|
CGuiObject* ChildObject();
|
|
|
|
const CGuiObject* GetNextSibling() const;
|
|
|
|
CGuiObject* NextSibling();
|
2022-11-07 17:06:11 +00:00
|
|
|
private:
|
|
|
|
CTransform4f x4_localXF;
|
|
|
|
CTransform4f x34_worldXF;
|
|
|
|
CGuiObject* x64_parent;
|
|
|
|
CGuiObject* x68_child;
|
|
|
|
CGuiObject* x6c_nextSibling;
|
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CGuiObject, 0x70)
|
|
|
|
|
|
|
|
#endif // _CGUIOBJECT
|