- Timestamp:
- Mar 20, 2005, 10:38:59 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3603 r3607 112 112 lib/util/ini_parser.h \ 113 113 lib/math/vector.h \ 114 lib/math/vector_new.h \ 115 lib/math/quaternion.h \ 114 116 lib/math/curve.h \ 115 117 glmenu/glmenu_imagescreen.h -
orxonox/trunk/src/Makefile.in
r3603 r3607 313 313 lib/util/ini_parser.h \ 314 314 lib/math/vector.h \ 315 lib/math/vector_new.h \ 316 lib/math/quaternion.h \ 315 317 lib/math/curve.h \ 316 318 glmenu/glmenu_imagescreen.h -
orxonox/trunk/src/camera.cc
r3566 r3607 240 240 241 241 // ===== 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, 244 245 this->parent->getAbsCoor ().x, this->parent->getAbsCoor ().y, this->parent->getAbsCoor ().z, 245 246 0.0, 1.0, 0.0); -
orxonox/trunk/src/defs/stdincl.h
r3495 r3607 11 11 #define null 0 //!< null 12 12 13 13 14 typedef unsigned char byte; 14 15 … … 22 23 #endif 23 24 25 #include <stddef.h> 24 26 #include <stdlib.h> 25 27 #include <string.h> -
orxonox/trunk/src/lib/coord/helper_parent.h
r3544 r3607 8 8 #define _HELPER_PARENT_H 9 9 10 #include "stdincl.h" 10 11 11 #include "p_node.h" 12 12 -
orxonox/trunk/src/lib/coord/null_parent.cc
r3591 r3607 19 19 20 20 #include "null_parent.h" 21 #include "stdincl.h" 21 22 22 23 … … 51 52 this->parent = this; 52 53 this->mode = PNODE_ALL; 53 this->absCoordinate = *absCoordinate;54 *this->absCoordinate = *absCoordinate; 54 55 this->setName("NullParent"); 55 56 } … … 77 78 { 78 79 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; 82 83 83 84 PNode* pn = this->children->enumerate (); -
orxonox/trunk/src/lib/coord/null_parent.h
r3552 r3607 8 8 #define _NULL_PARENT_H 9 9 10 #include "stdincl.h" 10 11 11 #include "p_node.h" 12 12 -
orxonox/trunk/src/lib/coord/p_node.cc
r3591 r3607 21 21 22 22 #include "p_node.h" 23 #include "stdincl.h" 23 24 24 25 #include "null_parent.h" 25 #include "vector.h" 26 //#include "vector.h" 27 //#include "quaternion.h" 26 28 27 29 using namespace std; … … 51 53 this->init(parent); 52 54 53 this->absCoordinate = *absCoordinate;55 *this->absCoordinate = *absCoordinate; 54 56 if (parent != NULL) 55 57 { 56 this->relCoordinate =this->absCoordinate - parent->getAbsCoor ();58 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor (); 57 59 parent->addChild (this); 58 60 } 59 61 else 60 this->relCoordinate = Vector(0,0,0);62 this->relCoordinate = new Vector(0,0,0); 61 63 } 62 64 … … 92 94 } 93 95 96 94 97 void PNode::init(PNode* parent) 95 98 { … … 101 104 this->parent = parent; 102 105 this->objectName = NULL; 106 107 this->absCoordinate = new Vector(); 108 this->relCoordinate = new Vector(); 109 this->absDirection = new Quaternion(); 110 this->relDirection = new Quaternion(); 103 111 } 104 112 … … 130 138 Vector PNode::getRelCoor () 131 139 { 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 */ 133 141 return r; 134 142 } … … 146 154 { 147 155 this->bRelCoorChanged = true; 148 this->relCoordinate = *relCoord;156 *this->relCoordinate = *relCoord; 149 157 } 150 158 … … 156 164 Vector PNode::getAbsCoor () 157 165 { 158 return this->absCoordinate;166 return *this->absCoordinate; 159 167 } 160 168 … … 170 178 { 171 179 this->bAbsCoorChanged = true; 172 this->absCoordinate = *absCoord;180 *this->absCoordinate = *absCoord; 173 181 } 174 182 … … 198 206 if( this->bAbsCoorChanged) 199 207 { 200 this->absCoordinate =this->absCoordinate + *shift;208 *this->absCoordinate = *this->absCoordinate + *shift; 201 209 } 202 210 else 203 211 { 204 this->relCoordinate =this->relCoordinate + *shift;212 *this->relCoordinate = *this->relCoordinate + *shift; 205 213 this->bRelCoorChanged = true; 206 214 } … … 215 223 Quaternion PNode::getRelDir () 216 224 { 217 return this->relDirection;225 return *this->relDirection; 218 226 } 219 227 … … 230 238 { 231 239 this->bRelCoorChanged = true; 232 this->relDirection = *relDir;240 *this->relDirection = *relDir; 233 241 } 234 242 … … 240 248 Quaternion PNode::getAbsDir () 241 249 { 242 return this->absDirection;250 return *this->absDirection; 243 251 } 244 252 … … 255 263 { 256 264 this->bAbsDirChanged = true; 257 this->absDirection = *absDir;265 *this->absDirection = *absDir; 258 266 } 259 267 … … 410 418 void PNode::update () 411 419 { 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); 413 421 // printf("%s", this->objectName); 414 422 if(this->mode & PNODE_MOVEMENT ) … … 417 425 { 418 426 /* 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 (); 420 428 } 421 429 else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/) … … 424 432 if( this->parent == NULL) 425 433 { 426 this->absCoordinate =this->relCoordinate;434 *this->absCoordinate = *this->relCoordinate; 427 435 } 428 436 else 429 this->absCoordinate = parent->getAbsCoor() +this->relCoordinate; /* update the current absCoordinate */437 *this->absCoordinate = parent->getAbsCoor() + *this->relCoordinate; /* update the current absCoordinate */ 430 438 } 431 439 } … … 436 444 { 437 445 /* 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(); 439 447 } 440 448 else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/) 441 449 { 442 450 /* update the current absDirection - remember * means rotation around sth.*/ 443 this->absDirection = parent->getAbsDir() *this->relDirection;451 *this->absDirection = parent->getAbsDir() * *this->relDirection; 444 452 } 445 453 } … … 450 458 { 451 459 /* 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 (); 453 461 } 454 462 else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/) … … 456 464 /*this is bad style... must be deleted later - just for testing*/ 457 465 if( this->parent == NULL) 458 this->absCoordinate =this->relCoordinate;466 *this->absCoordinate = *this->relCoordinate; 459 467 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 */ 461 469 } 462 470 } … … 505 513 { 506 514 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); 510 518 } 511 519 -
orxonox/trunk/src/lib/coord/p_node.h
r3565 r3607 23 23 24 24 #include "base_object.h" 25 #include "vector.h" 25 26 26 27 // FORWARD DEFINITION \\ … … 28 29 class Quaternion; 29 30 class Vector; 31 template<class T> class tList; 30 32 31 33 //! enumeration for the different translation-binding-types … … 102 104 bool bRelDirChanged; //!< If Relative Direction has changed since last time we checked 103 105 104 Vector relCoordinate; //!< coordinates relative to the parent105 Vector absCoordinate; //!< absolute coordinates in the world ( from (0,0,0) )106 Quaternion relDirection; //!< direction relative to the parent107 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) ) 108 110 109 111 int mode; //!< the mode of the binding -
orxonox/trunk/src/lib/lang/base_object.cc
r3552 r3607 18 18 19 19 #include "base_object.h" 20 #include "stdincl.h" 20 21 21 22 -
orxonox/trunk/src/lib/lang/base_object.h
r3544 r3607 8 8 #define _BASE_OBJECT_H 9 9 10 #include "stdincl.h"10 //#include "stdincl.h" 11 11 12 12 -
orxonox/trunk/src/lib/math/vector.cc
r3590 r3607 65 65 float Vector::operator* (const Vector& v) const 66 66 { 67 return x *v.x+y*v.y+z*v.z;67 return x * v.x + y * v.y+ z * v.z; 68 68 } 69 69 -
orxonox/trunk/src/track_node.cc
r3565 r3607 46 46 this->trackManager = TrackManager::getInstance(); 47 47 this->setMode(PNODE_ALL); 48 this->absCoordinate = *absCoordinate;48 this->absCoordinate = absCoordinate; 49 49 } 50 50 -
orxonox/trunk/src/world_entities/primitive.cc
r3590 r3607 20 20 #include "stdincl.h" 21 21 #include "world_entity.h" 22 #include "vector.h"23 22 #include "objModel.h" 24 23 … … 39 38 40 39 this->material = new Material("Sphere"); 41 this->material->setDiffuseMap("../data/pictures/load_screen.jpg");40 //this->material->setDiffuseMap("../data/pictures/load_screen.jpg"); 42 41 this->material->setIllum(3); 43 this->material->setSpecular(1, 1, 1); 42 this->material->setAmbient(1, .5, 1); 43 Vector* v = new Vector(); 44 44 45 } 45 46 … … 74 75 void Primitive::tick (float time) 75 76 { 76 // 77 // 78 // 77 // Vector v(0.0, 0.0, 1.0); 78 // Quaternion q(10.0, v); 79 // this->setRelDir(&(this->relDirection * q)); 79 80 } 80 81 … … 93 94 //glMultMatrixf((float*)matrix); 94 95 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); 96 99 97 100 glPopMatrix(); -
orxonox/trunk/src/world_entities/skysphere.cc
r3590 r3607 100 100 glPushMatrix(); 101 101 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); 105 104 106 105 //glRotatef(-30, 1, 0, 0);
Note: See TracChangeset
for help on using the changeset viewer.