metaforce/Runtime/GuiSys/CGuiObject.hpp

53 lines
1.8 KiB
C++
Raw Normal View History

2016-03-10 03:47:37 +00:00
#ifndef __URDE_CGUIOBJECT_HPP__
#define __URDE_CGUIOBJECT_HPP__
#include "RetroTypes.hpp"
#include "zeus/CVector3f.hpp"
#include "zeus/CTransform.hpp"
namespace urde
{
2016-03-17 02:18:01 +00:00
struct CGuiWidgetDrawParms;
2016-03-11 00:23:16 +00:00
class CGuiMessage;
class CGuiFunctionDef;
2016-03-15 23:23:45 +00:00
struct CGuiControllerInfo;
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-03-14 23:32:44 +00:00
virtual bool Message(const CGuiMessage& msg)=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);
};
}
#endif // __URDE_CGUIOBJECT_HPP__