mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user