Temp-Classes/base/CNavigation.hpp

29 lines
1.2 KiB
C++
Raw Normal View History

2022-01-28 07:02:15 +08:00
#pragma once
#include "../rage/vector.hpp"
#include "phArchetype.hpp"
2022-01-28 07:02:15 +08:00
2022-10-30 21:32:30 +08:00
#pragma pack(push, 1)
2022-01-28 07:02:15 +08:00
class CNavigation
{
public:
char pad_0000[16]; //0x0000
class rage::phArchetypeDamp* m_damp; //0x0010
char pad_0018[8]; //0x0018
rage::fmatrix44 m_transformation_matrix;
rage::fvector3* get_position()
{
return reinterpret_cast<rage::fvector3*>(&m_transformation_matrix.rows[3]);
}
2022-11-29 05:14:26 +08:00
void model_to_world(const rage::fvector3& model_coords, rage::fvector3& world_coords)
{
world_coords.x = model_coords.x * m_transformation_matrix.data[0][0] + model_coords.y * m_transformation_matrix.data[1][0] + model_coords.z * m_transformation_matrix.data[2][0] + m_transformation_matrix.data[3][0];
world_coords.y = model_coords.x * m_transformation_matrix.data[0][1] + model_coords.y * m_transformation_matrix.data[1][1] + model_coords.z * m_transformation_matrix.data[2][1] + m_transformation_matrix.data[3][1];
world_coords.z = model_coords.x * m_transformation_matrix.data[0][2] + model_coords.y * m_transformation_matrix.data[1][2] + model_coords.z * m_transformation_matrix.data[2][2] + m_transformation_matrix.data[3][2];
}
2022-01-28 07:02:15 +08:00
}; //Size: 0x0060
static_assert(sizeof(CNavigation) == 0x60);
2022-10-30 21:32:30 +08:00
#pragma pack(pop)