2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-04-16 14:49:47 -07:00
|
|
|
|
2019-09-27 19:53:03 -07:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/World/CActor.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CMatrix4f.hpp>
|
|
|
|
#include <zeus/CTransform.hpp>
|
2016-04-16 14:49:47 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2018-02-03 22:46:47 -08:00
|
|
|
struct CFinalInput;
|
2016-04-16 14:49:47 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CGameCamera : public CActor {
|
|
|
|
friend class CCameraManager;
|
2019-09-27 19:53:03 -07:00
|
|
|
friend class CStateManager;
|
2017-03-23 22:30:16 -07:00
|
|
|
|
2017-10-06 22:32:11 -07:00
|
|
|
protected:
|
2018-12-07 21:30:43 -08:00
|
|
|
TUniqueId xe8_watchedObject;
|
2022-03-05 15:30:30 -08:00
|
|
|
mutable zeus::CMatrix4f xec_perspectiveMatrix;
|
2018-12-07 21:30:43 -08:00
|
|
|
zeus::CTransform x12c_origXf;
|
|
|
|
float x15c_currentFov;
|
|
|
|
float x160_znear;
|
|
|
|
float x164_zfar;
|
|
|
|
float x168_aspect;
|
|
|
|
u32 x16c_controllerIdx;
|
2022-03-05 15:30:30 -08:00
|
|
|
mutable bool x170_24_perspDirty : 1 = true;
|
2018-12-07 21:30:43 -08:00
|
|
|
bool x170_25_disablesInput : 1;
|
|
|
|
float x174_delayTime = 0.f;
|
|
|
|
float x178_perspInterpRemTime = 0.f;
|
|
|
|
float x17c_perspInterpDur = 0.f;
|
|
|
|
float x180_perspInterpStartFov;
|
|
|
|
float x184_perspInterpEndFov;
|
|
|
|
|
2016-04-16 14:49:47 -07:00
|
|
|
public:
|
2021-05-26 07:00:57 -07:00
|
|
|
DEFINE_ENTITY
|
2018-12-07 21:30:43 -08:00
|
|
|
CGameCamera(TUniqueId, bool active, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
float fov, float nearz, float farz, float aspect, TUniqueId watchedId, bool disableInput,
|
|
|
|
u32 controllerIdx);
|
2016-08-14 18:19:04 -07:00
|
|
|
|
2019-08-09 12:46:49 -07:00
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
|
|
|
void SetActive(bool active) override;
|
2018-12-07 21:30:43 -08:00
|
|
|
virtual void ProcessInput(const CFinalInput&, CStateManager& mgr) = 0;
|
|
|
|
virtual void Reset(const zeus::CTransform&, CStateManager& mgr) = 0;
|
2016-09-13 22:45:46 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
zeus::CMatrix4f GetPerspectiveMatrix() const;
|
|
|
|
zeus::CVector3f ConvertToScreenSpace(const zeus::CVector3f&) const;
|
2019-08-14 03:04:11 -07:00
|
|
|
zeus::CTransform ValidateCameraTransform(const zeus::CTransform&, const zeus::CTransform&) const;
|
2018-12-07 21:30:43 -08:00
|
|
|
float GetNearClipDistance() const { return x160_znear; }
|
|
|
|
float GetFarClipDistance() const { return x164_zfar; }
|
|
|
|
float GetAspectRatio() const { return x168_aspect; }
|
|
|
|
TUniqueId GetWatchedObject() const { return xe8_watchedObject; }
|
|
|
|
float GetFov() const { return x15c_currentFov; }
|
|
|
|
void GetControllerNumber() const;
|
|
|
|
bool DisablesInput() const;
|
|
|
|
void UpdatePerspective(float);
|
|
|
|
void SetFovInterpolation(float start, float end, float time, float delayTime);
|
|
|
|
void SkipFovInterpolation();
|
2016-09-13 22:45:46 -07:00
|
|
|
};
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|