feat: add T4 PhysPreset support (#925)

* feat: add T4 PhysPreset support

* chore: slight adjustment to how the max friction constant is named

---------

Co-authored-by: Jan Laupetin <[email protected]>
This commit is contained in:
mo
2026-07-21 23:56:59 +02:00
committed by GitHub
co-authored by Jan Laupetin
parent 572965844e
commit 37bb67a3a5
14 changed files with 490 additions and 1 deletions
+4
View File
@@ -4,8 +4,12 @@ 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_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";
static constexpr float PHYS_PRESET_MAX_FRICTION = 1e+10f;
} // namespace T4
@@ -0,0 +1,20 @@
#pragma once
#include "Game/T4/T4.h"
namespace T4
{
inline cspField_t phys_preset_fields[]{
{"mass", offsetof(PhysPresetInfo, mass), CSPFT_FLOAT },
{"bounce", offsetof(PhysPresetInfo, bounce), CSPFT_FLOAT },
{"friction", offsetof(PhysPresetInfo, friction), CSPFT_FLOAT },
{"isFrictionInfinity", offsetof(PhysPresetInfo, isFrictionInfinity), CSPFT_BOOL },
{"bulletForceScale", offsetof(PhysPresetInfo, bulletForceScale), CSPFT_FLOAT },
{"explosiveForceScale", offsetof(PhysPresetInfo, explosiveForceScale), CSPFT_FLOAT },
{"sndAliasPrefix", offsetof(PhysPresetInfo, sndAliasPrefix), CSPFT_STRING},
{"piecesSpreadFraction", offsetof(PhysPresetInfo, piecesSpreadFraction), CSPFT_FLOAT },
{"piecesUpwardVelocity", offsetof(PhysPresetInfo, piecesUpwardVelocity), CSPFT_FLOAT },
{"canFloat", offsetof(PhysPresetInfo, canFloat), CSPFT_BOOL },
{"gravityScale", offsetof(PhysPresetInfo, gravityScale), CSPFT_FLOAT },
};
}