Changeset 3588 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 17, 2005, 2:47:16 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/math/curve.cc
r3473 r3588 28 28 #include <math.h> 29 29 #include <stdio.h> 30 31 32 /** 33 \brief default constructor for a Curve 34 */ 35 Curve::Curve(void) 36 { 37 nodeCount = 0; 38 firstNode = new PathNode; 39 currentNode = firstNode; 40 41 firstNode->position = Vector (.0, .0, .0); 42 firstNode->number = 0; 43 firstNode->next = 0; // not sure if this really points to NULL!! 44 } 30 45 31 46 /** … … 131 146 this->derivation = 0; 132 147 dirCurve = new BezierCurve(1); 133 this->init();134 148 } 135 149 … … 141 155 this->derivation = derivation; 142 156 dirCurve=NULL; 143 this->init();144 157 } 145 158 … … 161 174 if (dirCurve) 162 175 delete dirCurve; 163 }164 165 /**166 \brief Initializes a BezierCurve167 */168 void BezierCurve::init(void)169 {170 nodeCount = 0;171 firstNode = new PathNode;172 currentNode = firstNode;173 174 firstNode->position = Vector (.0, .0, .0);175 firstNode->number = 0;176 firstNode->next = 0; // not sure if this really points to NULL!!177 178 return;179 176 } 180 177 … … 297 294 { 298 295 this->derivation = 0; 299 this->init();300 296 } 301 297 … … 307 303 this->derivation = derivation; 308 304 dirCurve=NULL; 309 this->init();310 305 } 311 306 … … 327 322 if (dirCurve) 328 323 delete dirCurve; 329 }330 331 /**332 \brief Initializes a UPointCurve333 */334 void UPointCurve::init(void)335 {336 nodeCount = 0;337 firstNode = new PathNode;338 currentNode = firstNode;339 340 firstNode->position = Vector (.0, .0, .0);341 firstNode->number = 0;342 firstNode->next = 0; // not sure if this really points to NULL!!343 344 return;345 324 } 346 325 -
orxonox/trunk/src/lib/math/curve.h
r3473 r3588 38 38 PathNode* currentNode; //!< The node we are working with (the Last node). 39 39 40 40 41 private: 41 42 virtual void rebuild(void) = 0; 42 43 public: 44 Curve(void); 45 43 46 Curve* dirCurve; //!< The derivation-curve of this Curve. 44 47 void addNode(const Vector& newNode); … … 68 71 BezierCurve(void); 69 72 BezierCurve(int derivation); 70 ~BezierCurve(void); 71 void init(void); 73 virtual ~BezierCurve(void); 72 74 73 75 Vector calcPos(float t); … … 106 108 UPointCurve(int derivation); 107 109 ~UPointCurve(void); 108 void init(void);109 110 110 111 Vector calcPos(float t); -
orxonox/trunk/src/light.h
r3544 r3588 32 32 A Light is a source that emits light rays (photons) 33 33 */ 34 class Light : public WorldEntity34 class Light : public BaseObject 35 35 { 36 36 private: -
orxonox/trunk/src/story_entities/world.cc
r3587 r3588 71 71 delete this->nullParent; 72 72 delete this->entities; 73 73 delete this->light; 74 74 delete this->trackManager; 75 75 } … … 296 296 // LIGHT initialisation 297 297 light = Light::getInstance(); 298 light->addLight(0); 298 light->setAmbientColor(.1,.1,.1); 299 light->addLight(); 299 300 light->setAttenuation(QUADRATIC, 1.0); 300 301 light->setAttenuation(CONSTANT, 2.0); -
orxonox/trunk/src/track_manager.cc
r3556 r3588 37 37 this->mainJoin = false; 38 38 this->ID = -1; 39 this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.40 this->duration = 1;39 this->startingTime = 0; 40 this->duration = TMAN_DEFAULT_DURATION; 41 41 this->endTime = 1; 42 42 this->jumpTime = 0; 43 this->curveType = BEZIERCURVE;44 43 this->nodeCount = 0; 45 44 this->childCount = 0; … … 115 114 116 115 /** 116 \param name the Name to set. 117 */ 118 void TrackElement::setName(const char* name) 119 { 120 // delete the old name 121 if (this->name) 122 delete []this->name; 123 // if a name was given already. 124 if (name) 125 { 126 this->name = new char[strlen(name)+1]; 127 strcpy(this->name, name); 128 } 129 else 130 this->name = NULL; 131 } 132 133 /** 134 \returns The name of this TrackElement 135 */ 136 char* TrackElement::getName(void) const 137 { 138 return this->name; 139 } 140 141 142 /** 117 143 \brief CONDITION that chooses the first child for the decision (static) 118 144 \param nothing Nothing in this function … … 266 292 this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]); 267 293 } 294 if (childCount == 1) 295 this->currentTrackElem->children[0]->setName(this->currentTrackElem->getName()); 268 296 } 269 297 … … 307 335 return; 308 336 } 309 t rackElem->curveType = curveType;337 this->curveType = curveType; 310 338 switch (curveType) 311 339 { … … 348 376 if (trackElem->isFresh) 349 377 { 350 this->setCurveType( BEZIERCURVE, trackElem);378 this->setCurveType(TMAN_DEFAULT_CURVETYPE, trackElem); 351 379 trackElem->isFresh = false; 352 380 } … … 757 785 TrackElement* tmpElem = this->findTrackElementByID(i); 758 786 PRINT(0)("--== TrackElement:%i ==--", tmpElem->ID); 759 if(tmpElem-> name)760 PRINT(0)("Name: %s::", tmpElem-> name);787 if(tmpElem->getName()) 788 PRINT(0)("Name: %s::", tmpElem->getName()); 761 789 if(tmpElem->isFresh) 762 790 PRINT(0)(" -- has not jet eddited in any way --\n"); -
orxonox/trunk/src/track_manager.h
r3556 r3588 17 17 class PNode; 18 18 19 // Static Definitions 20 21 //! The Default Curve-Type to set for the whole path (if not chosen otherwise). 22 #define TMAN_DEFAULT_CURVETYPE BEZIERCURVE 23 #define TMAN_DEFAULT_DURATION 10 24 25 19 26 //! A Graph-Element, that holds the curve-structure of a Level. 20 27 /** … … 31 38 bool backLoopCheck(TrackElement* trackElem); 32 39 40 // atributes 33 41 bool isFresh; //!< If no Points where added until now 34 42 bool isHotPoint; //!< If the first node is a specialPoint; … … 42 50 float endTime; //!< The time at which this Track ends. 43 51 float jumpTime; //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true) 44 CurveType curveType; //!< The CurveType this will have.45 52 int nodeCount; //!< The count of points this TrackElement has. 46 char* name; //!< A name for the Trac.47 53 Curve* curve; //!< The Curve of this TrackElement 48 54 int childCount; //!< The number of Children This TrackElement has. 49 55 TrackElement** children; //!< A TrackElement can have a Tree of following TrackElements. 56 57 void setName(const char* name); 58 char* getName(void) const; 50 59 51 60 // runtime … … 63 72 int nearest(void* node); 64 73 // todo int enemyKilled(void* entity); 74 75 private: 76 char* name; //!< A name for the Trac. 77 65 78 }; 66 79 … … 108 121 TrackManager(void); 109 122 110 static TrackManager* singletonRef; //!< There may only be one TrackManager existing. 123 static TrackManager* singletonRef; //!< There may only be one TrackManager. 124 111 125 TrackElement* firstTrackElem; //!< The first TrackElement that exists. 112 126 TrackElement* currentTrackElem; //!< The TrackElement we are working on. 127 CurveType curveType; //!< The CurveType the entire TrackSystem will have. 113 128 float localTime; //!< The time that has been passed since the traveling the Track. 114 129 float maxTime; //!< The maximal time the track has. -
orxonox/trunk/src/world_entities/primitive.cc
r3587 r3588 41 41 this->material->setDiffuseMap("../data/pictures/sky-replace.jpg"); 42 42 this->material->setIllum(3); 43 this->material->set Ambient(1.0, 1.0, 1.0);43 this->material->setSpecular(.3, .3, .3); 44 44 } 45 45
Note: See TracChangeset
for help on using the changeset viewer.