Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2005, 12:09:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Element2D added → will be moved to lib/graphics afterwards
ProtoClass update
EventListeners do not have to be unsubscribed externally, but still one listener won't unsubscribe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/proto/proto_world_entity.cc

    r4483 r4838  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2222using namespace std;
    2323
    24 /**
    25    \brief standard constructor
    26 
    27 */
    28 ProtoWorldEntity::ProtoWorldEntity ()
    29 {
    30   this->init();
    31 }
    3224
    3325/**
    34    \brief constructs and loads a ProtoWorldEntity from a XML-element
    35    \param root the XML-element to load from
    36 */
     26 * constructs and loads a ProtoWorldEntity from a XML-element
     27 * @param root the XML-element to load from
     28 */
    3729ProtoWorldEntity::ProtoWorldEntity(const TiXmlElement* root)
    3830{
    3931  this->init();
    40   this->loadParams(root);
     32  if (root != NULL)
     33    this->loadParams(root);
    4134}
    4235
    4336
    4437/**
    45    \brief standard deconstructor
    46 */
    47 ProtoWorldEntity::~ProtoWorldEntity () 
     38 * standard deconstructor
     39 */
     40ProtoWorldEntity::~ProtoWorldEntity ()
    4841{
    4942
     
    5144
    5245/**
    53    \brief initializes the ProtoWorldEntity
    54 */
     46 * initializes the ProtoWorldEntity
     47 * @todo change this to what you wish
     48 */
    5549void ProtoWorldEntity::init(void)
    5650{
     51  this->setClassID(CL_PROTO_WORLD_ENTITY, )
    5752  ...
    5853}
    5954
    6055/**
    61    \brief loads a ProtoWorldEntity from a XML-element
    62    \param root the XML-element to load from
    63 */
     56 * loads a ProtoWorldEntity from a XML-element
     57 * @param root the XML-element to load from
     58 * @todo make the class Loadable
     59 */
    6460void ProtoWorldEntity::loadParams(const TiXmlElement* root)
    6561{
     62  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
    6663  static_cast<WorldEntity*>(this)->loadParam(root);
    6764
     
    7168
    7269/**
    73    \brief advances the ProtoWorldEntity about time seconds
    74    \param time the Time to step
    75 */
     70 * advances the ProtoWorldEntity about time seconds
     71 * @param time the Time to step
     72 */
    7673ProtoWorldEntity::tick(float time)
    7774{
     
    8077
    8178/**
    82    \brief draws this worldEntity
    83 */
     79 * draws this worldEntity
     80 */
    8481void ProtoWorldEntity::draw ()
    85 { 
     82{
    8683  glMatrixMode(GL_MODELVIEW);
    8784  glPushMatrix();
    8885  float matrix[4][4];
    89  
     86
    9087  /* translate */
    91   glTranslatef (this->getAbsCoor ().x, 
    92                 this->getAbsCoor ().y,
    93                 this->getAbsCoor ().z);
     88  glTranslatef (this->getAbsCoor ().x,
     89                this->getAbsCoor ().y,
     90                this->getAbsCoor ().z);
    9491  /* rotate */
    9592  this->getAbsDir().matrix(matrix);
Note: See TracChangeset for help on using the changeset viewer.