metaforce/Runtime/Camera/CCameraShakeData.hpp

69 lines
2.0 KiB
C++
Raw Normal View History

2016-04-16 23:48:29 +00:00
#ifndef __URDE_CCAMERASHAKEDATA_HPP__
#define __URDE_CCAMERASHAKEDATA_HPP__
2016-04-17 02:50:45 +00:00
#include "zeus/CVector3f.hpp"
#include "RetroTypes.hpp"
2016-04-16 23:48:29 +00:00
namespace urde
{
2016-04-17 02:50:45 +00:00
class CRandom16;
2016-04-16 23:48:29 +00:00
struct SCameraShakePoint
{
friend class CCameraShakeData;
u32 x0_w1 = 0;
float x4_ = 0.f;
float x8_f4 = 0.f;
float xc_f1 = 0.f;
float x10_f2 = 0.f;
float x14_f3 = 0.f;
SCameraShakePoint() = default;
SCameraShakePoint(u32 w1, float f1, float f2, float f3, float f4)
: x0_w1(w1), x8_f4(f4), xc_f1(f1), x10_f2(f2), x14_f3(f3) {}
float GetSomething() const { return x0_w1 ? x8_f4 : x4_; }
static SCameraShakePoint LoadCameraShakePoint(CInputStream& in);
};
class CCameraShakerComponent
{
friend class CCameraShakeData;
u32 x4_w1 = 0;
SCameraShakePoint x8_sp1, x20_sp2;
float x38_ = 0.f;
public:
CCameraShakerComponent() = default;
CCameraShakerComponent(u32 w1, const SCameraShakePoint& sp1, const SCameraShakePoint& sp2)
: x4_w1(w1), x8_sp1(sp1), x20_sp2(sp2) {}
static CCameraShakerComponent LoadNewCameraShakerComponent(CInputStream& in);
};
2016-04-16 23:48:29 +00:00
class CCameraShakeData
{
2016-04-17 02:50:45 +00:00
friend class CCameraManager;
float x0_duration;
float x4_ = 0.f;
CCameraShakerComponent x8_shaker1;
CCameraShakerComponent x44_shaker2;
CCameraShakerComponent x80_shaker3;
u32 xbc_shakerId = 0;
u32 xc0_flags; // 0x1: positional sfx
zeus::CVector3f xc4_sfxPos;
float xd0_f2;
2016-04-16 23:48:29 +00:00
public:
CCameraShakeData(float duration, float f2, u32 w1, const zeus::CVector3f& v1,
const CCameraShakerComponent& shaker1, const CCameraShakerComponent& shaker2,
const CCameraShakerComponent& shaker3);
2017-03-26 05:53:04 +00:00
CCameraShakeData(float f1, float f2);
//zeus::CVector3f GeneratePoint(float dt, CRandom16& r);
float GetSomething() const;
float GetSomething2() const;
void SetShakerId(u32 id) { xbc_shakerId = id; }
u32 GetShakerId() const { return xbc_shakerId; }
static CCameraShakeData LoadCameraShakeData(CInputStream& in);
2016-04-16 23:48:29 +00:00
};
}
#endif // __URDE_CCAMERASHAKEDATA_HPP__