mirror of https://github.com/AxioDL/metaforce.git
More door imps
This commit is contained in:
parent
884900b892
commit
43685b9119
|
@ -103,7 +103,7 @@ public:
|
||||||
void Render(EWhichModel, const zeus::CTransform& xf,
|
void Render(EWhichModel, const zeus::CTransform& xf,
|
||||||
const CActorLights* lights, const CModelFlags& drawFlags) const;
|
const CActorLights* lights, const CModelFlags& drawFlags) const;
|
||||||
|
|
||||||
std::unique_ptr<CAnimData>& AnimationData() { return xc_animData; }
|
CAnimData* AnimationData() { return xc_animData.get(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public:
|
||||||
virtual bool ValidAimTarget() { return true; }
|
virtual bool ValidAimTarget() { return true; }
|
||||||
virtual bool ValidOrbitTarget() { return true; }
|
virtual bool ValidOrbitTarget() { return true; }
|
||||||
virtual bool GetOrbitDistanceCheck() { return true; }
|
virtual bool GetOrbitDistanceCheck() { return true; }
|
||||||
virtual zeus::CVector3f GetOrbitPosition()
|
virtual zeus::CVector3f GetOrbitPosition(const CStateManager&)
|
||||||
{ return x34_transform.m_origin; }
|
{ return x34_transform.m_origin; }
|
||||||
|
|
||||||
virtual ECollisionResponseType GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&, int) { return ECollisionResponseType::Unknown12; }
|
virtual ECollisionResponseType GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&, int) { return ECollisionResponseType::Unknown12; }
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace urde
|
||||||
|
|
||||||
class CScriptDock : public CPhysicsActor
|
class CScriptDock : public CPhysicsActor
|
||||||
{
|
{
|
||||||
|
friend class CScriptDoor;
|
||||||
s32 x258_;
|
s32 x258_;
|
||||||
s32 x25c_dock;
|
s32 x25c_dock;
|
||||||
TAreaId x260_area;
|
TAreaId x260_area;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#include "CScriptDoor.hpp"
|
#include "CScriptDoor.hpp"
|
||||||
|
#include "CScriptDock.hpp"
|
||||||
#include "Collision/CMaterialList.hpp"
|
#include "Collision/CMaterialList.hpp"
|
||||||
#include "Character/CAnimData.hpp"
|
#include "Character/CAnimData.hpp"
|
||||||
#include "Character/CAnimPlaybackParms.hpp"
|
#include "Character/CAnimPlaybackParms.hpp"
|
||||||
#include "AutoMapper/CMapWorldInfo.hpp"
|
#include "AutoMapper/CMapWorldInfo.hpp"
|
||||||
#include "CStateManager.hpp"
|
#include "CStateManager.hpp"
|
||||||
|
#include "CWorld.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
@ -30,6 +32,18 @@ CScriptDoor::CScriptDoor(TUniqueId uid, const std::string& name, const CEntityIn
|
||||||
x264_ = GetBoundingBox();
|
x264_ = GetBoundingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007F054 */
|
||||||
|
zeus::CVector3f CScriptDoor::GetOrbitPosition(const CStateManager &mgr) const
|
||||||
|
{
|
||||||
|
return x34_transform.m_origin + x29c_;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007E550 */
|
||||||
|
void CScriptDoor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager &mgr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007E0BC */
|
||||||
void CScriptDoor::ForceClosed(CStateManager & mgr)
|
void CScriptDoor::ForceClosed(CStateManager & mgr)
|
||||||
{
|
{
|
||||||
if (x2a8_26_)
|
if (x2a8_26_)
|
||||||
|
@ -58,6 +72,23 @@ void CScriptDoor::ForceClosed(CStateManager & mgr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007E1C4 */
|
||||||
|
bool CScriptDoor::IsConnectedToArea(const CStateManager& mgr, TAreaId area)
|
||||||
|
{
|
||||||
|
const CScriptDock* dock = dynamic_cast<const CScriptDock*>(mgr.GetObjectById(x282_dockId));
|
||||||
|
if (dock)
|
||||||
|
{
|
||||||
|
if (dock->x260_area == area)
|
||||||
|
return true;
|
||||||
|
/*
|
||||||
|
* TODO: Determine what's going on here
|
||||||
|
* CWorld* world = mgr.GetWorld();
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007EA64 */
|
||||||
void CScriptDoor::OpenDoor(TUniqueId uid, CStateManager& mgr)
|
void CScriptDoor::OpenDoor(TUniqueId uid, CStateManager& mgr)
|
||||||
{
|
{
|
||||||
TEditorId eid = mgr.GetEditorIdForUniqueId(uid);
|
TEditorId eid = mgr.GetEditorIdForUniqueId(uid);
|
||||||
|
@ -79,6 +110,22 @@ void CScriptDoor::OpenDoor(TUniqueId uid, CStateManager& mgr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007ED4C */
|
||||||
|
u32 CScriptDoor::GetDoorOpenCondition(CStateManager& mgr)
|
||||||
|
{
|
||||||
|
const CScriptDock* dock = dynamic_cast<const CScriptDock*>(mgr.GetObjectById(x282_dockId));
|
||||||
|
|
||||||
|
if (!dock)
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
if (x25c_ < 0.05f)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
/* TODO: Finish this */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ORIGINAL 0-00 OFFSET: 8007E9D0 */
|
||||||
void CScriptDoor::SetDoorAnimation(CScriptDoor::EDoorAnimType type)
|
void CScriptDoor::SetDoorAnimation(CScriptDoor::EDoorAnimType type)
|
||||||
{
|
{
|
||||||
CModelData* modelData = x64_modelData.get();
|
CModelData* modelData = x64_modelData.get();
|
||||||
|
|
|
@ -21,7 +21,9 @@ public:
|
||||||
EDoorAnimType x260_doorState = EDoorAnimType::Zero;
|
EDoorAnimType x260_doorState = EDoorAnimType::Zero;
|
||||||
zeus::CAABox x264_;
|
zeus::CAABox x264_;
|
||||||
TUniqueId x27c_otherId = kInvalidUniqueId;
|
TUniqueId x27c_otherId = kInvalidUniqueId;
|
||||||
|
TUniqueId x282_dockId = kInvalidUniqueId;
|
||||||
|
|
||||||
|
zeus::CVector3f x29c_;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
@ -50,8 +52,12 @@ public:
|
||||||
const zeus::CVector3f&, const zeus::CAABox&,
|
const zeus::CVector3f&, const zeus::CAABox&,
|
||||||
bool active, bool material, bool, float, bool ballDoor);
|
bool active, bool material, bool, float, bool ballDoor);
|
||||||
|
|
||||||
|
zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const;
|
||||||
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr);
|
||||||
void ForceClosed(CStateManager&);
|
void ForceClosed(CStateManager&);
|
||||||
|
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area);
|
||||||
void OpenDoor(TUniqueId, CStateManager&);
|
void OpenDoor(TUniqueId, CStateManager&);
|
||||||
|
u32 GetDoorOpenCondition(CStateManager& mgr);
|
||||||
void SetDoorAnimation(EDoorAnimType);
|
void SetDoorAnimation(EDoorAnimType);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue