MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / updateVelocity

Method updateVelocity

Engine/source/T3D/item.cpp:713–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713void 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
732void Item::updatePos(const U32 /*mask*/, const F32 dt)

Callers 6

resolveContactsMethod · 0.45
readPacketDataMethod · 0.45
unpackUpdateMethod · 0.45
updateForcesMethod · 0.45
readPacketDataMethod · 0.45
unpackUpdateMethod · 0.45

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected