Changeset 3374 in orxonox.OLD for orxonox/branches/trackManager/src
- Timestamp:
- Jan 8, 2005, 12:04:19 PM (20 years ago)
- Location:
- orxonox/branches/trackManager/src
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/trackManager/src/Makefile.am
r3369 r3374 18 18 ini_parser.cc \ 19 19 keynames.cc \ 20 track.cc \21 20 base_entity.cc \ 22 21 game_loader.cc \ … … 51 50 error.h \ 52 51 player.h \ 53 track.h \54 52 camera.h \ 55 53 ini_parser.h \ -
orxonox/branches/trackManager/src/Makefile.in
r3369 r3374 57 57 world_entity.$(OBJEXT) vector.$(OBJEXT) camera.$(OBJEXT) \ 58 58 command_node.$(OBJEXT) ini_parser.$(OBJEXT) keynames.$(OBJEXT) \ 59 track.$(OBJEXT) base_entity.$(OBJEXT) game_loader.$(OBJEXT) \60 campaign.$(OBJEXT) story_entity.$(OBJEXT) \61 environment.$(OBJEXT) model.$(OBJEXT) array.$(OBJEXT) \62 material.$(OBJEXT) texture.$(OBJEXT) list.$(OBJEXT) \63 p_node.$(OBJEXT) null_parent.$(OBJEXT) base_object.$(OBJEXT) \64 helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \65 matrix.$(OBJEXT) curve.$(OBJEXT)glmenu_imagescreen.$(OBJEXT)59 base_entity.$(OBJEXT) game_loader.$(OBJEXT) campaign.$(OBJEXT) \ 60 story_entity.$(OBJEXT) environment.$(OBJEXT) model.$(OBJEXT) \ 61 array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \ 62 list.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \ 63 base_object.$(OBJEXT) helper_parent.$(OBJEXT) \ 64 track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \ 65 glmenu_imagescreen.$(OBJEXT) 66 66 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 67 67 orxonox_LDADD = $(LDADD) … … 85 85 @AMDEP_TRUE@ ./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \ 86 86 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \ 87 @AMDEP_TRUE@ ./$(DEPDIR)/track.Po ./$(DEPDIR)/track_manager.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \ 89 @AMDEP_TRUE@ ./$(DEPDIR)/world_entity.Po 87 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \ 88 @AMDEP_TRUE@ ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po 90 89 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 91 90 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 216 215 ini_parser.cc \ 217 216 keynames.cc \ 218 track.cc \219 217 base_entity.cc \ 220 218 game_loader.cc \ … … 248 246 error.h \ 249 247 player.h \ 250 track.h \251 248 camera.h \ 252 249 ini_parser.h \ … … 377 374 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@ 378 375 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 379 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track.Po@am__quote@380 376 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@ 381 377 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ -
orxonox/branches/trackManager/src/curve.cc
r3369 r3374 142 142 143 143 // rebuilding the Derivation curve 144 if(this->derivation == 0)144 if(this->derivation <= 1) 145 145 { 146 146 tmpNode = firstNode; … … 202 202 } 203 203 204 Vector BezierCurve::calcAcc (float t) 205 { 206 return dirCurve->dirCurve->calcPos(t); 207 } 208 204 209 /** 205 210 \brief Calculates the Quaternion needed for our rotations … … 374 379 } 375 380 381 Vector UPointCurve::calcAcc (float t) 382 { 383 } 384 376 385 /** 377 386 \brief Calculates the Quaternion needed for our rotations -
orxonox/branches/trackManager/src/curve.h
r3369 r3374 23 23 Vector curvePoint; //!< The point on the Cureve at a local Time. 24 24 float localTime; //!< If the time of one point is asked more than once the programm will not calculate it again. 25 Curve* dirCurve; //!< The derivation-curve of this Curve.26 25 int derivation; //!< Which derivation of a Curve is this. 27 26 … … 42 41 virtual void rebuild(void) = 0; 43 42 public: 43 Curve* dirCurve; //!< The derivation-curve of this Curve. 44 44 void addNode(const Vector& newNode); 45 45 Vector getNode(unsigned int nodeToFind); … … 48 48 virtual Vector calcPos(float t) = 0; 49 49 virtual Vector calcDir(float t) = 0; 50 virtual Vector calcAcc(float t) = 0; 50 51 virtual Quaternion calcQuat(float t) = 0; 51 52 … … 69 70 Vector calcPos(float t); 70 71 Vector calcDir(float t); 72 Vector calcAcc(float t); 71 73 Quaternion calcQuat(float t); 72 74 … … 105 107 Vector calcPos(float t); 106 108 Vector calcDir(float t); 109 Vector calcAcc(float t); 107 110 Quaternion calcQuat(float t); 108 111 -
orxonox/branches/trackManager/src/environment.cc
r3372 r3374 29 29 Environment::Environment () : WorldEntity() 30 30 { 31 this->model = new Model(" reaplow.obj");31 this->model = new Model("fighter.obj", .3); 32 32 } 33 33 -
orxonox/branches/trackManager/src/game_loader.cc
r3225 r3374 25 25 #include "command_node.h" 26 26 #include "vector.h" 27 #include "track.h"28 27 29 28 #include <string.h> -
orxonox/branches/trackManager/src/track_manager.cc
r3373 r3374 466 466 { 467 467 Vector tmp = this->calcPos(); 468 Quaternion quat = Quaternion(this->calcDir(), Vector(0,1, 0));468 Quaternion quat = Quaternion(this->calcDir(), Vector(0,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z)); 469 469 this->bindSlave->setAbsCoor(&tmp); 470 470 this->bindSlave->setAbsDir(&quat); -
orxonox/branches/trackManager/src/world.cc
r3373 r3374 19 19 #include "collision.h" 20 20 #include "track_manager.h" 21 #include "track.h"22 21 #include "player.h" 23 22 #include "command_node.h" … … 250 249 this->nullParent->setName ("NullParent"); 251 250 252 // create some path nodes253 this->pathnodes = new Vector[6];254 this->pathnodes[0] = Vector(0, 0, 0);255 this->pathnodes[1] = Vector(1000, 0, 0);256 // this->pathnodes[2] = Vector(-100, 140, 0);257 // this->pathnodes[3] = Vector(0, 180, 0);258 // this->pathnodes[4] = Vector(100, 140, 0);259 // this->pathnodes[5] = Vector(100, 40, 0);260 261 // create the tracks262 this->tracklen = 2;263 this->track = new Track[2];264 for( int i = 0; i < this->tracklen; i++)265 {266 this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);267 }268 251 // !\todo old track-system has to be removed 269 252 … … 323 306 324 307 325 326 // create the tracks327 this->tracklen = 6;328 this->track = new Track[6];329 for( int i = 0; i < this->tracklen; i++)330 {331 this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);332 }333 308 334 309 // create a player … … 522 497 } 523 498 */ 524 //draw track525 glBegin(GL_LINES);526 glColor3f(0.0, 1.0, 1.0);527 for( int i = 0; i < tracklen; i++)528 {529 glVertex3f(pathnodes[i].x,pathnodes[i].y,pathnodes[i].z);530 glVertex3f(pathnodes[(i+1)%tracklen].x,pathnodes[(i+1)%tracklen].y,pathnodes[(i+1)%tracklen].z);531 }532 glEnd();533 534 499 /* 535 500 glBegin(GL_LINE_STRIP); … … 710 675 void World::unload() 711 676 { 712 if( pathnodes) delete []pathnodes; 713 if( track) delete []pathnodes; 714 } 715 716 717 void World::setTrackLen(Uint32 len) 718 { 719 this->tracklen = len; 720 } 721 722 int World::getTrackLen() 723 { 724 return this->tracklen; 725 } 726 677 678 } 727 679 728 680 -
orxonox/branches/trackManager/src/world.h
r3369 r3374 12 12 13 13 class TrackManager; 14 class Track;15 14 class WorldEntity; 16 15 class Camera; … … 48 47 virtual void releaseLoadScreen(); 49 48 50 void setTrackLen (Uint32 tracklen);51 int getTrackLen ();52 49 //bool system_command (Command* cmd); 53 50 Camera* getCamera (); … … 60 57 // base level data 61 58 TrackManager* trackManager; 62 Track* track;63 Uint32 tracklen; // number of Tracks the World consist of64 59 Vector* pathnodes; 65 60 Camera* localCamera;
Note: See TracChangeset
for help on using the changeset viewer.