2016-05-23 05:36:20 +00:00
|
|
|
#include "CScriptDebris.hpp"
|
2018-01-15 12:36:04 +00:00
|
|
|
#include "Collision/CCollisionInfoList.hpp"
|
|
|
|
#include "Particle/CElementGen.hpp"
|
2017-01-15 03:07:01 +00:00
|
|
|
#include "TCastTo.hpp"
|
2016-05-23 05:36:20 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
2017-11-13 06:19:18 +00:00
|
|
|
CScriptDebris::CScriptDebris(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
2017-08-13 05:26:14 +00:00
|
|
|
CModelData&& mData, const CActorParameters& aParams, CAssetId, const zeus::CVector3f&, float,
|
2016-05-23 05:36:20 +00:00
|
|
|
const zeus::CVector3f&, const zeus::CColor&, float f1, float f2, float f3,
|
|
|
|
CScriptDebris::EScaleType, bool, bool, bool active)
|
2017-02-28 07:31:14 +00:00
|
|
|
: CPhysicsActor(uid, active, name, info, xf, std::move(mData),
|
|
|
|
CMaterialList(EMaterialTypes::Solid, EMaterialTypes::Debris),
|
|
|
|
mData.GetBounds(xf.getRotation()), SMoverData(f2), aParams, 0.3f, 0.1f)
|
2016-05-23 05:36:20 +00:00
|
|
|
|
2018-01-15 12:36:04 +00:00
|
|
|
{
|
2016-05-23 05:36:20 +00:00
|
|
|
}
|
|
|
|
|
2017-11-13 06:19:18 +00:00
|
|
|
CScriptDebris::CScriptDebris(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
2017-02-28 07:31:14 +00:00
|
|
|
CModelData&& mData, const CActorParameters& aParams, float, float, float, float, float,
|
|
|
|
float, float, float, float, const zeus::CColor&, const zeus::CColor&, float,
|
|
|
|
const zeus::CVector3f&, const zeus::CVector3f&, float, float,
|
2017-08-13 05:26:14 +00:00
|
|
|
const zeus::CVector3f&, CAssetId, const zeus::CVector3f&, bool, bool,
|
|
|
|
CScriptDebris::EOrientationType, CAssetId, const zeus::CVector3f&, bool, bool,
|
|
|
|
CScriptDebris::EOrientationType, CAssetId, const zeus::CVector3f&, CScriptDebris::EOrientationType,
|
2017-02-28 07:31:14 +00:00
|
|
|
bool, bool, bool, bool active)
|
|
|
|
: CPhysicsActor(uid, active, name, info, xf, std::move(mData),
|
|
|
|
CMaterialList(EMaterialTypes::Solid, EMaterialTypes::Debris),
|
|
|
|
mData.GetBounds(xf.getRotation()), SMoverData(1.f), aParams, 0.3f, 0.1f)
|
2018-01-15 12:36:04 +00:00
|
|
|
{
|
2017-01-15 03:07:01 +00:00
|
|
|
}
|
|
|
|
|
2017-02-28 07:31:14 +00:00
|
|
|
void CScriptDebris::Accept(IVisitor& visitor)
|
2016-05-23 05:36:20 +00:00
|
|
|
{
|
2017-02-28 07:31:14 +00:00
|
|
|
visitor.Visit(this);
|
2016-05-23 05:36:20 +00:00
|
|
|
}
|
|
|
|
|
2018-01-15 12:36:04 +00:00
|
|
|
rstl::optional_object<zeus::CAABox> CScriptDebris::GetTouchBounds() const
|
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
void CScriptDebris::CollidedWith(TUniqueId, const CCollisionInfoList& colList, CStateManager&)
|
|
|
|
{
|
|
|
|
if (colList.GetCount() == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (x282_24_)
|
|
|
|
{
|
|
|
|
x274_ = x270_;
|
|
|
|
SetVelocityWR(zeus::CVector3f::skZero);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x2c8_collisionNormal = colList.GetItem(0).GetNormalLeft();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-23 05:36:20 +00:00
|
|
|
}
|