metaforce/Runtime/World/CAi.cpp

36 lines
1.3 KiB
C++
Raw Normal View History

#include "CAi.hpp"
2016-04-24 02:46:13 +00:00
#include "Character/CModelData.hpp"
#include "CStateManager.hpp"
2016-09-17 06:40:45 +00:00
#include "CStateMachine.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-04-24 02:46:13 +00:00
static CMaterialList MakeAiMaterialList(const CMaterialList& in)
{
CMaterialList ret = in;
2016-12-29 21:38:59 +00:00
ret.Add(EMaterialTypes::AIBlock);
ret.Add(EMaterialTypes::CameraPassthrough);
2016-04-24 02:46:13 +00:00
return ret;
}
CAi::CAi(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf,
2016-09-01 09:31:18 +00:00
CModelData&& mData, const zeus::CAABox& box, float mass, const CHealthInfo& hInfo,
2017-08-13 05:26:14 +00:00
const CDamageVulnerability& dmgVuln, const CMaterialList& list, CAssetId fsm, const CActorParameters& actorParams,
2016-09-01 09:31:18 +00:00
float stepUp, float stepDown)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeAiMaterialList(list), box, SMoverData(mass),
actorParams, stepUp, stepDown)
, x258_healthInfo(hInfo)
, x260_damageVulnerability(dmgVuln)
2016-04-24 02:46:13 +00:00
{
}
CAiStateFunc CAi::GetStateFunc(const char* func) { return m_FuncMap->GetStateFunc(func); }
2016-04-24 02:46:13 +00:00
CAiTriggerFunc CAi::GetTrigerFunc(const char* func) { return m_FuncMap->GetTriggerFunc(func); }
2016-09-17 06:40:45 +00:00
const CStateMachine* CAi::GetStateMachine() const { return x2c8_stateMachine.GetObj(); }
void CAi::CreateFuncLookup(CAiFuncMap* funcMap) { m_FuncMap = funcMap; }
2016-04-24 02:46:13 +00:00
CAiFuncMap* CAi::m_FuncMap = nullptr;
}