2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-05-23 05:36:20 +00:00
|
|
|
|
2020-04-13 01:07:15 +00:00
|
|
|
#include <array>
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/World/CPhysicsActor.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CColor.hpp>
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-05-23 05:36:20 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2018-01-15 12:36:04 +00:00
|
|
|
class CElementGen;
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScriptDebris : public CPhysicsActor {
|
2016-05-23 05:36:20 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EScaleType { NoScale, EndsToZero };
|
2016-05-23 05:36:20 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EOrientationType { NotOriented, AlongVelocity, ToObject, AlongCollisionNormal };
|
2016-05-23 05:36:20 +00:00
|
|
|
|
|
|
|
private:
|
2018-12-08 05:30:43 +00:00
|
|
|
zeus::CVector3f x258_velocity;
|
|
|
|
zeus::CColor x264_color;
|
|
|
|
zeus::CColor x268_endsColor;
|
|
|
|
float x26c_zImpulse = 0.f;
|
|
|
|
float x270_curTime = 0.f;
|
|
|
|
float x274_duration = 0.f;
|
|
|
|
float x278_ooDuration = 0.f;
|
|
|
|
float x27c_restitution;
|
|
|
|
CScriptDebris::EScaleType x280_scaleType = CScriptDebris::EScaleType::NoScale;
|
2020-04-11 05:50:10 +00:00
|
|
|
bool x281_24_randomAngImpulse : 1;
|
|
|
|
bool x281_25_particle1GlobalTranslation : 1;
|
|
|
|
bool x281_26_deferDeleteTillParticle1Done : 1;
|
|
|
|
bool x281_27_particle2GlobalTranslation : 1;
|
|
|
|
bool x281_28_deferDeleteTillParticle2Done : 1;
|
|
|
|
bool x281_29_particle3Active : 1;
|
|
|
|
bool x281_30_debrisExtended : 1;
|
|
|
|
bool x281_31_dieOnProjectile : 1;
|
|
|
|
bool x282_24_noBounce : 1;
|
2018-12-08 05:30:43 +00:00
|
|
|
EOrientationType x283_particleOrs[3] = {};
|
|
|
|
float x288_linConeAngle = 0.f;
|
|
|
|
float x28c_linMinMag = 0.f;
|
|
|
|
float x290_linMaxMag = 0.f;
|
|
|
|
float x294_angMinMag = 0.f;
|
|
|
|
float x298_angMaxMag = 0.f;
|
|
|
|
float x29c_minDuration = 0.f;
|
|
|
|
float x2a0_maxDuration = 0.f;
|
|
|
|
float x2a4_colorInT = 0.f;
|
|
|
|
float x2a8_colorOutT = 0.f;
|
|
|
|
float x2ac_scaleOutStartT = 0.f;
|
|
|
|
zeus::CVector3f x2b0_scale;
|
|
|
|
zeus::CVector3f x2bc_endScale;
|
|
|
|
zeus::CVector3f x2c8_collisionNormal;
|
2020-04-13 01:07:15 +00:00
|
|
|
std::array<std::unique_ptr<CElementGen>, 3> x2d4_particleGens; /* x2d4, x2d8, x2dc */
|
2018-12-08 05:30:43 +00:00
|
|
|
TReservedAverage<float, 8> x2e0_speedAvg;
|
2018-05-14 03:38:36 +00:00
|
|
|
|
2016-05-23 05:36:20 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CScriptDebris(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
CModelData&& mData, const CActorParameters& aParams, CAssetId particleId,
|
|
|
|
const zeus::CVector3f& particleScale, float zImpulse, const zeus::CVector3f& velocity,
|
|
|
|
const zeus::CColor& endsColor, float mass, float restitution, float duration, EScaleType scaleType,
|
|
|
|
bool b1, bool randomAngImpulse, bool active);
|
2017-01-15 03:07:01 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CScriptDebris(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
CModelData&& mData, const CActorParameters& aParams, float linConeAngle, float linMinMag,
|
|
|
|
float linMaxMag, float angMinMag, float angMaxMag, float minDuration, float maxDuration, float colorInT,
|
|
|
|
float colorOutT, const zeus::CColor& color, const zeus::CColor& endsColor, float scaleOutStartT,
|
|
|
|
const zeus::CVector3f& scale, const zeus::CVector3f& endScale, float restitution, float downwardSpeed,
|
|
|
|
const zeus::CVector3f& localOffset, CAssetId particle1, const zeus::CVector3f& particle1Scale,
|
|
|
|
bool particle1GlobalTranslation, bool deferDeleteTillParticle1Done, EOrientationType particle1Or,
|
|
|
|
CAssetId particle2, const zeus::CVector3f& particle2Scale, bool particle2GlobalTranslation,
|
|
|
|
bool deferDeleteTillParticle2Done, EOrientationType particle2Or, CAssetId particle3,
|
|
|
|
const zeus::CVector3f& particle3Scale, EOrientationType particle3Or, bool solid, bool dieOnProjectile,
|
|
|
|
bool noBounce, bool active);
|
2017-02-28 07:31:14 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
|
2019-08-09 12:45:18 +00:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr) override;
|
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
|
|
|
void Touch(CActor& other, CStateManager& mgr) override;
|
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
|
|
|
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager& mgr) override;
|
2018-01-15 12:36:04 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void CollidedWith(TUniqueId uid, const CCollisionInfoList&, CStateManager&) override;
|
2016-05-23 05:36:20 +00:00
|
|
|
};
|
2018-05-14 03:38:36 +00:00
|
|
|
} // namespace urde
|