Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 20, 2014, 3:46:06 PM (10 years ago)
Author:
noep
Message:

A Pawn being hit now prints it's Collisionshape-Structure, as well as the WorldEntity every on of those CollisionShapes belongs to.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r9997 r10003  
    3939#include "core/XMLPort.h"
    4040#include "tools/BulletConversions.h"
     41
     42#include "collisionshapes/WorldEntityCollisionShape.h"
    4143
    4244namespace orxonox
     
    118120            this->updatePublicShape();
    119121        }
     122
     123        // If the shape to be attached is not a CompoundCollisionShape (thus an actual physical shape) & this is a WorldEntity's CollisionShape,
     124        // set it's userPointer to the WorldEntity this CompoundCollisionShape belongs to.
     125        if (!orxonox_cast<CompoundCollisionShape*>(shape) && orxonox_cast<WorldEntityCollisionShape*>(this))
     126            shape->getCollisionShape()->setUserPointer(orxonox_cast<WorldEntityCollisionShape*>(this)->getWorldEntityOwner());
    120127    }
    121128
Note: See TracChangeset for help on using the changeset viewer.