Changeset 7003 in orxonox.OLD for trunk/src/lib/coord
- Timestamp:
- Feb 3, 2006, 2:55:14 AM (19 years ago)
- Location:
- trunk/src/lib/coord
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r6959 r7003 215 215 216 216 *this->toCoordinate = relCoordSoft; 217 this->toStep = 0.0f;218 217 this->bias = bias; 219 218 } … … 301 300 *this->toCoordinate = absCoordSoft; 302 301 } 303 this->toStep = 0.0f;304 302 } 305 303 … … 373 371 *this->toDirection = relDirSoft; 374 372 this->bias = bias; 375 this->toStep = 0.0f;376 373 this->bRelDirChanged = true; 377 374 } … … 443 440 444 441 this->bias = bias; 445 this->toStep = 0.0f;446 442 this->bRelDirChanged = true; 447 443 } … … 650 646 } 651 647 this->bias = bias; 652 this->toStep = 0.0f;653 648 654 649 Vector tmpV = this->getAbsCoor(); … … 781 776 if (unlikely(this->toDirection != NULL)) 782 777 { 783 this->toStep += fabs(dt) * bias;784 778 //printf("%s::%s %f\n", this->getClassName(), this->getName(), this->toStep ); 785 Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, toStep);786 if (this->relDirection.distance(rotQuat) > PNODE_ITERATION_DELTA)779 Quaternion rotQuat = Quaternion::quatSlerp(this->relDirection,*this->toDirection, .1); 780 if (this->relDirection.distance(rotQuat) > PNODE_ITERATION_DELTA) 787 781 { 788 782 this->relDirection = rotQuat; … … 794 788 this->toDirection = NULL; 795 789 PRINTF(5)("SmoothRotate of %s finished\n", this->getName()); 790 this->bRelDirChanged; 796 791 } 797 792 } … … 817 812 this->absCoordinate = this->parent->getAbsCoor() + this->relCoordinate; 818 813 } 819 else if( this->parentMode & PNODE_ROTATE_MOVEMENT && this->bRelCoorChanged)814 else if( this->parentMode & PNODE_ROTATE_MOVEMENT && (this->bRelCoorChanged || this->bRelDirChanged)) 820 815 { 821 816 /* update the current absCoordinate */ -
trunk/src/lib/coord/p_node.h
r6873 r7003 224 224 Quaternion* toDirection; //!< a direction to which to iterate. (This is used in conjunction with setParentSoft and set*DirSoft) 225 225 float bias; //!< how fast to iterate to the given position (default is 1) 226 float toStep;227 226 228 227 PNode* parent; //!< a pointer to the parent node.
Note: See TracChangeset
for help on using the changeset viewer.