mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Now projectiles wont explode before they have been armed. Results in projectiles being able to collide with several objects before exploding.
This commit is contained in:
parent
66775714ef
commit
9bdeabf22c
1 changed files with 196 additions and 203 deletions
|
|
@ -1106,9 +1106,6 @@ void Projectile::simulate( F32 dt )
|
||||||
if ( isServerObject() && ( rInfo.object->getTypeMask() & csmStaticCollisionMask ) == 0 )
|
if ( isServerObject() && ( rInfo.object->getTypeMask() & csmStaticCollisionMask ) == 0 )
|
||||||
setMaskBits( BounceMask );
|
setMaskBits( BounceMask );
|
||||||
|
|
||||||
// Next order of business: do we explode on this hit?
|
|
||||||
if ( mCurrTick > mDataBlock->armingDelay || mDataBlock->armingDelay == 0 )
|
|
||||||
{
|
|
||||||
MatrixF xform( true );
|
MatrixF xform( true );
|
||||||
xform.setColumn( 3, rInfo.point );
|
xform.setColumn( 3, rInfo.point );
|
||||||
setTransform( xform );
|
setTransform( xform );
|
||||||
|
|
@ -1142,13 +1139,10 @@ void Projectile::simulate( F32 dt )
|
||||||
// onCollision will remain uncalled on the client however, therefore no client
|
// onCollision will remain uncalled on the client however, therefore no client
|
||||||
// specific code should be placed inside the function!
|
// specific code should be placed inside the function!
|
||||||
onCollision( rInfo.point, rInfo.normal, rInfo.object );
|
onCollision( rInfo.point, rInfo.normal, rInfo.object );
|
||||||
|
// Next order of business: do we explode on this hit?
|
||||||
|
if ( mCurrTick > mDataBlock->armingDelay || mDataBlock->armingDelay == 0 )
|
||||||
explode( rInfo.point, rInfo.normal, objectType );
|
explode( rInfo.point, rInfo.normal, objectType );
|
||||||
|
|
||||||
// break out of the collision check, since we've exploded
|
|
||||||
// we don't want to mess with the position and velocity
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( mDataBlock->isBallistic )
|
if ( mDataBlock->isBallistic )
|
||||||
{
|
{
|
||||||
// Otherwise, this represents a bounce. First, reflect our velocity
|
// Otherwise, this represents a bounce. First, reflect our velocity
|
||||||
|
|
@ -1169,7 +1163,6 @@ void Projectile::simulate( F32 dt )
|
||||||
newPosition = oldPosition = rInfo.point + rInfo.normal * 0.05f;
|
newPosition = oldPosition = rInfo.point + rInfo.normal * 0.05f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// re-enable the collision response on the source object now
|
// re-enable the collision response on the source object now
|
||||||
// that we are done processing the ballistic movement
|
// that we are done processing the ballistic movement
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue