2016-03-10 03:47:37 +00:00
|
|
|
#ifndef __URDE_CGUIOBJECT_HPP__
|
|
|
|
#define __URDE_CGUIOBJECT_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "zeus/CVector3f.hpp"
|
2016-09-14 05:45:46 +00:00
|
|
|
#include "zeus/CQuaternion.hpp"
|
2016-03-10 03:47:37 +00:00
|
|
|
#include "zeus/CTransform.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
2016-03-17 02:18:01 +00:00
|
|
|
struct CGuiWidgetDrawParms;
|
2016-03-10 03:47:37 +00:00
|
|
|
|
|
|
|
class CGuiObject
|
|
|
|
{
|
2016-03-16 03:37:51 +00:00
|
|
|
protected:
|
2016-03-10 03:47:37 +00:00
|
|
|
zeus::CTransform x4_localXF;
|
|
|
|
zeus::CTransform x34_worldXF;
|
|
|
|
zeus::CVector3f x64_rotationCenter;
|
|
|
|
CGuiObject* x70_parent = nullptr;
|
|
|
|
CGuiObject* x74_child = nullptr;
|
|
|
|
CGuiObject* x78_nextSibling = nullptr;
|
|
|
|
public:
|
2016-03-11 00:23:16 +00:00
|
|
|
virtual ~CGuiObject();
|
2016-03-10 03:47:37 +00:00
|
|
|
virtual void Update(float dt);
|
|
|
|
virtual void Draw(const CGuiWidgetDrawParms& parms) const;
|
2016-12-16 04:35:49 +00:00
|
|
|
virtual void Initialize()=0;
|
2016-03-10 03:47:37 +00:00
|
|
|
|
|
|
|
void MoveInWorld(const zeus::CVector3f& vec);
|
2016-04-29 10:08:46 +00:00
|
|
|
const zeus::CVector3f& GetLocalPosition() const {return x4_localXF.origin;}
|
2016-03-14 00:58:19 +00:00
|
|
|
void SetLocalPosition(const zeus::CVector3f& pos);
|
2016-04-29 10:08:46 +00:00
|
|
|
const zeus::CVector3f& GetWorldPosition() const {return x34_worldXF.origin;}
|
2016-03-10 03:47:37 +00:00
|
|
|
void SetRotationCenter(const zeus::CVector3f& center) {x64_rotationCenter = center;}
|
|
|
|
void RotateReset();
|
|
|
|
zeus::CVector3f RotateW2O(const zeus::CVector3f& vec) const;
|
|
|
|
zeus::CVector3f RotateO2P(const zeus::CVector3f& vec) const;
|
|
|
|
zeus::CVector3f RotateTranslateW2O(const zeus::CVector3f& vec) const;
|
|
|
|
void MultiplyO2P(const zeus::CTransform& xf);
|
2016-03-11 00:23:16 +00:00
|
|
|
void AddChildObject(CGuiObject* obj, bool makeWorldLocal, bool atEnd);
|
2016-03-10 03:47:37 +00:00
|
|
|
CGuiObject* RemoveChildObject(CGuiObject* obj, bool makeWorldLocal);
|
|
|
|
CGuiObject* GetParent() {return x70_parent;}
|
|
|
|
CGuiObject* GetChildObject() {return x74_child;}
|
|
|
|
CGuiObject* GetNextSibling() {return x78_nextSibling;}
|
|
|
|
void RecalculateTransforms();
|
|
|
|
void Reorthogonalize();
|
|
|
|
void SetO2WTransform(const zeus::CTransform& xf);
|
2016-12-16 04:35:49 +00:00
|
|
|
void SetLocalTransform(const zeus::CTransform& xf);
|
2016-03-10 03:47:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CGUIOBJECT_HPP__
|