Compare commits

..

5 Commits

Author SHA1 Message Date
Marco Tylus
7e5bf0c8ec
Merge 8935c520c0 into abf9eb3b05 2026-03-12 17:32:00 +09:00
fallenoak
abf9eb3b05
feat(object): set CGUnit_C::m_smoothFacing in CGUnit_C::PostInit
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
2026-03-10 21:40:11 -05:00
fallenoak
00d340c242
chore(build): update typhoon 2026-03-10 21:36:29 -05:00
fallenoak
d3d4fa884f
feat(object): add CGUnit_C::GetRawFacing 2026-03-10 21:35:55 -05:00
fallenoak
7082e8db17
feat(ui): implement CGCamera::ParentToWorld
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
2026-03-09 21:43:35 -05:00
12 changed files with 91 additions and 6 deletions

@ -1 +1 @@
Subproject commit 1e5366bbc6935e3363abf5921f0be12f902e790a Subproject commit c6ee931690f71362ab76602fb6f34a6cf23d12b8

View File

@ -111,6 +111,14 @@ C3Vector CGObject_C::GetPosition() const {
return { 0.0f, 0.0f, 0.0f }; return { 0.0f, 0.0f, 0.0f };
} }
float CGObject_C::GetRawFacing() const {
return this->GetFacing();
}
WOWGUID CGObject_C::GetTransportGUID() const {
return 0;
}
int32_t CGObject_C::IsInReenable() { int32_t CGObject_C::IsInReenable() {
return this->m_inReenable; return this->m_inReenable;
} }

View File

@ -39,6 +39,9 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
virtual C3Vector GetPosition() const; virtual C3Vector GetPosition() const;
// TODO // TODO
virtual float GetFacing() const; virtual float GetFacing() const;
virtual float GetRawFacing() const;
// TODO
virtual WOWGUID GetTransportGUID() const;
// TODO // TODO
virtual int32_t GetModelFileName(const char*& name) const; virtual int32_t GetModelFileName(const char*& name) const;
// TODO // TODO

View File

@ -42,6 +42,10 @@ C3Vector CGUnit::GetPosition() const {
return this->m_move->GetPosition(); return this->m_move->GetPosition();
} }
float CGUnit::GetRawFacing() const {
return this->m_move->GetRawFacing();
}
CGUnitData* CGUnit::Unit() const { CGUnitData* CGUnit::Unit() const {
return this->m_unit; return this->m_unit;
} }

View File

@ -92,6 +92,7 @@ class CGUnit {
float GetFacing() const; float GetFacing() const;
int32_t GetNativeDisplayID() const; int32_t GetNativeDisplayID() const;
C3Vector GetPosition() const; C3Vector GetPosition() const;
float GetRawFacing() const;
protected: protected:
// Protected member variables // Protected member variables

View File

@ -1,10 +1,11 @@
#include "object/client/CGUnit_C.hpp" #include "object/client/CGUnit_C.hpp"
#include "component/CCharacterComponent.hpp" #include "component/CCharacterComponent.hpp"
#include "db/Db.hpp"
#include "model/Model2.hpp" #include "model/Model2.hpp"
#include "object/client/ObjMgr.hpp" #include "object/client/ObjMgr.hpp"
#include "db/Db.hpp"
#include "ui/Game.hpp" #include "ui/Game.hpp"
#include <storm/Error.hpp> #include <storm/Error.hpp>
#include <tempest/Math.hpp>
WOWGUID CGUnit_C::s_activeMover; WOWGUID CGUnit_C::s_activeMover;
@ -183,6 +184,18 @@ C3Vector CGUnit_C::GetPosition() const {
return this->CGUnit::GetPosition(); return this->CGUnit::GetPosition();
} }
float CGUnit_C::GetRawFacing() const {
return this->CGUnit::GetRawFacing();
}
float CGUnit_C::GetRawSmoothFacing() const {
return this->m_smoothFacing;
}
WOWGUID CGUnit_C::GetTransportGUID() const {
return this->m_localMove.GetTransportGUID();
}
void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) { void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
// TODO // TODO
@ -200,6 +213,10 @@ void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
} }
// TODO // TODO
this->m_smoothFacing = CMath::normalizeangle0to2pi(this->GetRawFacing());
// TODO
} }
void CGUnit_C::PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover) { void CGUnit_C::PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover) {

View File

@ -31,6 +31,9 @@ class CGUnit_C : public CGObject_C, public CGUnit {
virtual C3Vector GetPosition() const; virtual C3Vector GetPosition() const;
// TODO // TODO
virtual float GetFacing() const; virtual float GetFacing() const;
virtual float GetRawFacing() const;
// TODO
virtual WOWGUID GetTransportGUID() const;
// TODO // TODO
virtual int32_t GetModelFileName(const char*& name) const; virtual int32_t GetModelFileName(const char*& name) const;
// TODO // TODO
@ -42,6 +45,7 @@ class CGUnit_C : public CGObject_C, public CGUnit {
CGUnit_C(uint32_t time, CClientObjCreate& objCreate); CGUnit_C(uint32_t time, CClientObjCreate& objCreate);
int32_t GetDisplayID() const; int32_t GetDisplayID() const;
CreatureModelDataRec* GetModelData() const; CreatureModelDataRec* GetModelData() const;
float GetRawSmoothFacing() const;
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4); void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
void PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover); void PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover);
void SetStorage(uint32_t* storage, uint32_t* saved); void SetStorage(uint32_t* storage, uint32_t* saved);
@ -65,6 +69,8 @@ class CGUnit_C : public CGObject_C, public CGUnit {
// TODO // TODO
int32_t m_localDisplayID = 0; int32_t m_localDisplayID = 0;
// TODO // TODO
float m_smoothFacing;
// TODO
}; };
#endif #endif

View File

@ -0,0 +1,6 @@
#include "object/client/CVehicleCamera_C.hpp"
#include "object/client/CGObject_C.hpp"
int32_t CVehicleCamera_C::ConvertSmoothFacingFromRawToWorld(float& smoothFacing, CGObject_C* relativeTo) {
return 0;
}

View File

@ -0,0 +1,13 @@
#ifndef OBJECT_CLIENT_C_VEHICLE_CAMERA_C_HPP
#define OBJECT_CLIENT_C_VEHICLE_CAMERA_C_HPP
#include <cstdint>
class CGObject_C;
class CVehicleCamera_C {
public:
// Public static functions
static int32_t ConvertSmoothFacingFromRawToWorld(float& smoothFacing, CGObject_C* relativeTo);
};
#endif

View File

@ -32,3 +32,11 @@ C3Vector CPassenger::GetPosition(const C3Vector& position) const {
return position; return position;
} }
float CPassenger::GetRawFacing() const {
return this->m_facing;
}
WOWGUID CPassenger::GetTransportGUID() const {
return this->m_transportGUID;
}

View File

@ -16,6 +16,8 @@ class CPassenger {
float GetFacing(float facing) const; float GetFacing(float facing) const;
C3Vector GetPosition() const; C3Vector GetPosition() const;
C3Vector GetPosition(const C3Vector& position) const; C3Vector GetPosition(const C3Vector& position) const;
float GetRawFacing() const;
WOWGUID GetTransportGUID() const;
protected: protected:
// Protected member variables // Protected member variables

View File

@ -1,10 +1,12 @@
#include "ui/game/CGCamera.hpp" #include "ui/game/CGCamera.hpp"
#include "ui/game/Types.hpp"
#include "console/CVar.hpp" #include "console/CVar.hpp"
#include "object/Client.hpp"
#include "object/client/CVehicleCamera_C.hpp"
#include "ui/game/Types.hpp"
#include "world/World.hpp" #include "world/World.hpp"
#include <algorithm>
#include <storm/String.hpp> #include <storm/String.hpp>
#include <tempest/Math.hpp> #include <tempest/Math.hpp>
#include <algorithm>
static CVar* s_cameraView; static CVar* s_cameraView;
@ -75,8 +77,23 @@ int32_t CGCamera::HasModel() const {
} }
C33Matrix CGCamera::ParentToWorld() const { C33Matrix CGCamera::ParentToWorld() const {
// TODO auto relativeTo = ClntObjMgrObjectPtr(this->m_relativeTo, TYPE_OBJECT, __FILE__, __LINE__);
return {};
if (!relativeTo) {
return {};
}
float facing;
if (relativeTo->IsA(TYPE_UNIT)) {
facing = static_cast<CGUnit_C*>(relativeTo)->GetRawSmoothFacing();
auto transport = ClntObjMgrObjectPtr(relativeTo->GetTransportGUID(), TYPE_OBJECT, __FILE__, __LINE__);
CVehicleCamera_C::ConvertSmoothFacingFromRawToWorld(facing, transport);
} else {
facing = relativeTo->GetFacing();
}
return C33Matrix::RotationAroundZ(facing);
} }
C3Vector CGCamera::Right() const { C3Vector CGCamera::Right() const {