Changeset 10095 in orxonox.OLD for branches/playability/src/world_entities/effects
- Timestamp:
- Dec 19, 2006, 11:18:22 AM (18 years ago)
- Location:
- branches/playability/src/world_entities/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/effects/trail.cc
r10083 r10095 43 43 * 44 44 */ 45 Trail::Trail (float maxLength, int sections, float radius )45 Trail::Trail (float maxLength, int sections, float radius, PNode* parent) 46 46 { 47 47 this->maxLength = maxLength; … … 49 49 this->sections = sections; 50 50 this->radius = radius; 51 this->setParent( parent); 51 52 52 53 this->nodeList = new Vector[sections]; … … 96 97 for( int i = 1; i < sections; i++) 97 98 { 98 this->nodeList[i] = (this->getAbsCoor() - (( Vector(1,0,0) * (i * this->maxLength / sections))));99 this->nodeList[i] = (this->getAbsCoor() - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections)))); 99 100 //PRINTF(0)(" N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z); 100 101 } … … 277 278 Q[3] = now + Vector(0,-radone,0) ; 278 279 279 glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z );280 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z );280 glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x,Q[3].y,Q[3].z+0.0001f); 281 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x,Q[0].y,Q[0].z+0.0001f); 281 282 282 283 if( i == 1) … … 284 285 Q[1] = later + Vector(0,radzero,0) ; 285 286 Q[2] = later + Vector(0,-radzero,0) ; 286 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z );287 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z );287 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x,Q[2].y,Q[2].z+0.0001f); 288 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x,Q[1].y,Q[1].z+0.0001f); 288 289 } 289 290 … … 340 341 Q[3] = now + targ.cross(Vector(0,-radone,0)) ; 341 342 342 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x ,Q[0].y,Q[0].z);343 glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x ,Q[3].y,Q[3].z);343 glTexCoord2f(0.0f, 0.0f); glVertex3f(Q[0].x+0.0001f,Q[0].y,Q[0].z); 344 glTexCoord2f(1.0f, 0.0f); glVertex3f(Q[3].x+0.0001f,Q[3].y,Q[3].z); 344 345 345 346 if( i == 1) … … 347 348 Q[1] = later + targ.cross(Vector(0,radzero,0)) ; 348 349 Q[2] = later + targ.cross(Vector(0,-radzero,0)) ; 349 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x ,Q[1].y,Q[1].z);350 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x ,Q[2].y,Q[2].z);350 glTexCoord2f(0.0f, 1.0f); glVertex3f(Q[1].x+0.0001f,Q[1].y,Q[1].z); 351 glTexCoord2f(1.0f, 1.0f); glVertex3f(Q[2].x+0.0001f,Q[2].y,Q[2].z); 351 352 } 352 353 -
branches/playability/src/world_entities/effects/trail.h
r10081 r10095 16 16 ObjectListDeclaration(Trail); 17 17 public: 18 Trail(float maxLength, int sections, float radius );18 Trail(float maxLength, int sections, float radius, PNode* parent); 19 19 Trail(const TiXmlElement* root = NULL); 20 20 virtual ~Trail();
Note: See TracChangeset
for help on using the changeset viewer.