Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2822 in orxonox.OLD for orxonox/trunk/src/world_entity.cc


Ignore:
Timestamp:
Nov 12, 2004, 1:33:25 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk/src: changed list to template again, will add an iterator soon. fixed a graphics bug, that was realy painful to track.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entity.cc

    r2190 r2822  
    3636WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
    3737{
    38         collisioncluster = NULL;
    39         owner = NULL;
     38  this->bDraw = true;
     39  collisioncluster = NULL;
     40  owner = NULL;
    4041}
    4142
     
    4546WorldEntity::~WorldEntity ()
    4647{
    47         if( collisioncluster != NULL) delete collisioncluster;
     48  if( collisioncluster != NULL) delete collisioncluster;
    4849}
    4950
    5051/**
    51         \brief get the Location of the WorldEntity
    52         \return a pointer to location
     52   \brief get the Location of the WorldEntity
     53   \return a pointer to location
    5354*/
    5455Location* WorldEntity::get_location ()
    5556{
    56         return &loc;
     57  return &loc;
    5758}
    5859
    5960/**
    60         \brief get the Placement of the WorldEntity
    61         \return a pointer to placement
     61   \brief get the Placement of the WorldEntity
     62   \return a pointer to placement
    6263*/
    6364Placement* WorldEntity::get_placement ()
    6465{
    65         return &place;
     66  return &place;
    6667}
    6768
    6869/**
    69         \brief query whether the WorldEntity in question is free
    70         \return true if the WorldEntity is free or false if it isn't
     70   \brief query whether the WorldEntity in question is free
     71   \return true if the WorldEntity is free or false if it isn't
    7172*/
    7273bool WorldEntity::isFree ()
     
    7677
    7778/**
    78         \brief set the WorldEntity's collision hull
    79         \param newhull: a pointer to a completely assembled CollisionCluster
    80        
    81         Any previously assigned collision hull will be deleted on reassignment
     79   \brief set the WorldEntity's collision hull
     80   \param newhull: a pointer to a completely assembled CollisionCluster
     81   
     82   Any previously assigned collision hull will be deleted on reassignment
    8283*/
    8384void WorldEntity::set_collision (CollisionCluster* newhull)
    8485{
    85         if( newhull == NULL) return;
    86         if( collisioncluster != NULL) delete collisioncluster;
    87         collisioncluster = newhull;
     86  if( newhull == NULL) return;
     87  if( collisioncluster != NULL) delete collisioncluster;
     88  collisioncluster = newhull;
    8889}
    8990
    9091/**
    91         \brief this method is called every frame
    92         \param time: the time in seconds that has passed since the last tick
    93        
    94         Handle all stuff that should update with time inside this method (movement, animation, etc.)
     92   \brief this method is called every frame
     93   \param time: the time in seconds that has passed since the last tick
     94   
     95   Handle all stuff that should update with time inside this method (movement, animation, etc.)
    9596*/
    9697void WorldEntity::tick(float time)
     
    100101/**
    101102   \brief the entity is drawn onto the screen with this function
    102 
     103   
    103104   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
    104105*/
     
    108109
    109110/**
    110         \brief this function is called, when two entities collide
    111         \param other: the world entity with whom it collides
    112         \param ownhitflags: flags to the CollisionCluster subsections that registered an impact
    113         \param otherhitflags: flags to the CollisionCluster subsections of the other entity that registered an impact
     111   \brief this function is called, when two entities collide
     112   \param other: the world entity with whom it collides
     113   \param ownhitflags: flags to the CollisionCluster subsections that registered an impact
     114   \param otherhitflags: flags to the CollisionCluster subsections of the other entity that registered an impact
    114115
    115         Implement behaviour like damage application or other miscellaneous collision stuff in this function
     116   Implement behaviour like damage application or other miscellaneous collision stuff in this function
    116117*/
    117118void WorldEntity::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {}
     
    135136
    136137/**
    137         \brief basic initialisation for bound Entities
     138   \brief basic initialisation for bound Entities
    138139*/
    139140void WorldEntity::init( Location* spawnloc, WorldEntity* spawnowner)
    140141{
    141         loc = *spawnloc;
    142         owner = spawnowner;
     142  loc = *spawnloc;
     143  owner = spawnowner;
    143144}
    144145
    145146/**
    146         \brief basic initialisation for free Entities
     147   \brief basic initialisation for free Entities
    147148*/
    148149void WorldEntity::init( Placement* spawnplc, WorldEntity* spawnowner)
    149150{
    150         place = *spawnplc;
    151         owner = spawnowner;
     151  place = *spawnplc;
     152  owner = spawnowner;
    152153}
    153154
    154155/**
    155         \brief this is called immediately after the Entity has been constructed and initialized
    156        
    157         Put any initialisation code that requires knowledge of location (placement if the Entity is free) and owner of the entity here.
    158         DO NOT place such code in the constructor, those variables are set AFTER the entity is constucted.
     156   \brief this is called immediately after the Entity has been constructed and initialized
     157   
     158   Put any initialisation code that requires knowledge of location (placement if the Entity is free) and owner of the entity here.
     159   DO NOT place such code in the constructor, those variables are set AFTER the entity is constucted.
    159160*/
    160161void WorldEntity::post_spawn ()
     
    163164
    164165/**
    165         \brief this handles incoming command messages
    166         \param cmd: a pointer to the incoming Command structure
    167        
    168         Put all code that handles Command messages here, this will mainly be called by the assigned CommandNode but can also be used
    169         to send commands from one WorldEntity to another.
     166   \brief this handles incoming command messages
     167   \param cmd: a pointer to the incoming Command structure
     168   
     169   Put all code that handles Command messages here, this will mainly be called by the assigned CommandNode but can also be used
     170   to send commands from one WorldEntity to another.
    170171*/
    171172void WorldEntity::command (Command* cmd)
     
    174175
    175176/**
    176         \brief this is called by the local Camera to determine the point it should look at on the WorldEntity
    177         \param locbuf: a pointer to the buffer to fill with a location to look at
     177   \brief this is called by the local Camera to determine the point it should look at on the WorldEntity
     178   \param locbuf: a pointer to the buffer to fill with a location to look at
    178179       
    179         You may put any Location you want into locbuf, the Camera will determine via the corresponding Track how
    180         to look at the location you return with this.
     180   You may put any Location you want into locbuf, the Camera will determine via the corresponding Track how
     181   to look at the location you return with this.
    181182*/
    182183void WorldEntity::get_lookat (Location* locbuf)
     
    185186
    186187/**
    187         \brief this method is called by the world if the WorldEntity leaves valid gamespace
    188        
    189         For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
    190         place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
     188   \brief this method is called by the world if the WorldEntity leaves valid gamespace
     189   
     190   For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
     191   place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
    191192*/
    192193void WorldEntity::left_world ()
Note: See TracChangeset for help on using the changeset viewer.