Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2014, 9:01:44 PM (11 years ago)
Author:
noep
Message:

Modified collision-detecting-process, such that collisions can be traced back to single child-CollisionShapes of Compound-CollisionShapes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/src/orxonox/worldentities/MovableEntity.cc

    r9667 r9995  
    8787    }
    8888
     89    bool MovableEntity::customCollidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
     90    {
     91        if (GameMode::isMaster() && enableCollisionDamage_)
     92        {
     93            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
     94            if (victim)
     95            {
     96                float damage = this->collisionDamage_ * (victim->getVelocity() - this->getVelocity()).length();
     97                victim->customHit(0, contactPoint, ownCollisionShape, damage);
     98            }
     99        }
     100
     101        return false;
     102    }
     103
    89104
    90105    void MovableEntity::registerVariables()
Note: See TracChangeset for help on using the changeset viewer.