2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CCAMERASHAKEDATA
|
|
|
|
#define _CCAMERASHAKEDATA
|
2022-08-13 01:26:00 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
|
|
|
|
|
|
|
struct SCameraShakePoint {
|
2024-09-23 05:56:21 +00:00
|
|
|
uint x0_useEnvelope;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x4_value;
|
|
|
|
float x8_magnitude;
|
|
|
|
float xc_attackTime;
|
|
|
|
float x10_sustainTime;
|
|
|
|
float x14_duration;
|
2022-11-25 00:01:26 +00:00
|
|
|
|
|
|
|
SCameraShakePoint()
|
|
|
|
: x0_useEnvelope(false)
|
|
|
|
, x8_magnitude(0.f)
|
|
|
|
, xc_attackTime(0.f)
|
|
|
|
, x10_sustainTime(0.f)
|
|
|
|
, x14_duration(0.f) {}
|
|
|
|
|
|
|
|
SCameraShakePoint(bool useEnvelope, float attackTime, float sustainTime, float duration,
|
|
|
|
float magnitude)
|
|
|
|
: x0_useEnvelope(useEnvelope)
|
|
|
|
, x8_magnitude(magnitude)
|
|
|
|
, xc_attackTime(attackTime)
|
|
|
|
, x10_sustainTime(sustainTime)
|
|
|
|
, x14_duration(duration) {}
|
2022-08-13 01:26:00 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(SCameraShakePoint, 0x18)
|
|
|
|
|
|
|
|
class CCameraShakerComponent {
|
|
|
|
public:
|
2022-11-25 00:01:26 +00:00
|
|
|
CCameraShakerComponent() : x4_useModulation(false), x38_value(0.f) {}
|
|
|
|
|
|
|
|
CCameraShakerComponent(bool useModulation, const SCameraShakePoint& am,
|
|
|
|
const SCameraShakePoint& fm)
|
|
|
|
: x4_useModulation(useModulation), x8_am(am), x20_fm(fm) {}
|
|
|
|
|
2022-11-03 12:29:47 +00:00
|
|
|
virtual ~CCameraShakerComponent() {}
|
2022-08-13 01:26:00 +00:00
|
|
|
|
|
|
|
private:
|
2024-09-23 05:56:21 +00:00
|
|
|
uint x4_useModulation;
|
2022-08-13 01:26:00 +00:00
|
|
|
SCameraShakePoint x8_am;
|
|
|
|
SCameraShakePoint x20_fm;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x38_value;
|
2022-08-13 01:26:00 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CCameraShakerComponent, 0x3c)
|
|
|
|
|
2022-11-10 06:50:18 +00:00
|
|
|
class CStateManager;
|
2022-08-13 01:26:00 +00:00
|
|
|
class CCameraShakeData {
|
2022-11-03 12:29:47 +00:00
|
|
|
public:
|
2022-11-25 00:01:26 +00:00
|
|
|
CCameraShakeData(float duration, float magnitude)
|
|
|
|
: x0_duration(duration)
|
|
|
|
, xd0_sfxDist(100.f)
|
|
|
|
, xc0_flags(0)
|
|
|
|
, xc4_sfxPos(CVector3f::Zero())
|
|
|
|
, x8_shakerX()
|
|
|
|
, x44_shakerY()
|
|
|
|
, x80_shakerZ(true, SCameraShakePoint(false, 0.25f * duration, 0.f, 0.75f * duration, magnitude),
|
|
|
|
SCameraShakePoint(true, 0.f, 0.f, 0.5f * duration, 2.f)) {}
|
|
|
|
|
2024-09-23 05:56:21 +00:00
|
|
|
void SetId(int id) { xbc_shakerId = id; }
|
|
|
|
int GetId() const { return xbc_shakerId; }
|
2022-11-10 06:50:18 +00:00
|
|
|
void Update(float dt, CStateManager& mgr);
|
2024-09-22 22:58:50 +00:00
|
|
|
// GeneratePoint__16CCameraShakeDataFfR9CRandom16
|
2024-09-23 05:56:21 +00:00
|
|
|
float GetSomething() const;
|
|
|
|
float GetSomething2() const;
|
2022-11-10 06:50:18 +00:00
|
|
|
|
|
|
|
float GetDuration() const { return x0_duration; }
|
|
|
|
float GetCurTime() const { return x4_curTime; }
|
2024-09-22 22:58:50 +00:00
|
|
|
CVector3f GetPoint() const; // { return xc4_sfxPos; }
|
|
|
|
bool Done() const { return x4_curTime >= x0_duration; }
|
2024-09-23 05:56:21 +00:00
|
|
|
uint GetFlags() const { return xc0_flags; }
|
|
|
|
const CVector3f& GetSfxPos() const { return xc4_sfxPos; }
|
2022-11-03 12:29:47 +00:00
|
|
|
|
2022-11-25 12:41:28 +00:00
|
|
|
static CCameraShakeData skChargedShotCameraShakeData;
|
|
|
|
|
2022-08-13 01:26:00 +00:00
|
|
|
private:
|
2022-10-09 05:37:23 +00:00
|
|
|
float x0_duration;
|
|
|
|
float x4_curTime;
|
2022-08-13 01:26:00 +00:00
|
|
|
CCameraShakerComponent x8_shakerX;
|
|
|
|
CCameraShakerComponent x44_shakerY;
|
|
|
|
CCameraShakerComponent x80_shakerZ;
|
2022-11-03 12:29:47 +00:00
|
|
|
int xbc_shakerId;
|
2022-09-05 04:01:13 +00:00
|
|
|
uint xc0_flags;
|
2022-08-13 01:26:00 +00:00
|
|
|
CVector3f xc4_sfxPos;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xd0_sfxDist;
|
2022-08-13 01:26:00 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CCameraShakeData, 0xd4)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CCAMERASHAKEDATA
|