Generic Damagemodel

included in root/data/ as a module so theres a generic folks can riff off of
additionally, includes a physcs based damage option inspector exposed augment for velicity based collisions, as well as utilities for applying damage to the object a given thing is mounted to
further. also fixes a lack of vehicles being able to use thier mvTriggerCount4 and 5 for the additional 2 mountpoints allowed
This commit is contained in:
AzaezelX 2025-04-06 16:09:14 -05:00
parent a996c09b04
commit 5cf54580e6
27 changed files with 1552 additions and 0 deletions

View file

@ -172,6 +172,8 @@ ShapeBaseData::ShapeBaseData()
density( 1.0f ),
maxEnergy( 0.0f ),
maxDamage( 1.0f ),
mCollisionMul(0.0f),
mImpactMul(0.0f),
repairRate( 0.0033f ),
disabledLevel( 1.0f ),
destroyedLevel( 1.0f ),
@ -229,6 +231,8 @@ ShapeBaseData::ShapeBaseData(const ShapeBaseData& other, bool temp_clone) : Game
density = other.density;
maxEnergy = other.maxEnergy;
maxDamage = other.maxDamage;
mCollisionMul = other.mCollisionMul;
mImpactMul = other.mImpactMul;
repairRate = other.repairRate;
disabledLevel = other.disabledLevel;
destroyedLevel = other.destroyedLevel;
@ -585,6 +589,10 @@ void ShapeBaseData::initPersistFields()
addField( "isInvincible", TypeBool, Offset(isInvincible, ShapeBaseData),
"Invincible flag; when invincible, the object cannot be damaged or "
"repaired." );
addFieldV("collisionMul", TypeRangedF32, Offset(mCollisionMul, ShapeBaseData), &CommonValidators::PositiveFloat,
"collision damage multiplier");
addFieldV("impactMul", TypeRangedF32, Offset(mImpactMul, ShapeBaseData), &CommonValidators::PositiveFloat,
"impact damage multiplier");
endGroup( "Damage/Energy" );
addGroup( "Camera", "The settings used by the shape when it is the camera." );