2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CPLAYERCAMERABOB
|
|
|
|
#define _CPLAYERCAMERABOB
|
2022-10-05 22:55:57 +00:00
|
|
|
|
2022-10-05 23:06:15 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Kyoto/Math/CTransform4f.hpp"
|
2022-10-05 22:55:57 +00:00
|
|
|
#include "Kyoto/Math/CVector2f.hpp"
|
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
2022-10-05 23:06:15 +00:00
|
|
|
|
|
|
|
#include "rstl/reserved_vector.hpp"
|
2022-10-05 22:55:57 +00:00
|
|
|
|
|
|
|
class CStateManager;
|
2022-10-05 23:06:15 +00:00
|
|
|
|
2022-10-05 22:55:57 +00:00
|
|
|
class CPlayerCameraBob {
|
|
|
|
public:
|
2022-10-05 23:06:15 +00:00
|
|
|
enum ECameraBobType {
|
|
|
|
kCBT_Zero,
|
|
|
|
kCBT_One,
|
|
|
|
};
|
2022-10-05 22:55:57 +00:00
|
|
|
enum ECameraBobState {
|
|
|
|
kCBS_Walk,
|
|
|
|
kCBS_Orbit,
|
|
|
|
kCBS_InAir,
|
|
|
|
kCBS_WalkNoBob,
|
|
|
|
kCBS_GunFireNoBob,
|
|
|
|
kCBS_TurningNoBob,
|
|
|
|
kCBS_FreeLookNoBob,
|
|
|
|
kCBS_GrappleNoBob,
|
2022-10-05 23:06:15 +00:00
|
|
|
kCBS_Unspecified,
|
2022-10-05 22:55:57 +00:00
|
|
|
};
|
|
|
|
|
2023-01-10 06:51:58 +00:00
|
|
|
CPlayerCameraBob(ECameraBobType type, const CVector2f& vec, float bobPeriod);
|
2022-10-05 23:06:15 +00:00
|
|
|
|
|
|
|
CTransform4f GetViewWanderTransform() const;
|
|
|
|
CVector3f GetHelmetBobTranslation() const;
|
|
|
|
CTransform4f GetGunBobTransformation() const;
|
|
|
|
CTransform4f GetCameraBobTransformation() const;
|
|
|
|
void SetPlayerVelocity(const CVector3f& velocity);
|
|
|
|
void SetBobMagnitude(float);
|
|
|
|
void SetBobTimeScale(float);
|
|
|
|
void ResetCameraBobTime();
|
|
|
|
void SetCameraBobTransform(const CTransform4f&);
|
|
|
|
void SetState(ECameraBobState, CStateManager&);
|
|
|
|
void InitViewWander(CStateManager&);
|
|
|
|
void UpdateViewWander(float, CStateManager&);
|
|
|
|
void Update(float, CStateManager&);
|
|
|
|
CVector3f CalculateRandomViewWanderPosition(CStateManager&) const;
|
|
|
|
float CalculateRandomViewWanderPitch(CStateManager&) const;
|
|
|
|
void CalculateMovingTranslation(float& x, float& y) const;
|
|
|
|
float CalculateLandingTranslation() const;
|
|
|
|
CTransform4f CalculateCameraBobTransformation() const;
|
|
|
|
static void ReadTweaks(CInputStream& in);
|
|
|
|
|
2022-10-21 01:32:04 +00:00
|
|
|
// static float GetCameraBobExtentX() { return kCameraBobExtentX; }
|
|
|
|
// static float GetCameraBobExtentY() { return kCameraBobExtentY; }
|
|
|
|
// static float GetCameraBobPeriod() { return kCameraBobPeriod; }
|
2022-10-05 22:55:57 +00:00
|
|
|
static float GetOrbitBobScale() { return kOrbitBobScale; }
|
|
|
|
static float GetMaxOrbitBobScale() { return kMaxOrbitBobScale; }
|
|
|
|
static float GetSlowSpeedPeriodScale() { return kSlowSpeedPeriodScale; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
ECameraBobType x0_type;
|
|
|
|
CVector2f x4_vec;
|
|
|
|
float xc_bobPeriod;
|
|
|
|
float x10_targetBobMagnitude;
|
|
|
|
float x14_bobMagnitude;
|
|
|
|
float x18_bobTimeScale;
|
|
|
|
float x1c_bobTime;
|
|
|
|
ECameraBobState x20_oldState;
|
|
|
|
ECameraBobState x24_curState;
|
|
|
|
bool x28_applyLandingTrans;
|
|
|
|
bool x29_hardLand;
|
|
|
|
CTransform4f x2c_cameraBobTransform;
|
|
|
|
CVector3f x5c_playerVelocity;
|
|
|
|
float x68_playerPeakFallVel;
|
|
|
|
float x6c_landingVelocity;
|
|
|
|
float x70_landingTranslation;
|
|
|
|
float x74_camVelocity;
|
|
|
|
float x78_camTranslation;
|
2022-10-05 23:06:15 +00:00
|
|
|
rstl::reserved_vector< CVector3f, 4 > x7c_wanderPoints;
|
|
|
|
rstl::reserved_vector< float, 4 > xb0_wanderPitches;
|
2022-10-05 22:55:57 +00:00
|
|
|
float xc4_wanderTime;
|
|
|
|
float xc8_viewWanderSpeed;
|
2022-10-05 23:06:15 +00:00
|
|
|
uint xcc_wanderIndex;
|
2022-10-05 22:55:57 +00:00
|
|
|
CTransform4f xd0_viewWanderXf;
|
|
|
|
float x100_wanderMagnitude;
|
|
|
|
float x104_targetWanderMagnitude;
|
|
|
|
|
2022-10-21 01:32:04 +00:00
|
|
|
public:
|
2022-10-05 23:06:15 +00:00
|
|
|
static float kCameraBobExtentX;
|
|
|
|
static float kCameraBobExtentY;
|
|
|
|
static float kCameraBobPeriod;
|
|
|
|
static float kOrbitBobScale;
|
|
|
|
static float kMaxOrbitBobScale;
|
|
|
|
static float kSlowSpeedPeriodScale;
|
|
|
|
static float kTargetMagnitudeTrackingRate;
|
|
|
|
static float kLandingBobSpringConstant;
|
2023-01-10 06:51:58 +00:00
|
|
|
static float lbl_805A7398;
|
|
|
|
static float lbl_805A739C;
|
2022-10-05 23:06:15 +00:00
|
|
|
static float kLandingBobSpringConstant2;
|
2023-01-10 06:51:58 +00:00
|
|
|
static float lbl_805A73A4;
|
2022-10-05 23:06:15 +00:00
|
|
|
static float kViewWanderRadius;
|
|
|
|
static float kViewWanderSpeedMin;
|
|
|
|
static float kViewWanderSpeedMax;
|
|
|
|
static float kViewWanderRollVariation;
|
|
|
|
static float kGunBobMagnitude;
|
|
|
|
static float kHelmetBobMagnitude;
|
2023-01-10 06:51:58 +00:00
|
|
|
static float kLandingBobDamping;
|
|
|
|
static float kLandingBobDamping2;
|
|
|
|
static float kCameraDamping;
|
|
|
|
static float lbl_805A73C0;
|
|
|
|
static float lbl_805A73C4;
|
|
|
|
static float lbl_805A73C8;
|
|
|
|
static float lbl_805A73CC;
|
|
|
|
static float lbl_805A73D0;
|
|
|
|
static float lbl_805A73D4;
|
2022-10-05 22:55:57 +00:00
|
|
|
};
|
2022-10-05 23:06:15 +00:00
|
|
|
CHECK_SIZEOF(CPlayerCameraBob, 0x108)
|
2022-10-09 05:13:17 +00:00
|
|
|
|
|
|
|
#endif // _CPLAYERCAMERABOB
|