Implement/match LegoPointOfViewController::SetEntity (#668)

* Implement/match LegoPointOfViewController::SetEntity

* Fix order
This commit is contained in:
Christian Semmler 2024-03-13 14:03:30 -04:00 committed by GitHub
parent 0623e6a766
commit 0f2aee1849
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 2 deletions

View file

@ -66,6 +66,9 @@ public:
void FUN_10010c30();
void FUN_100114e0(MxU8 p_unk0x59);
void SetLocation(const Vector3& p_location, const Vector3& p_direction, const Vector3& p_up, MxBool p_und);
Mx3DPointFloat GetEntitydDirection();
Mx3DPointFloat GetEntityUp();
Mx3DPointFloat GetEntityLocation();
inline LegoROI* GetROI() { return m_roi; }
inline MxU8 GetFlags() { return m_flags; }

View file

@ -184,6 +184,24 @@ void LegoEntity::FUN_10010c30()
}
}
// STUB: LEGO1 0x10010c60
Mx3DPointFloat LegoEntity::GetEntitydDirection()
{
return Mx3DPointFloat(0, 0, 0);
}
// STUB: LEGO1 0x10010cf0
Mx3DPointFloat LegoEntity::GetEntityUp()
{
return Mx3DPointFloat(0, 0, 0);
}
// STUB: LEGO1 0x10010d80
Mx3DPointFloat LegoEntity::GetEntityLocation()
{
return Mx3DPointFloat(0, 0, 0);
}
// FUNCTION: LEGO1 0x10010e10
void LegoEntity::ParseAction(char* p_extra)
{

View file

@ -1,4 +1,5 @@
#include "3dmanager/lego3dview.h"
#include "legoentity.h"
#include "legonavcontroller.h"
#include "legoomni.h"
#include "legopointofviewcontroller.h"
@ -185,8 +186,31 @@ MxResult LegoPointOfViewController::Tickle()
return SUCCESS;
}
// STUB: LEGO1 0x10065ae0
// FUNCTION: LEGO1 0x10065ae0
void LegoPointOfViewController::SetEntity(LegoEntity* p_entity)
{
// TODO
TickleManager()->UnregisterClient(this);
m_entity = p_entity;
ViewROI* pov = m_lego3DView->GetPointOfView();
if (m_entity != NULL && pov != NULL) {
MxMatrix mat;
CalcLocalTransform(
Mx3DPointFloat(
m_entity->GetEntityLocation()[0],
m_entity->GetEntityLocation()[1] + m_entityOffsetUp,
m_entity->GetEntityLocation()[2]
),
m_entity->GetEntitydDirection(),
m_entity->GetEntityUp(),
mat
);
pov->WrappedSetLocalTransform(mat);
}
else {
TickleManager()->RegisterClient(this, 10);
}
}