mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-17 13:43:48 +00:00
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:
parent
a996c09b04
commit
5cf54580e6
27 changed files with 1552 additions and 0 deletions
|
|
@ -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." );
|
||||
|
|
|
|||
|
|
@ -579,6 +579,8 @@ public:
|
|||
F32 density;
|
||||
F32 maxEnergy;
|
||||
F32 maxDamage;
|
||||
F32 mCollisionMul;
|
||||
F32 mImpactMul;
|
||||
F32 repairRate; ///< Rate per tick.
|
||||
|
||||
F32 disabledLevel;
|
||||
|
|
|
|||
|
|
@ -726,6 +726,8 @@ void Vehicle::updateMove(const Move* move)
|
|||
if (mDamageState == Enabled) {
|
||||
setImageTriggerState(0,move->trigger[0]);
|
||||
setImageTriggerState(1,move->trigger[1]);
|
||||
setImageTriggerState(2, move->trigger[4]);
|
||||
setImageTriggerState(3, move->trigger[5]);
|
||||
}
|
||||
|
||||
// Throttle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue