mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-07-26 18:00:38 +00:00
refactor: physpreset codestyle (#928)
* chore: adjust phys preset code to use similar code style * fix: infinity friction for t6 * fix: t6 phys preset canFloat qboolean * chore: move iw5 phys preset enum strings to enum strings header * chore: add phys preset tests for all games * chore: rename PhysPresetFields headers
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
inline const char* szPhysPresetScalingNames[]{
|
||||
"linear",
|
||||
"quadratic",
|
||||
};
|
||||
} // namespace IW5
|
||||
+7
-1
@@ -23,4 +23,10 @@ namespace IW5
|
||||
{"tempDefaultToCylinder", offsetof(PhysPresetInfo, tempDefaultToCylinder), CSPFT_QBOOLEAN},
|
||||
{"perSurfaceSndAlias", offsetof(PhysPresetInfo, perSurfaceSndAlias), CSPFT_QBOOLEAN},
|
||||
};
|
||||
}
|
||||
|
||||
inline const char* szPhysPresetScalingNames[]{
|
||||
"linear",
|
||||
"quadratic",
|
||||
};
|
||||
static_assert(std::extent_v<decltype(szPhysPresetScalingNames)> == PHYSPRESET_SCALING_COUNT);
|
||||
} // namespace IW5
|
||||
@@ -11,5 +11,5 @@ namespace T5
|
||||
static constexpr auto GDF_FILENAME_PHYS_PRESET = "physpreset.gdf";
|
||||
static constexpr auto GDF_FILENAME_WEAPON = "weapon.gdf";
|
||||
|
||||
static constexpr float MAX_FRICTION = 1e+10;
|
||||
static constexpr float PHYS_PRESET_MAX_FRICTION = 1e+10;
|
||||
} // namespace T5
|
||||
|
||||
@@ -20,4 +20,6 @@ namespace T6
|
||||
static constexpr auto GDF_FILENAME_WEAPON_ATTACHMENT = "attachment.gdf";
|
||||
static constexpr auto GDF_FILENAME_WEAPON_ATTACHMENT_UNIQUE = "attachmentunique.gdf";
|
||||
static constexpr auto GDF_FILENAME_ZBARRIER = "zbarrier.gdf";
|
||||
|
||||
static constexpr float PHYS_PRESET_MAX_FRICTION = 1e+10;
|
||||
} // namespace T6
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace T6
|
||||
{"explosiveForceScale", offsetof(PhysPresetInfo, explosiveForceScale), CSPFT_FLOAT },
|
||||
{"piecesSpreadFraction", offsetof(PhysPresetInfo, piecesSpreadFraction), CSPFT_FLOAT },
|
||||
{"piecesUpwardVelocity", offsetof(PhysPresetInfo, piecesUpwardVelocity), CSPFT_FLOAT },
|
||||
{"canFloat", offsetof(PhysPresetInfo, canFloat), CSPFT_INT },
|
||||
{"canFloat", offsetof(PhysPresetInfo, canFloat), CSPFT_QBOOLEAN},
|
||||
{"gravityScale", offsetof(PhysPresetInfo, gravityScale), CSPFT_FLOAT },
|
||||
{"massOffsetX", offsetof(PhysPresetInfo, centerOfMassOffset.x), CSPFT_FLOAT },
|
||||
{"massOffsetY", offsetof(PhysPresetInfo, centerOfMassOffset.y), CSPFT_FLOAT },
|
||||
Reference in New Issue
Block a user