Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2008, 2:06:41 AM (16 years ago)
Author:
landauf
Message:

added support for isVisible() and isActive() to all objects.
those functions are provided by BaseObject, combined with virtual functions changedVisibility and changedActivity respectively.
use them, to make orxonox scriptable, say: to change the state of objects with 2 simple functions instead of changing all meshes and emitters and billboards of an object. don't forget to pass calls to changedVisibility and changedActivity to the parent class.

additionally there is a new function, isInitialized(), provided by BaseObject too. this returns true if the constructor of BaseObject passed the object registration. this allows you, to check whether an object was properly initialized or if the constructor returned (as this is the case while creating the class hierarchy). use isInitialized() in your destructor before deleting something.

Location:
code/trunk/src/orxonox/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/tools/BillboardSet.h

    r1505 r1558  
    3333
    3434#include <string>
     35#include <OgreBillboardSet.h>
    3536
    36 #include <OgreBillboardSet.h>
    3737#include "util/Math.h"
    3838
     
    5252                { return this->billboardSet_->getName(); }
    5353
     54            inline void setVisible(bool visible)
     55                { this->billboardSet_->setVisible(visible); }
     56            inline bool getVisible() const
     57                { return this->billboardSet_->getVisible(); }
     58
    5459        private:
    5560            static unsigned int billboardSetCounter_s;
  • code/trunk/src/orxonox/tools/Mesh.h

    r1505 r1558  
    5151                { return this->entity_->getName(); }
    5252
     53            inline void setVisible(bool visible)
     54                { this->entity_->setVisible(visible); }
     55            inline bool getVisible() const
     56                { return this->entity_->getVisible(); }
     57
    5358        private:
    5459            static unsigned int meshCounter_s;
Note: See TracChangeset for help on using the changeset viewer.