Skip to content

Commit

Permalink
Mapped c_havok_component
Browse files Browse the repository at this point in the history
  • Loading branch information
theTwister authored and theTwister committed Aug 11, 2023
1 parent 935d082 commit 6da2798
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions game/game.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ POPD
<ClCompile Include="source\objects\object_definitions.cpp" />
<ClCompile Include="source\physics\collisions.cpp" />
<ClCompile Include="source\physics\havok.cpp" />
<ClCompile Include="source\physics\havok_component.cpp" />
<ClCompile Include="source\physics\havok_utilities.cpp" />
<ClCompile Include="source\physics\physics_constants.cpp" />
<ClCompile Include="source\rasterizer\rasterizer.cpp" />
Expand Down Expand Up @@ -781,6 +782,7 @@ POPD
<ClInclude Include="source\physics\collisions.hpp" />
<ClInclude Include="source\physics\collision_model_definitions.hpp" />
<ClInclude Include="source\physics\havok.hpp" />
<ClInclude Include="source\physics\havok_component.hpp" />
<ClInclude Include="source\physics\havok_mopp_code_definitions.hpp" />
<ClInclude Include="source\physics\havok_utilities.hpp" />
<ClInclude Include="source\physics\havok_vehicle_physics_definitions.hpp" />
Expand Down
6 changes: 6 additions & 0 deletions game/game.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,9 @@
<ClCompile Include="source\units\vehicle_definitions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="source\physics\havok_component.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\camera\camera.hpp">
Expand Down Expand Up @@ -2123,6 +2126,9 @@
<ClInclude Include="source\physics\havok_vehicle_physics_definitions.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="source\physics\havok_component.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="source\tag_files\string_ids\string_ids.global_strings.inl">
Expand Down
4 changes: 4 additions & 0 deletions game/source/physics/havok_component.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "physics/havok_component.hpp"

REFERENCE_DECLARE(0x02446080, c_smart_data_array<c_havok_component>*, g_havok_component_data);

59 changes: 59 additions & 0 deletions game/source/physics/havok_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#pragma once

#include "cseries/cseries.hpp"
#include "memory/data.hpp"

template <typename t_type>
struct hkArrayBase
{
public:
t_type* _data;
long _size;
dword _capacityAndFlags;
};
static_assert(sizeof(hkArrayBase<void*>) == 0xC);

template <typename t_type, typename t_allocator = void>
struct hkArray :
public hkArrayBase<t_type>
{
public:
};
static_assert(sizeof(hkArray<void*>) == 0xC);

struct hkRigidBody;
struct c_havok_component : s_datum_header
{
struct c_rigid_body
{
byte __data0[0x1C];
real_point3d __point1C;
vector3d __vector28;
vector3d __vector34;
hkRigidBody* m_rigid_body;
byte_flags m_flags;
};
static_assert(sizeof(c_rigid_body) == 0x48);

struct c_constraint
{
byte __data0[0xC];
};
static_assert(sizeof(c_constraint) == 0xC);

dword_flags m_flags;
long m_object_index;
short m_object_postion_controlling_rigid_body_index;
bool __unknownE;
long __unknown10;
hkArray<c_rigid_body> m_havok_rigid_bodies;
c_rigid_body m_rigid_body;
hkArray<c_constraint> m_constraints;
void* __unknown60;
void* m_simple_shape_phantom;
void* m_aabb_phantom;
};
static_assert(sizeof(c_havok_component) == 0x80);

extern c_smart_data_array<c_havok_component>*& g_havok_component_data;

0 comments on commit 6da2798

Please sign in to comment.