Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3449 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Mar 2, 2005, 2:23:47 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: documented orxonox.cc/h world.cc/h vector.cc/h

Location:
orxonox/trunk/src
Files:
8 edited

Legend:

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

    r3436 r3449  
    5656
    5757
    58 /* this is a singleton class to prevent duplicates */
     58/** \brief this is a singleton class to prevent duplicates */
    5959Orxonox* Orxonox::singletonRef = 0;
    6060
     61/**
     62   \returns reference or new Object of Orxonox if not existent.
     63*/
    6164Orxonox* Orxonox::getInstance (void)
    6265{
     
    322325}
    323326
    324 
     327/**
     328   \return The reference of the SDL-screen of orxonox
     329*/
    325330SDL_Surface* Orxonox::getScreen ()
    326331{
     
    328333}
    329334
    330 
     335/**
     336   \brief main function
     337
     338   here the journey begins
     339*/
    331340int main(int argc, char** argv)
    332341
  • orxonox/trunk/src/orxonox.h

    r3365 r3449  
    2626  ~Orxonox ();
    2727 
    28   char configfilename[256];
    29   World* world;
    30   DataTank* resources;
    31   CommandNode* localinput;
    32   Camera* localcamera;
    33   SDL_Surface* screen;
    34   GameLoader* gameLoader;
     28  char configfilename[256];   //!< Filename of the configuration-file.
     29  World* world;               //!< Reference to the current running world.
     30  DataTank* resources;        //!< DataContainer
     31  CommandNode* localinput;    //!< Command Handler
     32  Camera* localcamera;        //!< The current Camera
     33  SDL_Surface* screen;        //!< The current Screen
     34  GameLoader* gameLoader;     //!< The gameLoader
    3535 
    36   bool bQuitOrxonox;
    37   bool pause;
    38   Uint32 lastframe;
     36  bool bQuitOrxonox;          //!< If Orxonox should Quit
     37  bool pause;                 //!< Pause mode
     38  Uint32 lastframe;           //!< Time of the last Frame
    3939 
    4040  void getConfigFile (int argc, char** argv);
  • orxonox/trunk/src/vector.cc

    r3365 r3449  
    151151
    152152/**
    153    \bref returns the voctor normalized to length 1.0
     153   \brief returns the voctor normalized to length 1.0
    154154*/
    155155
     
    170170}
    171171
    172 
     172/**
     173   \brief scales this Vector with Vector v.
     174   \param v the vector to scale this vector with
     175*/
    173176void Vector::scale(const Vector& v)
    174177{
     
    189192
    190193
    191 
     194/**
     195   \brief Vector is looking in the positive direction on all axes after this
     196*/
    192197Vector Vector::abs()
    193198{
     
    473478}
    474479
    475 
     480/**
     481   \brief performs a smooth move.
     482   \param from from where
     483   \param to to where
     484   \param t the time this transformation should take
     485   \param res The approximation-density
     486*/
    476487void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res)
    477488{
     
    802813/**
    803814   \brief create a plane from anchor point and normal
    804    \param n: normal vector
     815   \param norm: normal vector
    805816   \param p: anchor point
    806817*/
  • orxonox/trunk/src/vector.h

    r3365 r3449  
    1010
    1111#include <math.h>
     12//! PI the circle-constant
    1213#define PI 3.14159265359f
    1314
     
    2021  public:
    2122 
    22   float x, y, z;
     23  float x; //!< The x Coordinate of the Vector.
     24  float y; //!< The y Coordinate of the Vector.
     25  float z; //!< The z Coordinate of the Vector.
    2326
    2427  Vector (float x, float y, float z) : x(x), y(y), z(z) {}  //!< assignment constructor
     
    5154 public:
    5255        Vector v;       //!< Imaginary Vector
    53         float w; //!< Real part of the number
     56        float w;        //!< Real part of the number
    5457
    5558        Quaternion ();
     
    7275
    7376 private:
    74         float DELTA;
     77        float DELTA;      //!< resolution of calculation
    7578
    7679};
  • orxonox/trunk/src/world.cc

    r3444 r3449  
    4646}
    4747
     48/**
     49   \brief creates a new World...
     50   \param worldID with this ID
     51*/
    4852World::World (int worldID)
    4953{
     
    96100  {60.0, -10.0, 5.0}, {80.0, 10.0, 5.0}};
    97101
    98 
     102/**
     103   \brief initializes a new World
     104*/
    99105ErrorMessage World::init()
    100106{
     
    114120
    115121
    116 
     122/**
     123   \brief starts the World
     124*/
    117125ErrorMessage World::start()
    118126{
     
    123131}
    124132
     133/**
     134   \brief stops the world.
     135
     136   This happens, when the player decides to end the Level.
     137*/
    125138ErrorMessage World::stop()
    126139{
     
    129142}
    130143
     144/**
     145   \brief pauses the Game
     146*/
    131147ErrorMessage World::pause()
    132148{
     
    134150}
    135151
    136 
     152/**
     153   \brief ends the pause Phase
     154*/
    137155ErrorMessage World::resume()
    138156{
     
    140158}
    141159
    142 
     160/**
     161   \brief destroys the World
     162*/
    143163void World::destroy()
    144164{
     
    146166}
    147167
    148 
     168/**
     169   \brief shows the loading screen
     170*/
    149171void World::displayLoadScreen ()
    150172{
     
    160182}
    161183
    162 
     184/**
     185   \brief removes the loadscreen, and changes over to the game
     186
     187   \todo take out the delay
     188*/
    163189void World::releaseLoadScreen ()
    164190{
     
    169195}
    170196
    171 
     197/**
     198   \brief loads the World by initializing all resources, and set their default values.
     199*/
    172200void World::load()
    173201{
     
    334362            this->nullParent->setName ("NullParent");
    335363
    336             // create some path nodes
    337             this->pathnodes = new Vector[6];
    338             this->pathnodes[0] = Vector(0, 0, 0);
    339             this->pathnodes[1] = Vector(20, 10, 10);
    340             this->pathnodes[2] = Vector(40, 0, 10);
    341             this->pathnodes[3] = Vector(60, 10, 0);
    342             this->pathnodes[4] = Vector(80, 20, 10);
    343             this->pathnodes[5] = Vector(30, 50, 0);
    344            
    345 
    346364
    347365
     
    795813
    796814
    797 /*
     815/**
    798816  \brief main loop of the world: executing all world relevant function
    799817
     
    950968   \brief add and spawn a new entity to this world
    951969   \param entity to be added
    952    \param location where to add
     970   \param absCoor At what coordinates to add this entity.
     971   \param absDir In which direction should it look.
    953972*/
    954973void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
     
    967986
    968987
    969 /*
     988/**
    970989  \brief commands that the world must catch
    971990  \returns false if not used by the world
     
    978997
    979998
    980 
     999/**
     1000   \brief swaps two values
     1001   \todo make this a global function, and take it out of world
     1002*/
    9811003void World::swap (unsigned char &a, unsigned char &b)
    9821004{
  • orxonox/trunk/src/world.h

    r3437 r3449  
    1919class Light;
    2020
    21 //! The game environment
     21//! The game world
     22/**
     23   this class initializes everything that should be displayed inside of the current level.
     24   it is the main driving factor during gameplay.
     25*/
    2226class World : public StoryEntity {
    2327
     
    5559  void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
    5660
    57   tList<WorldEntity>* entities;
     61  tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them.
    5862 
    5963  // base level data
    60   TrackManager* trackManager;
    61   Vector* pathnodes;
    62   Camera* localCamera; 
     64  TrackManager* trackManager;  //!< The reference of the TrackManager that handles the course through the Level.
     65  Camera* localCamera;         //!< The current Camera
    6366
    6467
    65   UPointCurve* testCurve;
    6668 private:
    67   Uint32 lastFrame; //!> last time of frame
    68   bool bQuitOrxonox; //!> quit this application
    69   bool bQuitCurrentGame; //!> quit only the current game and return to menu
    70   bool bPause;
     69  Uint32 lastFrame;             //!< last time of frame
     70  bool bQuitOrxonox;            //!< quit this application
     71  bool bQuitCurrentGame;        //!< quit only the current game and return to menu
     72  bool bPause;                  //!< pause mode
    7173
    72   GLMenuImageScreen* glmis;
     74  GLMenuImageScreen* glmis;     //!< The Level-Loader Display
    7375
    74   char* worldName;
    75   int debugWorldNr;
    76   GLuint objectList;
    77   SDL_Surface *loadImage;
    78   Skysphere* skySphere;
    79   Light* light;
     76  char* worldName;              //!< The name of this World
     77  int debugWorldNr;             //!< The Debug Nr. needed, if something goes wrong
     78  GLuint objectList;            //!< temporary: \todo this will be ereased soon
     79  Skysphere* skySphere;         //!< The Environmental Heaven of orxonox \todo insert this to environment insted
     80  Light* light;                 //!< The Lights of the Level
    8081
    81   WorldEntity* localPlayer;
     82  WorldEntity* localPlayer;     //!< The Player, you fly through the level.
    8283 
    83   PNode* nullParent;
     84  PNode* nullParent;            //!< The zero-point, that everything has as its parent.
    8485 
    8586  void mainLoop ();
  • orxonox/trunk/src/world_entity.cc

    r3365 r3449  
    118118}
    119119
    120 
     120/**
     121   \brief sets the drawable state of this entity.
     122   \param bDraw TRUE if draweable, FALSE otherwise
     123*/
    121124void WorldEntity::setDrawable (bool bDraw)
    122125{
  • orxonox/trunk/src/world_entity.h

    r3396 r3449  
    2222  virtual ~WorldEntity ();
    2323
    24   OBJModel* model;
     24  OBJModel* model;                  //!< The model that should be loaded for this entity.
    2525 
    2626  void setCollision (CollisionCluster* newhull);
     
    4545 
    4646 private:
    47   const bool bFree;     
    48   bool bCollide;
    49   bool bDraw;
     47  const bool bFree;                   //!< If the entity is free.
     48  bool bCollide;                      //!< If it should be considered for the collisiontest.
     49  bool bDraw;                         //!< If it should be visible.
    5050
    51   CollisionCluster* collisioncluster;
     51  CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
    5252};
    5353
Note: See TracChangeset for help on using the changeset viewer.