Changeset 4996 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Aug 13, 2005, 2:21:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/p_node.cc
r4995 r4996 331 331 * sets the absolute direction (0,0,1) 332 332 * @param absDir absolute coordinates 333 334 it is very importand, that you use this function, if you want to update the335 absDirection. If you don't use this, the PNode won't recognize, that something336 has changed and won't update the children Nodes.337 333 * 338 * FIXME ERROR HERE THIS IS IMPLEMENTED FALSELY 339 * @todo FIXME 334 * it is very importand, that you use this function, if you want to update the 335 * absDirection. If you don't use this, the PNode won't recognize, that something 336 * has changed and won't update the children Nodes. 340 337 */ 341 338 void PNode::setAbsDir (const Quaternion& absDir) 342 339 { 343 //if (this->parent)344 this->relDirection = absDir ;// - parent->getAbsDir();345 //else346 //this->relDirection = absDir;340 if (this->parent) 341 this->relDirection = absDir * parent->getAbsDir().inverse(); 342 else 343 this->relDirection = absDir; 347 344 348 345 this->bRelDirChanged = true; … … 492 489 this->setRelCoor(tmpV - parentNode->getAbsCoor()); 493 490 494 this->setRelDir(tmpQ - parentNode->getAbsDir());491 this->setRelDir(tmpQ * parentNode->getAbsDir().inverse()); 495 492 } 496 493 … … 546 543 if (unlikely(this->toDirection != NULL)) 547 544 { 548 Quaternion rotQuat = (*this->toDirection - this->getRelDir()) *dt*bias; 549 545 Quaternion rotQuat = (*this->toDirection * this->getRelDir().inverse()) *dt*bias; 550 546 // if (likely(rotQuat.len() >= .001)) 551 547 { … … 630 626 else 631 627 PRINT(0)(" -"); 632 PRINT(0)("PNode(%s::%s) - absCoord: (%0.2f, %0.2f, %0.2f), relCoord(%0.2f, %0.2f, %0.2f) - %s\n",628 PRINT(0)("PNode(%s::%s) - absCoord: (%0.2f, %0.2f, %0.2f), relCoord(%0.2f, %0.2f, %0.2f), direction(%0.2f, %0.2f, %0.2f) - %s\n", 633 629 this->getClassName(), 634 630 this->getName(), … … 639 635 this->relCoordinate.y, 640 636 this->relCoordinate.z, 637 this->getAbsDirV().x, 638 this->getAbsDirV().y, 639 this->getAbsDirV().z, 641 640 this->parentingModeToChar(parentMode)); 642 641 if (depth >= 2 || depth == 0)
Note: See TracChangeset
for help on using the changeset viewer.