mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 22:27:43 +00:00
Various implementatations
This commit is contained in:
@@ -2,17 +2,56 @@
|
||||
#include "Character/CModelData.hpp"
|
||||
#include "CActorParameters.hpp"
|
||||
#include "Collision/CMaterialList.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
CScriptTrigger::CScriptTrigger(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
||||
const zeus::CVector3f& pos, const zeus::CAABox&,
|
||||
const CDamageInfo& dInfo, const zeus::CVector3f& orientedForce,
|
||||
u32 triggerFlags, bool active, bool, bool)
|
||||
const zeus::CVector3f& pos, const zeus::CAABox& bounds,
|
||||
const CDamageInfo& dInfo, const zeus::CVector3f& forceField,
|
||||
u32 triggerFlags, bool active, bool b2, bool b3)
|
||||
: CActor(uid, active, name, info, zeus::CTransform::Translate(pos), CModelData::CModelDataNull(),
|
||||
CMaterialList(EMaterialTypes::ThirtyFour), CActorParameters::None(), kInvalidUniqueId)
|
||||
CMaterialList(EMaterialTypes::ThirtyFour), CActorParameters::None(), kInvalidUniqueId),
|
||||
x100_damageInfo(dInfo),
|
||||
x11c_forceField(forceField),
|
||||
x128_forceMagnitude(forceField.magnitude()),
|
||||
x12c_flags(triggerFlags),
|
||||
x130_bounds(bounds),
|
||||
x148_26_(b2),
|
||||
x148_27_(b3)
|
||||
{
|
||||
}
|
||||
|
||||
CScriptTrigger::CObjectTracker* CScriptTrigger::FindInhabitant(TUniqueId id)
|
||||
{
|
||||
const auto& iter = std::find_if(xe8_inhabitants.begin(), xe8_inhabitants.end(), [&id](CObjectTracker& tr)->bool{
|
||||
return tr.GetObjectId() == id;
|
||||
});
|
||||
if (iter != xe8_inhabitants.end())
|
||||
return &(*iter);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CScriptTrigger::UpdateInhabitants(CStateManager& mgr)
|
||||
{
|
||||
}
|
||||
|
||||
const std::list<CScriptTrigger::CObjectTracker>&CScriptTrigger::GetInhabitants() const
|
||||
{
|
||||
return xe8_inhabitants;
|
||||
}
|
||||
|
||||
rstl::optional_object<zeus::CAABox> CScriptTrigger::GetTouchBounds() const
|
||||
{
|
||||
if (x30_24_active)
|
||||
return {GetTriggerBoundsWR()};
|
||||
return {};
|
||||
}
|
||||
|
||||
zeus::CAABox CScriptTrigger::GetTriggerBoundsWR() const
|
||||
{
|
||||
return {x130_bounds.min + x34_transform.origin, x130_bounds.max + x34_transform.origin};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user