2016-12-22 19:57:21 +00:00
|
|
|
#include "Weapon/CBeamProjectile.hpp"
|
2017-01-15 03:59:37 +00:00
|
|
|
#include "TCastTo.hpp"
|
2016-12-22 19:57:21 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
2017-11-13 06:19:18 +00:00
|
|
|
CBeamProjectile::CBeamProjectile(const TToken<CWeaponDescription>& wDesc, std::string_view name, EWeaponType wType,
|
2018-04-30 03:12:41 +00:00
|
|
|
const zeus::CTransform& xf, s32 flags, float f1, float f2, EMaterialTypes matType,
|
2017-09-05 03:00:19 +00:00
|
|
|
const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner,
|
|
|
|
EProjectileAttrib attribs, bool b1)
|
|
|
|
: CGameProjectile(false, wDesc, name, wType, xf, matType, dInfo, uid, aid, owner, kInvalidUniqueId, attribs, false,
|
2016-12-22 19:57:21 +00:00
|
|
|
zeus::CVector3f::skOne, {}, -1, false)
|
2018-04-30 03:12:41 +00:00
|
|
|
, x2e8_(std::abs(flags))
|
|
|
|
, x2ec_(x2e8_)
|
|
|
|
, x2f0_(1.f / x2ec_)
|
|
|
|
, x2f4_(f1)
|
|
|
|
, x300_(b1 == false ? x2ec_ : 0.f)
|
|
|
|
, x464_24_(b1)
|
|
|
|
, x464_25_(false)
|
2016-12-22 19:57:21 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-04-30 03:12:41 +00:00
|
|
|
std::experimental::optional<zeus::CAABox> CBeamProjectile::GetTouchBounds() const
|
2016-12-22 19:57:21 +00:00
|
|
|
{
|
2018-04-30 03:12:41 +00:00
|
|
|
if (!GetActive())
|
|
|
|
return {};
|
|
|
|
if (!x464_25_)
|
|
|
|
{
|
|
|
|
zeus::CVector3f pos = GetTranslation();
|
|
|
|
return {{pos - 1.f, pos + 1.f}};
|
|
|
|
}
|
2016-12-22 19:57:21 +00:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2018-04-30 03:12:41 +00:00
|
|
|
void CBeamProjectile::CalculateRenderBounds()
|
2016-12-22 19:57:21 +00:00
|
|
|
{
|
2018-04-30 03:12:41 +00:00
|
|
|
x9c_renderBounds = x354_.getTransformedAABox(x324_);
|
2016-12-22 19:57:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CBeamProjectile::ResetBeam(CStateManager &, bool)
|
|
|
|
{
|
2018-04-30 03:12:41 +00:00
|
|
|
if (x464_24_)
|
|
|
|
x300_ = 0.f;
|
2016-12-22 19:57:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CBeamProjectile::UpdateFX(const zeus::CTransform &, float, CStateManager &)
|
|
|
|
{
|
|
|
|
}
|
2017-01-15 03:59:37 +00:00
|
|
|
|
|
|
|
void CBeamProjectile::Accept(urde::IVisitor& visitor)
|
|
|
|
{
|
|
|
|
visitor.Visit(this);
|
|
|
|
}
|
|
|
|
|
2016-12-22 19:57:21 +00:00
|
|
|
}
|