2016-04-16 21:49:47 +00:00
|
|
|
#ifndef __URDE_CCAMERAMANAGER_HPP__
|
|
|
|
#define __URDE_CCAMERAMANAGER_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "zeus/CVector3f.hpp"
|
2016-04-16 23:48:29 +00:00
|
|
|
#include "World/CGameArea.hpp"
|
2016-04-16 21:49:47 +00:00
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CFirstPersonCamera;
|
|
|
|
class CBallCamera;
|
|
|
|
class CStateManager;
|
2016-04-16 23:48:29 +00:00
|
|
|
class CGameCamera;
|
|
|
|
class CCameraShakeData;
|
2016-04-16 21:49:47 +00:00
|
|
|
|
|
|
|
class CCameraManager
|
|
|
|
{
|
2016-04-16 23:48:29 +00:00
|
|
|
TUniqueId x0_curCameraId;
|
2016-04-16 21:49:47 +00:00
|
|
|
std::vector<TUniqueId> x4_cineCameras;
|
2016-04-16 23:48:29 +00:00
|
|
|
std::list<CCameraShakeData> x18_shakers;
|
2016-04-17 02:50:45 +00:00
|
|
|
u32 x2c_lastShakeId = 0;
|
|
|
|
zeus::CVector3f x30_shakeOffset;
|
|
|
|
CGameArea::CAreaFog x3c_fog;
|
|
|
|
int x74_fluidCounter = 0;
|
|
|
|
TUniqueId x78_fluidId = kInvalidUniqueId;
|
|
|
|
CFirstPersonCamera* x7c_fpCamera = nullptr;
|
|
|
|
CBallCamera* x80_ballCamera = nullptr;
|
|
|
|
s16 x84_rumbleId = -1;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
bool x86_24_ : 1;
|
|
|
|
bool x86_25_rumbling : 1;
|
|
|
|
bool x86_26_inWater : 1;
|
|
|
|
};
|
|
|
|
u8 _dummy = 0;
|
|
|
|
};
|
|
|
|
|
2016-04-16 21:49:47 +00:00
|
|
|
public:
|
2016-04-16 23:48:29 +00:00
|
|
|
CCameraManager(TUniqueId curCameraId);
|
2016-04-16 21:49:47 +00:00
|
|
|
|
2016-04-22 03:40:26 +00:00
|
|
|
static float DefaultAspect() {return 1.42f;}
|
|
|
|
static float DefaultFarPlane() {return 750.0f;}
|
|
|
|
static float DefaultNearPlane() {return 0.2f;}
|
|
|
|
static float DefaultFirstPersonFOV() {return 55.0f;}
|
|
|
|
static float DefaultThirdPersonFOV() {return 60.0f;}
|
|
|
|
|
2016-04-16 21:49:47 +00:00
|
|
|
void SetSpecialCameras(CFirstPersonCamera& fp, CBallCamera& ball)
|
|
|
|
{
|
|
|
|
x7c_fpCamera = &fp;
|
|
|
|
x80_ballCamera = &ball;
|
|
|
|
}
|
|
|
|
bool IsInCinematicCamera() const {return x4_cineCameras.size() != 0;}
|
|
|
|
zeus::CVector3f GetGlobalCameraTranslation(const CStateManager& stateMgr) const;
|
2016-04-17 02:50:45 +00:00
|
|
|
zeus::CTransform GetCurrentCameraTransform(const CStateManager& stateMgr) const;
|
|
|
|
void RemoveCameraShaker(int id);
|
|
|
|
int AddCameraShaker(const CCameraShakeData& data);
|
2016-04-16 21:49:47 +00:00
|
|
|
void AddCinemaCamera(TUniqueId, CStateManager& stateMgr);
|
|
|
|
void SetInsideFluid(bool, TUniqueId);
|
|
|
|
void Update(float dt, CStateManager& stateMgr);
|
2016-04-16 23:48:29 +00:00
|
|
|
CGameCamera* GetCurrentCamera(CStateManager& stateMgr) const;
|
|
|
|
const CGameCamera* GetCurrentCamera(const CStateManager& stateMgr) const;
|
2016-04-17 02:50:45 +00:00
|
|
|
void SetCurrentCameraId(TUniqueId id, CStateManager& stateMgr) {x0_curCameraId = id;}
|
2016-04-16 23:48:29 +00:00
|
|
|
TUniqueId GetCurrentCameraId() const
|
|
|
|
{
|
|
|
|
if (x4_cineCameras.size())
|
|
|
|
return x4_cineCameras.back();
|
|
|
|
return x0_curCameraId;
|
|
|
|
}
|
2016-04-16 21:49:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CCAMERAMANAGER_HPP__
|