| 711 | } |
| 712 | |
| 713 | void Item::updateVelocity(const F32 dt) |
| 714 | { |
| 715 | // Container buoyancy & drag |
| 716 | // Acceleration due to gravity |
| 717 | mVelocity.z += (mNetGravity * mDataBlock->gravityMod) * dt; |
| 718 | mVelocity -= mVelocity * mDrag * dt; |
| 719 | |
| 720 | // Add in physical zone force |
| 721 | mVelocity += mAppliedForce; |
| 722 | |
| 723 | F32 len; |
| 724 | if (mDataBlock->maxVelocity > 0 && (len = mVelocity.len()) > (mDataBlock->maxVelocity * 1.05)) { |
| 725 | Point3F excess = mVelocity * (1.0 - (mDataBlock->maxVelocity / len )); |
| 726 | excess *= 0.1f; |
| 727 | mVelocity -= excess; |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | |
| 732 | void Item::updatePos(const U32 /*mask*/, const F32 dt) |
no test coverage detected