metaforce/Runtime/Weapon/CBeamProjectile.hpp

64 lines
2.6 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
#include "Weapon/CGameProjectile.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
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;
zeus::CVector3f x30c_collisionNormal = zeus::CVector3f::skUp;
zeus::CVector3f x318_collisionPoint = zeus::CVector3f::skZero;
zeus::CTransform x324_xf;
2018-12-08 05:30:43 +00:00
zeus::CAABox x354_ = zeus::CAABox::skNullBox;
2019-01-03 03:47:28 +00:00
zeus::CAABox x36c_ = zeus::CAABox::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;
bool x464_25_enableTouchDamage : 1;
void SetCollisionResultData(EDamageType dType, CRayCastResult& res, TUniqueId id);
2018-12-08 05:30:43 +00:00
public:
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);
2018-12-08 05:30:43 +00:00
void Accept(IVisitor& visitor);
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; }
2018-12-08 05:30:43 +00:00
std::experimental::optional<zeus::CAABox> GetTouchBounds() const;
void CalculateRenderBounds();
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;
};
2018-12-08 05:30:43 +00:00
} // namespace urde