navi homePPSaboutscreenshotsdownloaddevelopmentforum


This is an archived page!
This page is very old and the content is not up to date.
Not everything (if any) which is written here will be in the final game!

The BaseObject is the top-most SuperClass of (most but not) all Classes in orxonox.

Derived From:

  • nothing


BaseObject is a container for

  • The Name of the Object (how the object is called)
  • The Class' Name of the Object (in what class this object is)
  • The ClassID of the Object (what is the Identity of the class (see ClassID)


  • Registration:
    Each class, that extends BaseObject must implement the following function:
    1. In the Class-Declaration use the following syntax (taken your class is named OrxClass)
        class OrxClass : public !BaseObject // here you could also specify any class derived from !BaseObject
          /// ... rest of the Declaration;
    2. At the top of the cc-file of the Class (in the definiton) write:
    3. In the constructor of each class implementing BaseObject write the following:
      this->registerObject(this, OrxClass::_objectList);
    4. you can then set a Name to the Object using
      this->setName("the name");
  • isA:
    isA is a function, that queries, if the Object is of a Specified type. e.g. given a class Player that is derived from BaseObject and PNode one can do the following check :
     Player* player = new Player();
     if (player->isA(PNode::staticClassID()) {
       /* do something terrible with it */ }

Advanced Topics

An interessting Function, that BaseObject provides is the ObjectList. With it, one can retrieve lists of any one kind of derived classes from BaseObject.

Last modified 3 years ago Last modified on Apr 15, 2017, 3:30:00 PM