mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-27 16:19:34 +00:00
code review:
1) got rid of evey class having it's own gravity 2) rigidshape inheritance simplifications 3) gravitymod from physicszones taking buoyancy into account natively (we still track raw bouyancy to cancel it out for player) 4) disableMove used throughout 5) items can now also be influenced by the appliedforce from physicszones
This commit is contained in:
parent
76c5e30869
commit
afb39d398f
13 changed files with 191 additions and 487 deletions
|
|
@ -69,7 +69,6 @@ ConsoleDocClass( HoverVehicle,
|
|||
);
|
||||
|
||||
namespace {
|
||||
const F32 sHoverVehicleGravity = -20;
|
||||
|
||||
const U32 sCollisionMoveMask = (TerrainObjectType | PlayerObjectType |
|
||||
StaticShapeObjectType | VehicleObjectType |
|
||||
|
|
@ -674,7 +673,7 @@ void HoverVehicle::updateForces(F32 /*dt*/)
|
|||
{
|
||||
PROFILE_SCOPE( HoverVehicle_UpdateForces );
|
||||
|
||||
Point3F gravForce(0, 0, sHoverVehicleGravity * mRigid.mass * mGravityMod);
|
||||
Point3F gravForce(0, 0, mRigid.mass * mNetGravity);
|
||||
|
||||
MatrixF currTransform;
|
||||
mRigid.getTransform(&currTransform);
|
||||
|
|
@ -872,8 +871,6 @@ void HoverVehicle::updateForces(F32 /*dt*/)
|
|||
// Add in physical zone force
|
||||
force += mAppliedForce;
|
||||
|
||||
// Container buoyancy & drag
|
||||
force += Point3F(0, 0,-mBuoyancy * sHoverVehicleGravity * mRigid.mass * mGravityMod);
|
||||
force -= mRigid.linVelocity * mDrag;
|
||||
torque -= mRigid.angMomentum * mDrag;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue