Browse Source

move reference point for camShake to player's bounding box center

Duion 9 years ago
parent
commit
5d52864c9f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Engine/source/T3D/fx/explosion.cpp

+ 1 - 1
Engine/source/T3D/fx/explosion.cpp

@@ -897,7 +897,7 @@ bool Explosion::onAdd()
 
 
       if( applyShake && obj )
       if( applyShake && obj )
       {
       {
-         VectorF diff = obj->getPosition() - getPosition();
+         VectorF diff = obj->getWorldBox().getCenter() - getPosition(); //changed to use player's center instead of origin, it is more accurate
          F32 dist = diff.len();
          F32 dist = diff.len();
          if( dist < mDataBlock->camShakeRadius )
          if( dist < mDataBlock->camShakeRadius )
          {
          {