mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-07-26 18:00:38 +00:00
feat: T4 and T5 physconstraints dumping (#879)
* feat: T4 and T5 physconstraints dumping * chore: small style adjustments --------- Co-authored-by: Jan Laupetin <[email protected]>
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
namespace T4
|
||||
{
|
||||
static constexpr auto INFO_STRING_PREFIX_FLAME_TABLE = "FLAMETABLEFILE";
|
||||
static constexpr auto INFO_STRING_PREFIX_PHYS_CONSTRAINTS = "PHYSCONSTRAINTS";
|
||||
static constexpr auto INFO_STRING_PREFIX_WEAPON = "WEAPONFILE";
|
||||
|
||||
static constexpr auto GDF_FILENAME_PHYS_CONSTRAINTS = "physconstraints.gdf";
|
||||
static constexpr auto GDF_FILENAME_WEAPON = "weapon.gdf";
|
||||
} // namespace T4
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#pragma once
|
||||
#include "Game/T4/T4.h"
|
||||
|
||||
namespace T4
|
||||
{
|
||||
inline cspField_t phys_constraints_fields[]{
|
||||
{"c1_type", offsetof(PhysConstraints, data[0].type), CFT_TYPE },
|
||||
{"c1_bone1_name", offsetof(PhysConstraints, data[0].target_bone1), CSPFT_STRING},
|
||||
{"c1_bone2_name", offsetof(PhysConstraints, data[0].target_bone2), CSPFT_STRING},
|
||||
{"c1_offsetX", offsetof(PhysConstraints, data[0].offset[1]), CSPFT_FLOAT },
|
||||
{"c1_offsetY", offsetof(PhysConstraints, data[0].offset[2]), CSPFT_FLOAT },
|
||||
{"c1_offsetZ", offsetof(PhysConstraints, data[0].offset[3]), CSPFT_FLOAT },
|
||||
{"c1_timeout", offsetof(PhysConstraints, data[0].timeout), CSPFT_INT },
|
||||
{"c1_min_health", offsetof(PhysConstraints, data[0].min_health), CSPFT_INT },
|
||||
{"c1_max_health", offsetof(PhysConstraints, data[0].max_health), CSPFT_INT },
|
||||
{"c1_damp", offsetof(PhysConstraints, data[0].damp), CSPFT_FLOAT },
|
||||
{"c1_power", offsetof(PhysConstraints, data[0].power), CSPFT_FLOAT },
|
||||
{"c1_spin_scale", offsetof(PhysConstraints, data[0].spin_scale), CSPFT_FLOAT },
|
||||
{"c1_shakescalex", offsetof(PhysConstraints, data[0].scale[1]), CSPFT_FLOAT },
|
||||
{"c1_shakescaley", offsetof(PhysConstraints, data[0].scale[2]), CSPFT_FLOAT },
|
||||
{"c1_shakescalez", offsetof(PhysConstraints, data[0].scale[3]), CSPFT_FLOAT },
|
||||
{"c1_min_angle", offsetof(PhysConstraints, data[0].minAngle), CSPFT_FLOAT },
|
||||
{"c1_max_angle", offsetof(PhysConstraints, data[0].maxAngle), CSPFT_FLOAT },
|
||||
{"c1_yaw", offsetof(PhysConstraints, data[0].scale[1]), CSPFT_FLOAT },
|
||||
{"c1_pitch", offsetof(PhysConstraints, data[0].scale[2]), CSPFT_FLOAT },
|
||||
{"c2_type", offsetof(PhysConstraints, data[1].type), CFT_TYPE },
|
||||
{"c2_bone1_name", offsetof(PhysConstraints, data[1].target_bone1), CSPFT_STRING},
|
||||
{"c2_bone2_name", offsetof(PhysConstraints, data[1].target_bone2), CSPFT_STRING},
|
||||
{"c2_offsetX", offsetof(PhysConstraints, data[1].offset[1]), CSPFT_FLOAT },
|
||||
{"c2_offsetY", offsetof(PhysConstraints, data[1].offset[2]), CSPFT_FLOAT },
|
||||
{"c2_offsetZ", offsetof(PhysConstraints, data[1].offset[3]), CSPFT_FLOAT },
|
||||
{"c2_timeout", offsetof(PhysConstraints, data[1].timeout), CSPFT_INT },
|
||||
{"c2_min_health", offsetof(PhysConstraints, data[1].min_health), CSPFT_INT },
|
||||
{"c2_max_health", offsetof(PhysConstraints, data[1].max_health), CSPFT_INT },
|
||||
{"c2_damp", offsetof(PhysConstraints, data[1].damp), CSPFT_FLOAT },
|
||||
{"c2_power", offsetof(PhysConstraints, data[1].power), CSPFT_FLOAT },
|
||||
{"c2_spin_scale", offsetof(PhysConstraints, data[1].spin_scale), CSPFT_FLOAT },
|
||||
{"c2_shakescalex", offsetof(PhysConstraints, data[1].scale[1]), CSPFT_FLOAT },
|
||||
{"c2_shakescaley", offsetof(PhysConstraints, data[1].scale[2]), CSPFT_FLOAT },
|
||||
{"c2_shakescalez", offsetof(PhysConstraints, data[1].scale[3]), CSPFT_FLOAT },
|
||||
{"c2_min_angle", offsetof(PhysConstraints, data[1].minAngle), CSPFT_FLOAT },
|
||||
{"c2_max_angle", offsetof(PhysConstraints, data[1].maxAngle), CSPFT_FLOAT },
|
||||
{"c2_yaw", offsetof(PhysConstraints, data[1].scale[1]), CSPFT_FLOAT },
|
||||
{"c2_pitch", offsetof(PhysConstraints, data[1].scale[2]), CSPFT_FLOAT },
|
||||
{"c3_type", offsetof(PhysConstraints, data[2].type), CFT_TYPE },
|
||||
{"c3_bone1_name", offsetof(PhysConstraints, data[2].target_bone1), CSPFT_STRING},
|
||||
{"c3_bone2_name", offsetof(PhysConstraints, data[2].target_bone2), CSPFT_STRING},
|
||||
{"c3_offsetX", offsetof(PhysConstraints, data[2].offset[1]), CSPFT_FLOAT },
|
||||
{"c3_offsetY", offsetof(PhysConstraints, data[2].offset[2]), CSPFT_FLOAT },
|
||||
{"c3_offsetZ", offsetof(PhysConstraints, data[2].offset[3]), CSPFT_FLOAT },
|
||||
{"c3_timeout", offsetof(PhysConstraints, data[2].timeout), CSPFT_INT },
|
||||
{"c3_min_health", offsetof(PhysConstraints, data[2].min_health), CSPFT_INT },
|
||||
{"c3_max_health", offsetof(PhysConstraints, data[2].max_health), CSPFT_INT },
|
||||
{"c3_damp", offsetof(PhysConstraints, data[2].damp), CSPFT_FLOAT },
|
||||
{"c3_power", offsetof(PhysConstraints, data[2].power), CSPFT_FLOAT },
|
||||
{"c3_spin_scale", offsetof(PhysConstraints, data[2].spin_scale), CSPFT_FLOAT },
|
||||
{"c3_shakescalex", offsetof(PhysConstraints, data[2].scale[1]), CSPFT_FLOAT },
|
||||
{"c3_shakescaley", offsetof(PhysConstraints, data[2].scale[2]), CSPFT_FLOAT },
|
||||
{"c3_shakescalez", offsetof(PhysConstraints, data[2].scale[3]), CSPFT_FLOAT },
|
||||
{"c3_min_angle", offsetof(PhysConstraints, data[2].minAngle), CSPFT_FLOAT },
|
||||
{"c3_max_angle", offsetof(PhysConstraints, data[2].maxAngle), CSPFT_FLOAT },
|
||||
{"c3_yaw", offsetof(PhysConstraints, data[2].scale[1]), CSPFT_FLOAT },
|
||||
{"c3_pitch", offsetof(PhysConstraints, data[2].scale[2]), CSPFT_FLOAT },
|
||||
{"c4_type", offsetof(PhysConstraints, data[3].type), CFT_TYPE },
|
||||
{"c4_bone1_name", offsetof(PhysConstraints, data[3].target_bone1), CSPFT_STRING},
|
||||
{"c4_bone2_name", offsetof(PhysConstraints, data[3].target_bone2), CSPFT_STRING},
|
||||
{"c4_offsetX", offsetof(PhysConstraints, data[3].offset[1]), CSPFT_FLOAT },
|
||||
{"c4_offsetY", offsetof(PhysConstraints, data[3].offset[2]), CSPFT_FLOAT },
|
||||
{"c4_offsetZ", offsetof(PhysConstraints, data[3].offset[3]), CSPFT_FLOAT },
|
||||
{"c4_timeout", offsetof(PhysConstraints, data[3].timeout), CSPFT_INT },
|
||||
{"c4_min_health", offsetof(PhysConstraints, data[3].min_health), CSPFT_INT },
|
||||
{"c4_max_health", offsetof(PhysConstraints, data[3].max_health), CSPFT_INT },
|
||||
{"c4_damp", offsetof(PhysConstraints, data[3].damp), CSPFT_FLOAT },
|
||||
{"c4_power", offsetof(PhysConstraints, data[3].power), CSPFT_FLOAT },
|
||||
{"c4_spin_scale", offsetof(PhysConstraints, data[3].spin_scale), CSPFT_FLOAT },
|
||||
{"c4_shakescalex", offsetof(PhysConstraints, data[3].scale[1]), CSPFT_FLOAT },
|
||||
{"c4_shakescaley", offsetof(PhysConstraints, data[3].scale[2]), CSPFT_FLOAT },
|
||||
{"c4_shakescalez", offsetof(PhysConstraints, data[3].scale[3]), CSPFT_FLOAT },
|
||||
{"c4_min_angle", offsetof(PhysConstraints, data[3].minAngle), CSPFT_FLOAT },
|
||||
{"c4_max_angle", offsetof(PhysConstraints, data[3].maxAngle), CSPFT_FLOAT },
|
||||
{"c4_yaw", offsetof(PhysConstraints, data[3].scale[1]), CSPFT_FLOAT },
|
||||
{"c4_pitch", offsetof(PhysConstraints, data[3].scale[2]), CSPFT_FLOAT },
|
||||
};
|
||||
|
||||
inline const char* s_constraintTypeNames[]{
|
||||
"none",
|
||||
"point",
|
||||
"distance",
|
||||
"hinge",
|
||||
"joint",
|
||||
"actuator",
|
||||
"fake_shake",
|
||||
"launch",
|
||||
"rope",
|
||||
};
|
||||
static_assert(std::extent_v<decltype(s_constraintTypeNames)> == NUM_CONSTRAINT_TYPES);
|
||||
} // namespace T4
|
||||
@@ -3,9 +3,11 @@
|
||||
namespace T5
|
||||
{
|
||||
static constexpr auto INFO_STRING_PREFIX_FLAME_TABLE = "FLAMETABLEFILE";
|
||||
static constexpr auto INFO_STRING_PREFIX_PHYS_CONSTRAINTS = "PHYSCONSTRAINTS";
|
||||
static constexpr auto INFO_STRING_PREFIX_PHYS_PRESET = "PHYSIC";
|
||||
static constexpr auto INFO_STRING_PREFIX_WEAPON = "WEAPONFILE";
|
||||
|
||||
static constexpr auto GDF_FILENAME_PHYS_CONSTRAINTS = "physconstraints.gdf";
|
||||
static constexpr auto GDF_FILENAME_PHYS_PRESET = "physpreset.gdf";
|
||||
static constexpr auto GDF_FILENAME_WEAPON = "weapon.gdf";
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
#pragma once
|
||||
#include "Game/T5/T5.h"
|
||||
|
||||
namespace T5
|
||||
{
|
||||
inline cspField_t phys_constraints_fields[]{
|
||||
{"c1_type", offsetof(PhysConstraints, data[0].type), CFT_TYPE },
|
||||
{"c1_bone1_name", offsetof(PhysConstraints, data[0].target_bone1), CSPFT_STRING},
|
||||
{"c1_bone2_name", offsetof(PhysConstraints, data[0].target_bone2), CSPFT_STRING},
|
||||
{"c1_offsetX", offsetof(PhysConstraints, data[0].offset.x), CSPFT_FLOAT },
|
||||
{"c1_offsetY", offsetof(PhysConstraints, data[0].offset.y), CSPFT_FLOAT },
|
||||
{"c1_offsetZ", offsetof(PhysConstraints, data[0].offset.z), CSPFT_FLOAT },
|
||||
{"c1_timeout", offsetof(PhysConstraints, data[0].timeout), CSPFT_INT },
|
||||
{"c1_min_health", offsetof(PhysConstraints, data[0].min_health), CSPFT_INT },
|
||||
{"c1_max_health", offsetof(PhysConstraints, data[0].max_health), CSPFT_INT },
|
||||
{"c1_damp", offsetof(PhysConstraints, data[0].damp), CSPFT_FLOAT },
|
||||
{"c1_power", offsetof(PhysConstraints, data[0].power), CSPFT_FLOAT },
|
||||
{"c1_spin_scale", offsetof(PhysConstraints, data[0].spin_scale), CSPFT_FLOAT },
|
||||
{"c1_shakescalex", offsetof(PhysConstraints, data[0].scale.x), CSPFT_FLOAT },
|
||||
{"c1_shakescaley", offsetof(PhysConstraints, data[0].scale.y), CSPFT_FLOAT },
|
||||
{"c1_shakescalez", offsetof(PhysConstraints, data[0].scale.z), CSPFT_FLOAT },
|
||||
{"c1_min_angle", offsetof(PhysConstraints, data[0].minAngle), CSPFT_FLOAT },
|
||||
{"c1_max_angle", offsetof(PhysConstraints, data[0].maxAngle), CSPFT_FLOAT },
|
||||
{"c1_yaw", offsetof(PhysConstraints, data[0].scale.y), CSPFT_FLOAT },
|
||||
{"c1_pitch", offsetof(PhysConstraints, data[0].scale.x), CSPFT_FLOAT },
|
||||
{"c2_type", offsetof(PhysConstraints, data[1].type), CFT_TYPE },
|
||||
{"c2_bone1_name", offsetof(PhysConstraints, data[1].target_bone1), CSPFT_STRING},
|
||||
{"c2_bone2_name", offsetof(PhysConstraints, data[1].target_bone2), CSPFT_STRING},
|
||||
{"c2_offsetX", offsetof(PhysConstraints, data[1].offset.x), CSPFT_FLOAT },
|
||||
{"c2_offsetY", offsetof(PhysConstraints, data[1].offset.y), CSPFT_FLOAT },
|
||||
{"c2_offsetZ", offsetof(PhysConstraints, data[1].offset.z), CSPFT_FLOAT },
|
||||
{"c2_timeout", offsetof(PhysConstraints, data[1].timeout), CSPFT_INT },
|
||||
{"c2_min_health", offsetof(PhysConstraints, data[1].min_health), CSPFT_INT },
|
||||
{"c2_max_health", offsetof(PhysConstraints, data[1].max_health), CSPFT_INT },
|
||||
{"c2_damp", offsetof(PhysConstraints, data[1].damp), CSPFT_FLOAT },
|
||||
{"c2_power", offsetof(PhysConstraints, data[1].power), CSPFT_FLOAT },
|
||||
{"c2_spin_scale", offsetof(PhysConstraints, data[1].spin_scale), CSPFT_FLOAT },
|
||||
{"c2_shakescalex", offsetof(PhysConstraints, data[1].scale.x), CSPFT_FLOAT },
|
||||
{"c2_shakescaley", offsetof(PhysConstraints, data[1].scale.y), CSPFT_FLOAT },
|
||||
{"c2_shakescalez", offsetof(PhysConstraints, data[1].scale.z), CSPFT_FLOAT },
|
||||
{"c2_min_angle", offsetof(PhysConstraints, data[1].minAngle), CSPFT_FLOAT },
|
||||
{"c2_max_angle", offsetof(PhysConstraints, data[1].maxAngle), CSPFT_FLOAT },
|
||||
{"c2_yaw", offsetof(PhysConstraints, data[1].scale.y), CSPFT_FLOAT },
|
||||
{"c2_pitch", offsetof(PhysConstraints, data[1].scale.x), CSPFT_FLOAT },
|
||||
{"c3_type", offsetof(PhysConstraints, data[2].type), CFT_TYPE },
|
||||
{"c3_bone1_name", offsetof(PhysConstraints, data[2].target_bone1), CSPFT_STRING},
|
||||
{"c3_bone2_name", offsetof(PhysConstraints, data[2].target_bone2), CSPFT_STRING},
|
||||
{"c3_offsetX", offsetof(PhysConstraints, data[2].offset.x), CSPFT_FLOAT },
|
||||
{"c3_offsetY", offsetof(PhysConstraints, data[2].offset.y), CSPFT_FLOAT },
|
||||
{"c3_offsetZ", offsetof(PhysConstraints, data[2].offset.z), CSPFT_FLOAT },
|
||||
{"c3_timeout", offsetof(PhysConstraints, data[2].timeout), CSPFT_INT },
|
||||
{"c3_min_health", offsetof(PhysConstraints, data[2].min_health), CSPFT_INT },
|
||||
{"c3_max_health", offsetof(PhysConstraints, data[2].max_health), CSPFT_INT },
|
||||
{"c3_damp", offsetof(PhysConstraints, data[2].damp), CSPFT_FLOAT },
|
||||
{"c3_power", offsetof(PhysConstraints, data[2].power), CSPFT_FLOAT },
|
||||
{"c3_spin_scale", offsetof(PhysConstraints, data[2].spin_scale), CSPFT_FLOAT },
|
||||
{"c3_shakescalex", offsetof(PhysConstraints, data[2].scale.x), CSPFT_FLOAT },
|
||||
{"c3_shakescaley", offsetof(PhysConstraints, data[2].scale.y), CSPFT_FLOAT },
|
||||
{"c3_shakescalez", offsetof(PhysConstraints, data[2].scale.z), CSPFT_FLOAT },
|
||||
{"c3_min_angle", offsetof(PhysConstraints, data[2].minAngle), CSPFT_FLOAT },
|
||||
{"c3_max_angle", offsetof(PhysConstraints, data[2].maxAngle), CSPFT_FLOAT },
|
||||
{"c3_yaw", offsetof(PhysConstraints, data[2].scale.y), CSPFT_FLOAT },
|
||||
{"c3_pitch", offsetof(PhysConstraints, data[2].scale.x), CSPFT_FLOAT },
|
||||
{"c4_type", offsetof(PhysConstraints, data[3].type), CFT_TYPE },
|
||||
{"c4_bone1_name", offsetof(PhysConstraints, data[3].target_bone1), CSPFT_STRING},
|
||||
{"c4_bone2_name", offsetof(PhysConstraints, data[3].target_bone2), CSPFT_STRING},
|
||||
{"c4_offsetX", offsetof(PhysConstraints, data[3].offset.x), CSPFT_FLOAT },
|
||||
{"c4_offsetY", offsetof(PhysConstraints, data[3].offset.y), CSPFT_FLOAT },
|
||||
{"c4_offsetZ", offsetof(PhysConstraints, data[3].offset.z), CSPFT_FLOAT },
|
||||
{"c4_timeout", offsetof(PhysConstraints, data[3].timeout), CSPFT_INT },
|
||||
{"c4_min_health", offsetof(PhysConstraints, data[3].min_health), CSPFT_INT },
|
||||
{"c4_max_health", offsetof(PhysConstraints, data[3].max_health), CSPFT_INT },
|
||||
{"c4_damp", offsetof(PhysConstraints, data[3].damp), CSPFT_FLOAT },
|
||||
{"c4_power", offsetof(PhysConstraints, data[3].power), CSPFT_FLOAT },
|
||||
{"c4_spin_scale", offsetof(PhysConstraints, data[3].spin_scale), CSPFT_FLOAT },
|
||||
{"c4_shakescalex", offsetof(PhysConstraints, data[3].scale.x), CSPFT_FLOAT },
|
||||
{"c4_shakescaley", offsetof(PhysConstraints, data[3].scale.y), CSPFT_FLOAT },
|
||||
{"c4_shakescalez", offsetof(PhysConstraints, data[3].scale.z), CSPFT_FLOAT },
|
||||
{"c4_min_angle", offsetof(PhysConstraints, data[3].minAngle), CSPFT_FLOAT },
|
||||
{"c4_max_angle", offsetof(PhysConstraints, data[3].maxAngle), CSPFT_FLOAT },
|
||||
{"c4_yaw", offsetof(PhysConstraints, data[3].scale.y), CSPFT_FLOAT },
|
||||
{"c4_pitch", offsetof(PhysConstraints, data[3].scale.x), CSPFT_FLOAT },
|
||||
};
|
||||
|
||||
inline const char* s_constraintTypeNames[]{
|
||||
"none",
|
||||
"point",
|
||||
"distance",
|
||||
"hinge",
|
||||
"joint",
|
||||
"actuator",
|
||||
"fake_shake",
|
||||
"launch",
|
||||
"rope",
|
||||
"light",
|
||||
};
|
||||
static_assert(std::extent_v<decltype(s_constraintTypeNames)> == NUM_CONSTRAINT_TYPES);
|
||||
} // namespace T5
|
||||
@@ -94,4 +94,5 @@ namespace T6
|
||||
"rope",
|
||||
"light",
|
||||
};
|
||||
static_assert(std::extent_v<decltype(s_constraintTypeNames)> == NUM_CONSTRAINT_TYPES);
|
||||
} // namespace T6
|
||||
|
||||
Reference in New Issue
Block a user