diff --git a/LEGO1/lego/legoomni/include/legoentity.h b/LEGO1/lego/legoomni/include/legoentity.h index 4580405c..5db4180e 100644 --- a/LEGO1/lego/legoomni/include/legoentity.h +++ b/LEGO1/lego/legoomni/include/legoentity.h @@ -66,9 +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(); + Mx3DPointFloat GetWorldDirection(); + Mx3DPointFloat GetWorldUp(); + Mx3DPointFloat GetWorldPosition(); inline LegoROI* GetROI() { return m_roi; } inline MxU8 GetFlags() { return m_flags; } diff --git a/LEGO1/lego/legoomni/src/entity/legoentity.cpp b/LEGO1/lego/legoomni/src/entity/legoentity.cpp index 4bc066ee..ffda6f6c 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentity.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentity.cpp @@ -184,22 +184,36 @@ void LegoEntity::FUN_10010c30() } } -// STUB: LEGO1 0x10010c60 -Mx3DPointFloat LegoEntity::GetEntitydDirection() +// FUNCTION: LEGO1 0x10010c60 +Mx3DPointFloat LegoEntity::GetWorldDirection() { - return Mx3DPointFloat(0, 0, 0); + if (m_roi != NULL) { + m_worldDirection = + Mx3DPointFloat(m_roi->GetWorldDirection()[0], m_roi->GetWorldDirection()[1], m_roi->GetWorldDirection()[2]); + } + + return m_worldDirection; } -// STUB: LEGO1 0x10010cf0 -Mx3DPointFloat LegoEntity::GetEntityUp() +// FUNCTION: LEGO1 0x10010cf0 +Mx3DPointFloat LegoEntity::GetWorldUp() { - return Mx3DPointFloat(0, 0, 0); + if (m_roi != NULL) { + m_worldUp = Mx3DPointFloat(m_roi->GetWorldUp()[0], m_roi->GetWorldUp()[1], m_roi->GetWorldUp()[2]); + } + + return m_worldUp; } -// STUB: LEGO1 0x10010d80 -Mx3DPointFloat LegoEntity::GetEntityLocation() +// FUNCTION: LEGO1 0x10010d80 +Mx3DPointFloat LegoEntity::GetWorldPosition() { - return Mx3DPointFloat(0, 0, 0); + if (m_roi != NULL) { + m_worldLocation = + Mx3DPointFloat(m_roi->GetWorldPosition()[0], m_roi->GetWorldPosition()[1], m_roi->GetWorldPosition()[2]); + } + + return m_worldLocation; } // FUNCTION: LEGO1 0x10010e10 diff --git a/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp index ea13fe00..873b3ac4 100644 --- a/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp @@ -199,12 +199,12 @@ void LegoPointOfViewController::SetEntity(LegoEntity* p_entity) CalcLocalTransform( Mx3DPointFloat( - m_entity->GetEntityLocation()[0], - m_entity->GetEntityLocation()[1] + m_entityOffsetUp, - m_entity->GetEntityLocation()[2] + m_entity->GetWorldPosition()[0], + m_entity->GetWorldPosition()[1] + m_entityOffsetUp, + m_entity->GetWorldPosition()[2] ), - m_entity->GetEntitydDirection(), - m_entity->GetEntityUp(), + m_entity->GetWorldDirection(), + m_entity->GetWorldUp(), mat );