Changeset 7003 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Feb 3, 2006, 2:55:14 AM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 4 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. -
trunk/src/lib/math/quaternion.cc
r6616 r7003 227 227 * outputs some nice formated debug information about this quaternion 228 228 */ 229 void Quaternion::debug() 229 void Quaternion::debug() const 230 230 { 231 231 PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z); 232 232 } 233 233 234 void Quaternion::debug2() 234 void Quaternion::debug2() const 235 235 { 236 236 Vector axis = this->getSpacialAxis(); -
trunk/src/lib/math/quaternion.h
r6627 r7003 103 103 static Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t); 104 104 105 void debug() ;106 void debug2() ;105 void debug() const; 106 void debug2() const; 107 107 108 108
Note: See TracChangeset
for help on using the changeset viewer.