mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
feat(object): add CGUnit_C::GetFacing
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
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
This commit is contained in:
parent
3a876398a7
commit
e5150d7d21
@ -30,6 +30,10 @@ int32_t CGUnit::GetDisplayID() const {
|
||||
return this->Unit()->displayID;
|
||||
}
|
||||
|
||||
float CGUnit::GetFacing() const {
|
||||
return this->m_move->GetFacing();
|
||||
}
|
||||
|
||||
int32_t CGUnit::GetNativeDisplayID() const {
|
||||
return this->Unit()->nativeDisplayID;
|
||||
}
|
||||
|
||||
@ -89,6 +89,7 @@ class CGUnit {
|
||||
CGUnit(CMovement_C& move)
|
||||
: m_move(&move) {};
|
||||
int32_t GetDisplayID() const;
|
||||
float GetFacing() const;
|
||||
int32_t GetNativeDisplayID() const;
|
||||
C3Vector GetPosition() const;
|
||||
|
||||
|
||||
@ -136,6 +136,10 @@ int32_t CGUnit_C::GetDisplayID() const {
|
||||
return this->CGUnit::GetDisplayID();
|
||||
}
|
||||
|
||||
float CGUnit_C::GetFacing() const {
|
||||
return this->CGUnit::GetFacing();
|
||||
}
|
||||
|
||||
int32_t CGUnit_C::GetLocalDisplayID() const {
|
||||
return this->m_localDisplayID;
|
||||
}
|
||||
|
||||
@ -30,6 +30,8 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
// TODO
|
||||
virtual C3Vector GetPosition() const;
|
||||
// TODO
|
||||
virtual float GetFacing() const;
|
||||
// TODO
|
||||
virtual int32_t GetModelFileName(const char*& name) const;
|
||||
// TODO
|
||||
virtual int32_t CanHighlight();
|
||||
|
||||
@ -1,15 +1,31 @@
|
||||
#include "object/movement/CPassenger.hpp"
|
||||
#include <tempest/Matrix.hpp>
|
||||
|
||||
float CPassenger::GetFacing() const {
|
||||
return this->GetFacing(this->m_facing);
|
||||
}
|
||||
|
||||
float CPassenger::GetFacing(float facing) const {
|
||||
// If on transport, transform facing by transport facing
|
||||
if (this->m_transportGUID) {
|
||||
float transportFacing = 0.0f;
|
||||
// TODO MovementGetTransportFacing(this->m_transportGUID);
|
||||
|
||||
return facing + transportFacing;
|
||||
}
|
||||
|
||||
return facing;
|
||||
}
|
||||
|
||||
C3Vector CPassenger::GetPosition() const {
|
||||
return GetPosition(this->m_position);
|
||||
return this->GetPosition(this->m_position);
|
||||
}
|
||||
|
||||
C3Vector CPassenger::GetPosition(const C3Vector& position) const {
|
||||
// If on transport, transform position by transport matrix
|
||||
if (this->m_transportGUID) {
|
||||
C44Matrix transportMatrix;
|
||||
// MovementGetTransportMtxX(this->m_transportGUID, &transportMatrix);
|
||||
// TODO MovementGetTransportMtxX(this->m_transportGUID, &transportMatrix);
|
||||
|
||||
return position * transportMatrix;
|
||||
}
|
||||
|
||||
@ -12,6 +12,8 @@ class CPassenger {
|
||||
, m_position(position)
|
||||
, m_facing(0.0f)
|
||||
, m_guid(guid) {};
|
||||
float GetFacing() const;
|
||||
float GetFacing(float facing) const;
|
||||
C3Vector GetPosition() const;
|
||||
C3Vector GetPosition(const C3Vector& position) const;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user