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.user_profiles
parent
4979940def
commit
5f1f5ea5ab
|
@ -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);
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ public static class BSParam
|
|||
public static float VehicleRestitution { get; private set; }
|
||||
public static Vector3 VehicleLinearFactor { get; private set; }
|
||||
public static Vector3 VehicleAngularFactor { get; private set; }
|
||||
public static Vector3 VehicleInertiaFactor { get; private set; }
|
||||
public static float VehicleGroundGravityFudge { get; private set; }
|
||||
public static float VehicleAngularBankingTimescaleFudge { get; private set; }
|
||||
public static bool VehicleDebuggingEnable { get; private set; }
|
||||
|
@ -583,6 +584,8 @@ public static class BSParam
|
|||
new Vector3(1f, 1f, 1f) ),
|
||||
new ParameterDefn<Vector3>("VehicleAngularFactor", "Fraction of physical angular changes applied to vehicle (<0,0,0> to <1,1,1>)",
|
||||
new Vector3(1f, 1f, 1f) ),
|
||||
new ParameterDefn<Vector3>("VehicleInertiaFactor", "Fraction of physical inertia applied (<0,0,0> to <1,1,1>)",
|
||||
new Vector3(1f, 1f, 1f) ),
|
||||
new ParameterDefn<float>("VehicleFriction", "Friction of vehicle on the ground (0.0 - 1.0)",
|
||||
0.0f ),
|
||||
new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)",
|
||||
|
|
Loading…
Reference in New Issue