diff options
author | Robert Adams | 2013-05-24 16:24:16 -0700 |
---|---|---|
committer | Robert Adams | 2013-05-24 16:24:16 -0700 |
commit | 5f1f5ea5ab5badf5944471fefe0a45f7b4f41b91 (patch) | |
tree | 1a3becadad77ead0ceb86a8535d0833e2a317ae2 | |
parent | BulletSim: properly set mesh hash key in use tracking structure. (diff) | |
download | opensim-SC-5f1f5ea5ab5badf5944471fefe0a45f7b4f41b91.zip opensim-SC-5f1f5ea5ab5badf5944471fefe0a45f7b4f41b91.tar.gz opensim-SC-5f1f5ea5ab5badf5944471fefe0a45f7b4f41b91.tar.bz2 opensim-SC-5f1f5ea5ab5badf5944471fefe0a45f7b4f41b91.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 3 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index c16b7d3..311cf4f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -617,7 +617,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
617 | // Vehicles report collision events so we know when it's on the ground | 617 | // Vehicles report collision events so we know when it's on the ground |
618 | m_physicsScene.PE.AddToCollisionFlags(ControllingPrim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS); | 618 | m_physicsScene.PE.AddToCollisionFlags(ControllingPrim.PhysBody, CollisionFlags.BS_VEHICLE_COLLISIONS); |
619 | 619 | ||
620 | ControllingPrim.Inertia = m_physicsScene.PE.CalculateLocalInertia(ControllingPrim.PhysShape.physShapeInfo, m_vehicleMass); | 620 | Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(ControllingPrim.PhysShape.physShapeInfo, m_vehicleMass); |
621 | ControllingPrim.Inertia = inertia * BSParam.VehicleInertiaFactor; | ||
621 | m_physicsScene.PE.SetMassProps(ControllingPrim.PhysBody, m_vehicleMass, ControllingPrim.Inertia); | 622 | m_physicsScene.PE.SetMassProps(ControllingPrim.PhysBody, m_vehicleMass, ControllingPrim.Inertia); |
622 | m_physicsScene.PE.UpdateInertiaTensor(ControllingPrim.PhysBody); | 623 | m_physicsScene.PE.UpdateInertiaTensor(ControllingPrim.PhysBody); |
623 | 624 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index c19eda1..e98a7fb 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -148,6 +148,7 @@ public static class BSParam | |||
148 | public static float VehicleRestitution { get; private set; } | 148 | public static float VehicleRestitution { get; private set; } |
149 | public static Vector3 VehicleLinearFactor { get; private set; } | 149 | public static Vector3 VehicleLinearFactor { get; private set; } |
150 | public static Vector3 VehicleAngularFactor { get; private set; } | 150 | public static Vector3 VehicleAngularFactor { get; private set; } |
151 | public static Vector3 VehicleInertiaFactor { get; private set; } | ||
151 | public static float VehicleGroundGravityFudge { get; private set; } | 152 | public static float VehicleGroundGravityFudge { get; private set; } |
152 | public static float VehicleAngularBankingTimescaleFudge { get; private set; } | 153 | public static float VehicleAngularBankingTimescaleFudge { get; private set; } |
153 | public static bool VehicleDebuggingEnable { get; private set; } | 154 | public static bool VehicleDebuggingEnable { get; private set; } |
@@ -583,6 +584,8 @@ public static class BSParam | |||
583 | new Vector3(1f, 1f, 1f) ), | 584 | new Vector3(1f, 1f, 1f) ), |
584 | new ParameterDefn<Vector3>("VehicleAngularFactor", "Fraction of physical angular changes applied to vehicle (<0,0,0> to <1,1,1>)", | 585 | new ParameterDefn<Vector3>("VehicleAngularFactor", "Fraction of physical angular changes applied to vehicle (<0,0,0> to <1,1,1>)", |
585 | new Vector3(1f, 1f, 1f) ), | 586 | new Vector3(1f, 1f, 1f) ), |
587 | new ParameterDefn<Vector3>("VehicleInertiaFactor", "Fraction of physical inertia applied (<0,0,0> to <1,1,1>)", | ||
588 | new Vector3(1f, 1f, 1f) ), | ||
586 | new ParameterDefn<float>("VehicleFriction", "Friction of vehicle on the ground (0.0 - 1.0)", | 589 | new ParameterDefn<float>("VehicleFriction", "Friction of vehicle on the ground (0.0 - 1.0)", |
587 | 0.0f ), | 590 | 0.0f ), |
588 | new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)", | 591 | new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)", |