| 506 | } |
| 507 | |
| 508 | void Item::setVelocity(const VectorF& vel) |
| 509 | { |
| 510 | mVelocity = vel; |
| 511 | |
| 512 | // Clamp against the maximum velocity. |
| 513 | if ( mDataBlock->maxVelocity > 0 ) |
| 514 | { |
| 515 | F32 len = mVelocity.magnitudeSafe(); |
| 516 | if ( len > mDataBlock->maxVelocity ) |
| 517 | { |
| 518 | Point3F excess = mVelocity * ( 1.0f - (mDataBlock->maxVelocity / len ) ); |
| 519 | mVelocity -= excess; |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | setMaskBits(PositionMask); |
| 524 | mAtRest = false; |
| 525 | mAtRestCounter = 0; |
| 526 | } |
| 527 | |
| 528 | void Item::applyImpulse(const Point3F&,const VectorF& vec) |
| 529 | { |
no test coverage detected