Changeset 5419 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Oct 22, 2005, 10:55:51 AM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5414 r5419 11 11 ### File Specific: 12 12 main-programmer: Patrick Boenzli 13 co-programmer: 13 co-programmer: Benjamin Grauer 14 14 */ 15 15 … … 630 630 if (unlikely(this->toDirection != NULL)) 631 631 { 632 Quaternion rotQuat = Quaternion::quatSlerp( Quaternion(), (*this->toDirection / this->relDirection), fabsf(dt)*this->bias);633 if ( likely(rotQuat.getSpacialAxisAngle() > PNODE_ITERATION_DELTA))632 Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, fabsf(dt)*this->bias); 633 if (this->relDirection.distance(rotQuat) >PNODE_ITERATION_DELTA) 634 634 { 635 this->shiftDir(rotQuat); 635 this->relDirection = rotQuat; 636 this->bRelDirChanged; 636 637 } 637 638 else -
trunk/src/lib/graphics/text_engine/text.cc
r5418 r5419 251 251 { 252 252 glBegin(GL_QUADS); 253 253 254 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]); 254 255 glVertex2d(posX, - tmpGlyph->bearingY * this->size); 256 255 257 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]); 256 258 glVertex2d(posX, (tmpGlyph->height - tmpGlyph->bearingY)*this->size); 259 257 260 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]); 258 261 glVertex2d(posX+tmpGlyph->width*this->size, (tmpGlyph->height - tmpGlyph->bearingY)*this->size); 262 259 263 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); 260 264 glVertex2d(posX+tmpGlyph->width*this->size, - tmpGlyph->bearingY*this->size); 265 261 266 glEnd(); 262 267 glEndList(); 263 posX += tmpGlyph-> width*this->size;268 posX += tmpGlyph->advance * this->size; 264 269 } 265 tmpText++;270 ++tmpText; 266 271 } 267 272 } -
trunk/src/lib/math/vector.h
r5215 r5419 157 157 /** @returns the inverted Quaterntion of this */ 158 158 inline Quaternion inverse () const { return conjugate() / (w*w + v.x*v.x + v.y*v.y + v.z*v.z); }; 159 /** @returns the dot Product of a Quaternion */ 160 inline float dot (const Quaternion& q) const { return v.x*q.v.x + v.y*q.v.y + v.z*q.v.z + w*q.w; }; 161 /** @retuns the Distance between two Quaternions */ 162 inline float distance(const Quaternion& q) const { return 2*acos(fabsf(this->dot(q))); }; 159 163 /** @param v: the Vector @return a new Vector representing v rotated by the Quaternion */ 160 164 inline Vector apply (const Vector& v) const { return (*this * Quaternion(v, 0) * conjugate()).v; };
Note: See TracChangeset
for help on using the changeset viewer.