- Timestamp:
- Oct 22, 2005, 10:55:51 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 6 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; }; -
trunk/src/world_entities/environment.cc
r5378 r5419 38 38 this->loadModel("models/ships/bolido.obj"); 39 39 40 if(this->obbTree == NULL)41 this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); 40 /* if(this->obbTree == NULL) 41 this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());*/ 42 42 } 43 43 -
trunk/src/world_entities/test_entity.cc
r5378 r5419 37 37 // this->md2Model = new MD2Model("models/tris.md2", "models/tris.pcx"); 38 38 // this->md2Model = new MD2Model("models/goblin.md2", "maps/goblin.bmp"); 39 this->obbTree = new OBBTree(4, (sVec3D*)this->md2Model->data->pVertices, this->md2Model->data->numVertices);39 // this->obbTree = new OBBTree(4, (sVec3D*)this->md2Model->data->pVertices, this->md2Model->data->numVertices); 40 40 41 41 this->md2Model->setAnim(RUN); -
trunk/src/world_entities/world_entity.cc
r5378 r5419 98 98 bool WorldEntity::buildObbTree(unsigned int depth) 99 99 { 100 if (this->obbTree)101 delete this->obbTree;102 103 if (this->model)104 {105 PRINTF(4)("creating obb tree\n");106 this->obbTree = new OBBTree(depth, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());107 return true;108 }109 else110 {111 PRINTF(2)("could not create obb-tree, because no model was loaded yet\n");112 this->obbTree = NULL;113 return false;114 }100 // if (this->obbTree) 101 // delete this->obbTree; 102 // 103 // if (this->model) 104 // { 105 // PRINTF(4)("creating obb tree\n"); 106 // this->obbTree = new OBBTree(depth, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); 107 // return true; 108 // } 109 // else 110 // { 111 // PRINTF(2)("could not create obb-tree, because no model was loaded yet\n"); 112 // this->obbTree = NULL; 113 // return false; 114 // } 115 115 } 116 116
Note: See TracChangeset
for help on using the changeset viewer.