Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3607 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Mar 20, 2005, 10:38:59 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: stdincl was still included everywhere. removed it out of the stdincl.h file to enable the possibility of compile-speedup. added some testclasses for vector/quaternion.

Location:
orxonox/trunk/src
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.am

    r3603 r3607  
    112112                 lib/util/ini_parser.h \
    113113                 lib/math/vector.h \
     114                 lib/math/vector_new.h \
     115                 lib/math/quaternion.h \
    114116                 lib/math/curve.h \
    115117                 glmenu/glmenu_imagescreen.h
  • orxonox/trunk/src/Makefile.in

    r3603 r3607  
    313313                 lib/util/ini_parser.h \
    314314                 lib/math/vector.h \
     315                 lib/math/vector_new.h \
     316                 lib/math/quaternion.h \
    315317                 lib/math/curve.h \
    316318                 glmenu/glmenu_imagescreen.h
  • orxonox/trunk/src/camera.cc

    r3566 r3607  
    240240
    241241  // ===== second camera control calculation option
    242  
    243   gluLookAt(this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z,
     242
     243  Vector r = this->getAbsCoor();
     244  gluLookAt(r.x, r.y, r.z,
    244245            this->parent->getAbsCoor ().x, this->parent->getAbsCoor ().y, this->parent->getAbsCoor ().z,
    245246            0.0, 1.0, 0.0);
  • orxonox/trunk/src/defs/stdincl.h

    r3495 r3607  
    1111#define null 0   //!< null
    1212
     13
    1314typedef unsigned char byte;
    1415
     
    2223#endif
    2324
     25#include <stddef.h>
    2426#include <stdlib.h>
    2527#include <string.h>
  • orxonox/trunk/src/lib/coord/helper_parent.h

    r3544 r3607  
    88#define _HELPER_PARENT_H
    99
    10 #include "stdincl.h"
     10
    1111#include "p_node.h"
    1212
  • orxonox/trunk/src/lib/coord/null_parent.cc

    r3591 r3607  
    1919
    2020#include "null_parent.h"
     21#include "stdincl.h"
    2122
    2223
     
    5152  this->parent = this;
    5253  this->mode = PNODE_ALL;
    53   this->absCoordinate = *absCoordinate;
     54  *this->absCoordinate = *absCoordinate;
    5455  this->setName("NullParent");
    5556}
     
    7778{
    7879
    79   PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    80   this->absCoordinate = this->relCoordinate;
    81   this->absDirection = parent->getAbsDir () * this->relDirection;
     80  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
     81  *this->absCoordinate = *this->relCoordinate;
     82  *this->absDirection = parent->getAbsDir () * *this->relDirection;
    8283 
    8384  PNode* pn = this->children->enumerate ();
  • orxonox/trunk/src/lib/coord/null_parent.h

    r3552 r3607  
    88#define _NULL_PARENT_H
    99
    10 #include "stdincl.h"
     10
    1111#include "p_node.h"
    1212
  • orxonox/trunk/src/lib/coord/p_node.cc

    r3591 r3607  
    2121
    2222#include "p_node.h"
     23#include "stdincl.h"
    2324
    2425#include "null_parent.h"
    25 #include "vector.h"
     26//#include "vector.h"
     27//#include "quaternion.h"
    2628
    2729using namespace std;
     
    5153  this->init(parent);
    5254
    53   this->absCoordinate = *absCoordinate;
     55  *this->absCoordinate = *absCoordinate;
    5456  if (parent != NULL)
    5557    {
    56       this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     58      *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
    5759      parent->addChild (this);
    5860    }
    5961  else
    60     this->relCoordinate = Vector(0,0,0);
     62    this->relCoordinate = new Vector(0,0,0);
    6163}
    6264
     
    9294}
    9395
     96
    9497void PNode::init(PNode* parent)
    9598{
     
    101104  this->parent = parent;
    102105  this->objectName = NULL;
     106
     107  this->absCoordinate = new Vector();
     108  this->relCoordinate = new Vector();
     109  this->absDirection = new Quaternion();
     110  this->relDirection = new Quaternion();
    103111}
    104112
     
    130138Vector PNode::getRelCoor ()
    131139{
    132   Vector r = this->relCoordinate; /* return a copy, so it can't be modified */
     140  Vector r = *this->relCoordinate; /* return a copy, so it can't be modified */
    133141  return r;
    134142}
     
    146154{
    147155  this->bRelCoorChanged = true;
    148   this->relCoordinate = *relCoord;
     156  *this->relCoordinate = *relCoord;
    149157}
    150158
     
    156164Vector PNode::getAbsCoor ()
    157165{
    158   return this->absCoordinate;
     166  return *this->absCoordinate;
    159167}
    160168
     
    170178{
    171179  this->bAbsCoorChanged = true;
    172   this->absCoordinate = *absCoord;
     180  *this->absCoordinate = *absCoord;
    173181}
    174182
     
    198206  if( this->bAbsCoorChanged)
    199207    {
    200       this->absCoordinate = this->absCoordinate + *shift;
     208      *this->absCoordinate = *this->absCoordinate + *shift;
    201209    }
    202210  else
    203211    {
    204       this->relCoordinate = this->relCoordinate + *shift;
     212      *this->relCoordinate = *this->relCoordinate + *shift;
    205213      this->bRelCoorChanged = true;
    206214    }
     
    215223Quaternion PNode::getRelDir ()
    216224{
    217   return this->relDirection;
     225  return *this->relDirection;
    218226}
    219227
     
    230238{
    231239  this->bRelCoorChanged = true;
    232   this->relDirection = *relDir;
     240  *this->relDirection = *relDir;
    233241}
    234242
     
    240248Quaternion PNode::getAbsDir ()
    241249{
    242   return this->absDirection;
     250  return *this->absDirection;
    243251}
    244252
     
    255263{
    256264  this->bAbsDirChanged = true;
    257   this->absDirection = *absDir;
     265  *this->absDirection = *absDir;
    258266}
    259267
     
    410418void PNode::update ()
    411419{
    412   PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     420  PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
    413421  // printf("%s", this->objectName);
    414422  if(this->mode & PNODE_MOVEMENT )
     
    417425        {
    418426          /* if you have set the absolute coordinates this overrides all other changes */
    419           this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     427          *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
    420428        }
    421429      else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     
    424432          if( this->parent == NULL)
    425433            {
    426               this->absCoordinate = this->relCoordinate;
     434              *this->absCoordinate = *this->relCoordinate;
    427435            }
    428436          else
    429             this->absCoordinate = parent->getAbsCoor() + this->relCoordinate;         /* update the current absCoordinate */
     437            *this->absCoordinate = parent->getAbsCoor() + *this->relCoordinate;       /* update the current absCoordinate */
    430438        }
    431439    }
     
    436444        {
    437445          /* if you have set the absolute coordinates this overrides all other changes */
    438           this->relDirection = this->absDirection - parent->getAbsDir();
     446          *this->relDirection = *this->absDirection - parent->getAbsDir();
    439447        }
    440448      else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
    441449        {
    442450          /* update the current absDirection - remember * means rotation around sth.*/
    443           this->absDirection = parent->getAbsDir() * this->relDirection;
     451          *this->absDirection = parent->getAbsDir() * *this->relDirection;
    444452        }
    445453    }
     
    450458        {
    451459          /* if you have set the absolute coordinates this overrides all other changes */
    452           this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
     460          *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
    453461        }
    454462      else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
     
    456464          /*this is bad style... must be deleted later - just for testing*/
    457465          if( this->parent == NULL)
    458             this->absCoordinate = this->relCoordinate;
     466            *this->absCoordinate = *this->relCoordinate;
    459467          else
    460             this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);              /* update the current absCoordinate */
     468            *this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(*this->relCoordinate);            /* update the current absCoordinate */
    461469        }
    462470    }
     
    505513{
    506514  PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n",
    507          this->absCoordinate.x,
    508          this->absCoordinate.y,
    509          this->absCoordinate.z);
     515         this->absCoordinate->x,
     516         this->absCoordinate->y,
     517         this->absCoordinate->z);
    510518}
    511519
  • orxonox/trunk/src/lib/coord/p_node.h

    r3565 r3607  
    2323
    2424#include "base_object.h"
     25#include "vector.h"
    2526
    2627// FORWARD DEFINITION \\
     
    2829class Quaternion;
    2930class Vector;
     31template<class T> class tList;
    3032
    3133//! enumeration for the different translation-binding-types
     
    102104  bool bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
    103105
    104   Vector relCoordinate;    //!< coordinates relative to the parent
    105   Vector absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
    106   Quaternion relDirection; //!< direction relative to the parent
    107   Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
     106  Vector* relCoordinate;    //!< coordinates relative to the parent
     107  Vector* absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
     108  Quaternion* relDirection; //!< direction relative to the parent
     109  Quaternion* absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
    108110
    109111  int mode;                //!< the mode of the binding
  • orxonox/trunk/src/lib/lang/base_object.cc

    r3552 r3607  
    1818
    1919#include "base_object.h"
     20#include "stdincl.h"
    2021
    2122
  • orxonox/trunk/src/lib/lang/base_object.h

    r3544 r3607  
    88#define _BASE_OBJECT_H
    99
    10 #include "stdincl.h"
     10//#include "stdincl.h"
    1111
    1212
  • orxonox/trunk/src/lib/math/vector.cc

    r3590 r3607  
    6565float Vector::operator* (const Vector& v) const
    6666{
    67   return x*v.x+y*v.y+z*v.z;
     67  return x * v.x + y * v.y+ z * v.z;
    6868}
    6969
  • orxonox/trunk/src/track_node.cc

    r3565 r3607  
    4646  this->trackManager = TrackManager::getInstance();
    4747  this->setMode(PNODE_ALL);
    48   this->absCoordinate = *absCoordinate;
     48  this->absCoordinate = absCoordinate;
    4949}
    5050
  • orxonox/trunk/src/world_entities/primitive.cc

    r3590 r3607  
    2020#include "stdincl.h"
    2121#include "world_entity.h"
    22 #include "vector.h"
    2322#include "objModel.h"
    2423
     
    3938
    4039  this->material = new Material("Sphere");
    41   this->material->setDiffuseMap("../data/pictures/load_screen.jpg");
     40  //this->material->setDiffuseMap("../data/pictures/load_screen.jpg");
    4241  this->material->setIllum(3);
    43   this->material->setSpecular(1, 1, 1);
     42  this->material->setAmbient(1, .5, 1);
     43  Vector* v = new Vector();
     44
    4445}
    4546
     
    7475void Primitive::tick (float time)
    7576{
    76   //  Vector v(0.0, 0.0, 1.0);
    77   //  Quaternion q(10.0, v);
    78   //  this->setRelDir(&(this->relDirection * q));
     77  // Vector v(0.0, 0.0, 1.0);
     78  // Quaternion q(10.0, v);
     79  // this->setRelDir(&(this->relDirection * q));
    7980}
    8081
     
    9394  //glMultMatrixf((float*)matrix);
    9495  this->material->select();
    95   gluSphere(this->object, 2, 20, 20);
     96  gluSphere(this->object, 1, 6, 6);
     97  //gluCylinder(this->object, 1, 1, 2, 6, 6);
     98  //gluDisk(this->object, 1, 2, 6, 6);
    9699
    97100  glPopMatrix();
  • orxonox/trunk/src/world_entities/skysphere.cc

    r3590 r3607  
    100100  glPushMatrix();
    101101  glMatrixMode(GL_MODELVIEW);
    102   glTranslatef(this->absCoordinate.x,
    103                this->absCoordinate.y,
    104                this->absCoordinate.z);
     102  Vector r = this->getAbsCoor();
     103  glTranslatef(r.x, r.y, r.z);
    105104
    106105  //glRotatef(-30, 1, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.