metaforce/Runtime/World/CScriptDamageableTrigger.cpp

41 lines
1.8 KiB
C++
Raw Normal View History

2016-05-03 08:27:28 +00:00
#include "CScriptDamageableTrigger.hpp"
#include "CActorParameters.hpp"
2017-01-15 03:07:01 +00:00
#include "TCastTo.hpp"
2016-05-03 08:27:28 +00:00
namespace urde
{
CActorParameters MakeDamageableTriggerActorParms(const CActorParameters& aParams, const CVisorParameters& vParams)
{
CActorParameters ret = aParams;
ret.SetVisorParameters(vParams);
return ret;
}
CMaterialList MakeDamageableTriggerMaterial(CScriptDamageableTrigger::ECanOrbit canOrbit)
{
if (canOrbit == CScriptDamageableTrigger::ECanOrbit::Orbit)
2016-12-29 21:38:59 +00:00
return CMaterialList(EMaterialTypes::Orbit, EMaterialTypes::Trigger, EMaterialTypes::Immovable,
EMaterialTypes::NonSolidDamageable, EMaterialTypes::ExcludeFromLineOfSightTest);
return CMaterialList(EMaterialTypes::Trigger, EMaterialTypes::Immovable,
EMaterialTypes::NonSolidDamageable, EMaterialTypes::ExcludeFromLineOfSightTest);
2016-05-03 08:27:28 +00:00
}
CScriptDamageableTrigger::CScriptDamageableTrigger(TUniqueId uid, const std::string& name, const CEntityInfo& info,
const zeus::CVector3f& position, const zeus::CVector3f& extent, const CHealthInfo&,
2017-08-13 05:26:14 +00:00
const CDamageVulnerability&, u32, CAssetId, CAssetId, CAssetId,
2016-05-03 08:27:28 +00:00
CScriptDamageableTrigger::ECanOrbit canOrbit, bool active, const CVisorParameters& vParams)
: CActor(uid, active, name, info, zeus::CTransform::Translate(position), CModelData::CModelDataNull(),
MakeDamageableTriggerMaterial(canOrbit), MakeDamageableTriggerActorParms(CActorParameters::None(), vParams),
kInvalidUniqueId),
x14c_bounds(-extent * 0.5f, extent * 0.5f)
{
}
2017-01-15 03:07:01 +00:00
void CScriptDamageableTrigger::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
2016-05-03 08:27:28 +00:00
}