Changeset 10132 in orxonox.OLD for branches/playability/src/world_entities/effects
- Timestamp:
- Dec 20, 2006, 5:36:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/effects/trail.cc
r10107 r10132 100 100 for( int i = 1; i < sections; i++) 101 101 { 102 this->nodeList[i] = (this->getAbsCoor() - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections))));102 this->nodeList[i] = (this->getAbsCoor());// - (((this->getParent()->getAbsDir().apply(Vector(1,1,1))).getNormalized() * (i * this->maxLength / sections)))); 103 103 //PRINTF(0)(" N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z); 104 104 } … … 133 133 { 134 134 // Update node positions 135 float len = 0; 135 136 float secLen = this->maxLength / this->sections; 136 this->nodeList[0] = (this->getAbsCoor()); 137 for(int i = 1; i < this->sections; i++) 138 { 139 this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*secLen; 140 } 141 /* 142 this->length = this->maxLength / (this->getAbsCoor() - this->nodeList[this->sections-1]).len(); 143 if (!likely(this->length == 1.0)) 144 for(int i = 1; i < this->sections; i++) 145 this->nodeList[i] = this->getAbsCoor()- (this->getAbsCoor() - this->nodeList[i])*this->length; 146 */ 147 /*PRINTF(0)("TRAIL POS "); 148 for( int i=0; i < this->sections; i++) 149 { 150 PRINTF(0)("N%i (%f,%f,%f)",i,this->nodeList[i].x,this->nodeList[i].y,this->nodeList[i].z); 151 } 152 PRINTF(0)("\n");*/ 137 this->nodeList[0] = this->getAbsCoor(); 138 this->nodeList[1] = this->getAbsCoor() - ((this->getParent()->getAbsDir().apply(Vector(1,0,0))).getNormalized() * this->maxLength / sections); 139 for(int i = 2; i < this->sections; i++) 140 { 141 len = (this->nodeList[i-1] - this->nodeList[i]).len(); 142 if( secLen < len) len = secLen; 143 this->nodeList[i] = this->nodeList[i-1] - (this->nodeList[i-1] - this->nodeList[i]).getNormalized()*len; 144 } 153 145 } 154 146
Note: See TracChangeset
for help on using the changeset viewer.