BulletSim: add VehicleInertiaFactor to allow modifying inertia.

Another parameter for vehicle operation tuning.
Default to <1,1,1> which means nothing is different under normal use.
This commit is contained in:
Robert Adams
2013-05-24 16:24:16 -07:00
parent 4979940def
commit 5f1f5ea5ab
2 changed files with 5 additions and 1 deletions

View File

@@ -617,7 +617,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
// Vehicles report collision events so we know when it's on the ground
m_physicsScene.PE.AddToCollisionFlags(ControllingPrim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS);
ControllingPrim.Inertia = m_physicsScene.PE.CalculateLocalInertia(ControllingPrim.PhysShape.physShapeInfo, m_vehicleMass);
Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(ControllingPrim.PhysShape.physShapeInfo, m_vehicleMass);
ControllingPrim.Inertia = inertia * BSParam.VehicleInertiaFactor;
m_physicsScene.PE.SetMassProps(ControllingPrim.PhysBody, m_vehicleMass, ControllingPrim.Inertia);
m_physicsScene.PE.UpdateInertiaTensor(ControllingPrim.PhysBody);