mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-27 23:27:52 -05:00
feat: dump and load xmodels for IW5 via template
This commit is contained in:
32
src/ObjCommon/Game/IW5/XModel/JsonXModelIW5.h
Normal file
32
src/ObjCommon/Game/IW5/XModel/JsonXModelIW5.h
Normal file
@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "Json/JsonCommon.h"
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
class JsonXModelLod
|
||||
{
|
||||
public:
|
||||
std::string file;
|
||||
float distance;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonXModelLod, file, distance);
|
||||
|
||||
class JsonXModel
|
||||
{
|
||||
public:
|
||||
std::vector<JsonXModelLod> lods;
|
||||
std::optional<int> collLod;
|
||||
std::optional<std::string> physPreset;
|
||||
std::optional<std::string> physCollmap;
|
||||
uint8_t flags;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonXModel, lods, collLod, physPreset, physCollmap, flags);
|
||||
} // namespace IW5
|
32
src/ObjCommon/Game/IW5/XModel/XModelConstantsIW5.h
Normal file
32
src/ObjCommon/Game/IW5/XModel/XModelConstantsIW5.h
Normal file
@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
inline const char* HITLOC_NAMES[]{
|
||||
// clang-format off
|
||||
"none",
|
||||
"helmet",
|
||||
"head",
|
||||
"neck",
|
||||
"torso_upper",
|
||||
"torso_lower",
|
||||
"right_arm_upper",
|
||||
"left_arm_upper",
|
||||
"right_arm_lower",
|
||||
"left_arm_lower",
|
||||
"right_hand",
|
||||
"left_hand",
|
||||
"right_leg_upper",
|
||||
"left_leg_upper",
|
||||
"right_leg_lower",
|
||||
"left_leg_lower",
|
||||
"right_foot",
|
||||
"left_foot",
|
||||
"gun",
|
||||
"shield",
|
||||
// clang-format on
|
||||
};
|
||||
static_assert(std::extent_v<decltype(HITLOC_NAMES)> == HITLOC_COUNT);
|
||||
} // namespace IW5
|
Reference in New Issue
Block a user