2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include "Runtime/rstl.hpp"
|
|
|
|
#include "Runtime/Weapon/CGameProjectile.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CAABox.hpp>
|
|
|
|
#include <zeus/CTransform.hpp>
|
|
|
|
#include <zeus/CVector3f.hpp>
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBeamProjectile : public CGameProjectile {
|
2019-01-03 03:47:28 +00:00
|
|
|
public:
|
|
|
|
enum class EDamageType {
|
|
|
|
None,
|
|
|
|
Actor,
|
|
|
|
World
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
s32 x2e8_intMaxLength;
|
|
|
|
float x2ec_maxLength;
|
|
|
|
float x2f0_invMaxLength;
|
|
|
|
float x2f4_beamRadius;
|
|
|
|
EDamageType x2f8_damageType = EDamageType::None;
|
2018-12-08 05:30:43 +00:00
|
|
|
TUniqueId x2fc_ = kInvalidUniqueId;
|
2019-01-03 03:47:28 +00:00
|
|
|
TUniqueId x2fe_collisionActorId = kInvalidUniqueId;
|
|
|
|
float x300_intBeamLength;
|
|
|
|
float x304_beamLength;
|
|
|
|
float x308_travelSpeed;
|
2019-02-24 07:15:54 +00:00
|
|
|
zeus::CVector3f x30c_collisionNormal = zeus::skUp;
|
|
|
|
zeus::CVector3f x318_collisionPoint = zeus::skZero3f;
|
2019-01-03 03:47:28 +00:00
|
|
|
zeus::CTransform x324_xf;
|
2019-02-24 07:15:54 +00:00
|
|
|
zeus::CAABox x354_ = zeus::skNullBox;
|
|
|
|
zeus::CAABox x36c_ = zeus::skNullBox;
|
2018-12-08 05:30:43 +00:00
|
|
|
rstl::reserved_vector<zeus::CVector3f, 10> x384_;
|
2019-01-03 03:47:28 +00:00
|
|
|
rstl::reserved_vector<zeus::CVector3f, 8> x400_pointCache;
|
|
|
|
bool x464_24_growingBeam : 1;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool x464_25_enableTouchDamage : 1 = false;
|
2019-01-03 03:47:28 +00:00
|
|
|
|
|
|
|
void SetCollisionResultData(EDamageType dType, CRayCastResult& res, TUniqueId id);
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2016-12-22 19:57:21 +00:00
|
|
|
public:
|
2021-05-26 14:00:57 +00:00
|
|
|
DEFINE_ENTITY
|
2018-12-08 05:30:43 +00:00
|
|
|
CBeamProjectile(const TToken<CWeaponDescription>& wDesc, std::string_view name, EWeaponType wType,
|
2019-01-03 03:47:28 +00:00
|
|
|
const zeus::CTransform& xf, s32 maxLength, float beamRadius, float travelSpeed,
|
|
|
|
EMaterialTypes matType, const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner,
|
|
|
|
EProjectileAttrib attribs, bool growingBeam);
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
2019-01-03 03:47:28 +00:00
|
|
|
float GetMaxRadius() const { return x2f4_beamRadius; }
|
|
|
|
const zeus::CVector3f& GetSurfaceNormal() const { return x30c_collisionNormal; }
|
|
|
|
EDamageType GetDamageType() const { return x2f8_damageType; }
|
|
|
|
const zeus::CVector3f& GetCurrentPos() const { return x318_collisionPoint; }
|
|
|
|
rstl::reserved_vector<zeus::CVector3f, 8>& PointCache() { return x400_pointCache; }
|
|
|
|
const rstl::reserved_vector<zeus::CVector3f, 8>& GetPointCache() const { return x400_pointCache; }
|
|
|
|
void CauseDamage(bool b) { x464_25_enableTouchDamage = b; }
|
|
|
|
const zeus::CTransform& GetBeamTransform() const { return x324_xf; }
|
|
|
|
float GetInvMaxLength() const { return x2f0_invMaxLength; }
|
|
|
|
float GetCurrentLength() const { return x304_beamLength; }
|
|
|
|
float GetMaxLength() const { return x2ec_maxLength; }
|
|
|
|
s32 GetIntMaxLength() const { return x2e8_intMaxLength; }
|
|
|
|
TUniqueId GetCollisionActorId() const { return x2fe_collisionActorId; }
|
2016-12-22 19:57:21 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
|
|
|
void CalculateRenderBounds() override;
|
2018-12-08 05:30:43 +00:00
|
|
|
virtual void ResetBeam(CStateManager&, bool);
|
2019-01-03 03:47:28 +00:00
|
|
|
virtual void UpdateFx(const zeus::CTransform&, float, CStateManager&);
|
2018-12-08 05:30:43 +00:00
|
|
|
virtual void Fire(const zeus::CTransform&, CStateManager&, bool) = 0;
|
2016-12-22 19:57:21 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|