Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 23, 2009, 7:28:48 PM (15 years ago)
Author:
rgrieder
Message:

Add a new core-feature: orxonox_cast<T>()
The functions casts objects like dynamic_cast, but uses the identifier instead for MSVC (much faster) and is just a redirection to dynamic_cast for GCC.
Also replaced almost all dynamic_casts (of course only those related to the class hierarchy).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/objects/collisionshapes/CollisionShape.cc

    r3196 r3223  
    8585        // Parent can either be a WorldEntity or a CompoundCollisionShape. The reason is that the
    8686        // internal collision shape (which is compound) of a WE doesn't get synchronised.
    87         CompoundCollisionShape* parentCCS = dynamic_cast<CompoundCollisionShape*>(parent);
     87        CompoundCollisionShape* parentCCS = orxonox_cast<CompoundCollisionShape>(parent);
    8888        if (parentCCS)
    8989            parentCCS->attach(this);
    9090        else
    9191        {
    92             WorldEntity* parentWE = dynamic_cast<WorldEntity*>(parent);
     92            WorldEntity* parentWE = orxonox_cast<WorldEntity>(parent);
    9393            if (parentWE)
    9494                parentWE->attachCollisionShape(this);
     
    103103        this->parent_ = newParent;
    104104
    105         WorldEntityCollisionShape* parentWECCS = dynamic_cast<WorldEntityCollisionShape*>(newParent);
     105        WorldEntityCollisionShape* parentWECCS = orxonox_cast<WorldEntityCollisionShape>(newParent);
    106106        if (parentWECCS)
    107107            this->parentID_ = parentWECCS->getWorldEntityOwner()->getObjectID();
Note: See TracChangeset for help on using the changeset viewer.