Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4519 in orxonox.OLD for orxonox/trunk/src/lib/physics


Ignore:
Timestamp:
Jun 6, 2005, 2:36:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: changed all getInstances into inline functions to save some (minor) time

Location:
orxonox/trunk/src/lib/physics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/physics/physics_engine.cc

    r4396 r4519  
    4141*/
    4242PhysicsEngine* PhysicsEngine::singletonRef = NULL;
    43 
    44 /**
    45    \returns a Pointer to this Class
    46 */
    47 PhysicsEngine* PhysicsEngine::getInstance(void)
    48 {
    49   if (!PhysicsEngine::singletonRef)
    50     PhysicsEngine::singletonRef = new PhysicsEngine();
    51   return PhysicsEngine::singletonRef;
    52 }
    5343
    5444/**
  • orxonox/trunk/src/lib/physics/physics_engine.h

    r4394 r4519  
    2222
    2323 public:
    24   static PhysicsEngine* getInstance(void);
    2524  virtual ~PhysicsEngine(void);
     25  /** \returns a Pointer to the only object of this Class */
     26  inline static PhysicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new PhysicsEngine();  return singletonRef; };
    2627
    2728  void addPhysicsInterface(PhysicsInterface* physicsInterface);
Note: See TracChangeset for help on using the changeset viewer.