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/worldentities/triggers/DistanceTrigger.cc

    r3196 r3223  
    120120    for (ClassTreeMaskObjectIterator it = this->targetMask_.begin(); it != this->targetMask_.end(); ++it)
    121121    {
    122       WorldEntity* entity = dynamic_cast<WorldEntity*>(*it);
     122      WorldEntity* entity = orxonox_cast<WorldEntity>(*it);
    123123      if (!entity)
    124124        continue;
     
    131131        if(this->isForPlayer())
    132132        {
    133           Pawn* player = dynamic_cast<Pawn*>(entity);
     133          Pawn* player = orxonox_cast<Pawn>(entity);
    134134          this->setTriggeringPlayer(player);
    135135        }
Note: See TracChangeset for help on using the changeset viewer.