mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 21:51:06 +03:00
Compare commits
1 Commits
5fd2461dc6
...
7e5bf0c8ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e5bf0c8ec |
@ -1,5 +1,4 @@
|
|||||||
#include "ui/game/CGCamera.hpp"
|
#include "ui/game/CGCamera.hpp"
|
||||||
#include "common/Time.hpp"
|
|
||||||
#include "console/CVar.hpp"
|
#include "console/CVar.hpp"
|
||||||
#include "object/Client.hpp"
|
#include "object/Client.hpp"
|
||||||
#include "object/client/CVehicleCamera_C.hpp"
|
#include "object/client/CVehicleCamera_C.hpp"
|
||||||
@ -40,56 +39,10 @@ bool ValidateCameraView(CVar* var, const char* oldValue, const char* value, void
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CGCamera::UpdateCallback(const void*, void* param) {
|
|
||||||
auto camera = static_cast<CGCamera*>(param);
|
|
||||||
|
|
||||||
if (!camera) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto timestamp = OsGetAsyncTimeMsPrecise();
|
|
||||||
|
|
||||||
camera->m_nearZ = CWorld::GetNearClip();
|
|
||||||
camera->m_farZ = CWorld::GetFarClip();
|
|
||||||
|
|
||||||
// Model camera
|
|
||||||
|
|
||||||
if (camera->HasModel()) {
|
|
||||||
camera->CalcModelCamera(timestamp);
|
|
||||||
camera->CheckUnderwater();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Target camera
|
|
||||||
|
|
||||||
auto target = ClntObjMgrObjectPtr(camera->m_target, TYPE_OBJECT, __FILE__, __LINE__);
|
|
||||||
|
|
||||||
if (target) {
|
|
||||||
camera->CalcTargetCamera(target, timestamp);
|
|
||||||
camera->CheckUnderwater();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unknown camera
|
|
||||||
|
|
||||||
auto object90 = ClntObjMgrObjectPtr(camera->guid90, TYPE_OBJECT, __FILE__, __LINE__);
|
|
||||||
|
|
||||||
if (object90) {
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGCamera::CGCamera() : CSimpleCamera(CWorld::GetNearClip(), CWorld::GetFarClip(), 90.0f * CMath::DEG2RAD) {
|
CGCamera::CGCamera() : CSimpleCamera(CWorld::GetNearClip(), CWorld::GetFarClip(), 90.0f * CMath::DEG2RAD) {
|
||||||
this->m_model = nullptr;
|
this->m_model = nullptr;
|
||||||
|
|
||||||
this->m_target = 0;
|
this->m_target = 0;
|
||||||
this->guid90 = 0;
|
|
||||||
this->m_relativeTo = 0;
|
this->m_relativeTo = 0;
|
||||||
|
|
||||||
this->m_view = s_cameraView->GetInt();
|
this->m_view = s_cameraView->GetInt();
|
||||||
@ -102,18 +55,6 @@ CGCamera::CGCamera() : CSimpleCamera(CWorld::GetNearClip(), CWorld::GetFarClip()
|
|||||||
this->m_fovOffset = 0.0f;
|
this->m_fovOffset = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGCamera::CalcModelCamera(uint32_t timestamp) {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGCamera::CalcTargetCamera(CGObject_C* target, uint32_t timestamp) {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGCamera::CheckUnderwater() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
float CGCamera::FOV() const {
|
float CGCamera::FOV() const {
|
||||||
// Clamp offset-adjusted FOV between 0pi and 1pi
|
// Clamp offset-adjusted FOV between 0pi and 1pi
|
||||||
return std::min(std::max(this->m_fov + this->m_fovOffset, 0.0f), CMath::PI);
|
return std::min(std::max(this->m_fov + this->m_fovOffset, 0.0f), CMath::PI);
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
#include "ui/simple/CSimpleCamera.hpp"
|
#include "ui/simple/CSimpleCamera.hpp"
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
|
|
||||||
class CGObject_C;
|
|
||||||
class CM2Model;
|
class CM2Model;
|
||||||
|
|
||||||
class CGCamera : public CSimpleCamera {
|
class CGCamera : public CSimpleCamera {
|
||||||
@ -19,9 +18,6 @@ class CGCamera : public CSimpleCamera {
|
|||||||
// Public static variables
|
// Public static variables
|
||||||
static CameraViewData s_cameraViewDataDefault[];
|
static CameraViewData s_cameraViewDataDefault[];
|
||||||
|
|
||||||
// Public static functions
|
|
||||||
static int32_t UpdateCallback(const void*, void* param);
|
|
||||||
|
|
||||||
// Virtual public member functions
|
// Virtual public member functions
|
||||||
virtual ~CGCamera() = default;
|
virtual ~CGCamera() = default;
|
||||||
virtual float FOV() const;
|
virtual float FOV() const;
|
||||||
@ -31,9 +27,6 @@ class CGCamera : public CSimpleCamera {
|
|||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGCamera();
|
CGCamera();
|
||||||
void CalcModelCamera(uint32_t timestamp);
|
|
||||||
void CalcTargetCamera(CGObject_C* target, uint32_t timestamp);
|
|
||||||
void CheckUnderwater();
|
|
||||||
const WOWGUID& GetTarget() const;
|
const WOWGUID& GetTarget() const;
|
||||||
int32_t HasModel() const;
|
int32_t HasModel() const;
|
||||||
C33Matrix ParentToWorld() const;
|
C33Matrix ParentToWorld() const;
|
||||||
@ -45,7 +38,6 @@ class CGCamera : public CSimpleCamera {
|
|||||||
CM2Model* m_model;
|
CM2Model* m_model;
|
||||||
// TODO
|
// TODO
|
||||||
WOWGUID m_target;
|
WOWGUID m_target;
|
||||||
WOWGUID guid90;
|
|
||||||
// TODO
|
// TODO
|
||||||
WOWGUID m_relativeTo;
|
WOWGUID m_relativeTo;
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -98,10 +98,6 @@ void CGWorldFrame::OnWorldUpdate() {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
CGCamera::UpdateCallback(nullptr, this->m_camera);
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
this->m_camera->SetupWorldProjection(this->m_screenRect);
|
this->m_camera->SetupWorldProjection(this->m_screenRect);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
#define UTIL_TIME_HPP
|
#define UTIL_TIME_HPP
|
||||||
|
|
||||||
#include "util/time/CGameTime.hpp"
|
#include "util/time/CGameTime.hpp"
|
||||||
#include "util/time/Types.hpp"
|
|
||||||
#include "util/time/WowTime.hpp"
|
#include "util/time/WowTime.hpp"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
#ifndef UTIL_TIME_TYPES_HPP
|
|
||||||
#define UTIL_TIME_TYPES_HPP
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
typedef uint64_t whoa_tick_t;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Loading…
Reference in New Issue
Block a user