2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CGAMECAMERA
|
|
|
|
#define _CGAMECAMERA
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "MetroidPrime/CActor.hpp"
|
|
|
|
|
|
|
|
#include "Kyoto/Math/CMatrix4f.hpp"
|
2022-08-16 21:47:16 +00:00
|
|
|
#include "Kyoto/Math/CTransform4f.hpp"
|
2022-08-13 02:48:34 +00:00
|
|
|
|
2022-09-21 05:18:07 +00:00
|
|
|
class CFinalInput;
|
|
|
|
|
2022-08-13 02:48:34 +00:00
|
|
|
class CGameCamera : public CActor {
|
2022-08-16 21:47:16 +00:00
|
|
|
public:
|
2022-09-21 05:18:07 +00:00
|
|
|
CGameCamera(TUniqueId uid, bool active, const rstl::string& name, const CEntityInfo& info,
|
|
|
|
const CTransform4f& xf, float fov, float nearZ, float farZ, float aspect,
|
|
|
|
TUniqueId watchedId, bool disableInput, int controllerIdx);
|
|
|
|
|
|
|
|
// CEntity
|
2022-08-16 21:47:16 +00:00
|
|
|
~CGameCamera() override;
|
|
|
|
void Accept(IVisitor& visitor) override;
|
2022-09-21 05:18:07 +00:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
2022-11-08 14:23:03 +00:00
|
|
|
void SetActive(uchar active) override;
|
2022-09-21 05:18:07 +00:00
|
|
|
|
|
|
|
// CGameCamera
|
|
|
|
virtual void ProcessInput(const CFinalInput&, CStateManager& mgr) = 0;
|
|
|
|
virtual void Reset(const CTransform4f&, CStateManager& mgr) = 0;
|
|
|
|
|
2022-09-29 05:30:20 +00:00
|
|
|
TUniqueId GetWatchedObject() const { return xe8_watchedObject; }
|
2022-10-09 05:37:23 +00:00
|
|
|
float GetFov() const { return x15c_currentFov; }
|
|
|
|
void SetFov(float fov) { x15c_currentFov = fov; }
|
2022-11-11 00:26:17 +00:00
|
|
|
float GetNearClipDistance() const { return x160_znear; }
|
2022-10-09 05:37:23 +00:00
|
|
|
void SetFovInterpolation(float start, float fov, float time, float delayTime);
|
2022-11-10 06:50:18 +00:00
|
|
|
void UpdatePerspective(float dt);
|
2022-08-16 21:47:16 +00:00
|
|
|
|
2022-11-16 20:02:20 +00:00
|
|
|
protected:
|
2022-08-13 02:48:34 +00:00
|
|
|
TUniqueId xe8_watchedObject;
|
|
|
|
mutable CMatrix4f xec_perspectiveMatrix;
|
|
|
|
CTransform4f x12c_origXf;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x15c_currentFov;
|
|
|
|
float x160_znear;
|
|
|
|
float x164_zfar;
|
|
|
|
float x168_aspect;
|
2022-09-05 04:01:13 +00:00
|
|
|
uint x16c_controllerIdx;
|
2022-08-13 02:48:34 +00:00
|
|
|
mutable bool x170_24_perspDirty : 1;
|
|
|
|
bool x170_25_disablesInput : 1;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x174_delayTime;
|
|
|
|
float x178_perspInterpRemTime;
|
|
|
|
float x17c_perspInterpDur;
|
|
|
|
float x180_perspInterpStartFov;
|
|
|
|
float x184_perspInterpEndFov;
|
2022-08-13 02:48:34 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CGameCamera, 0x188)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CGAMECAMERA
|