aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
authorMelanie2013-05-25 02:00:22 +0100
committerMelanie2013-05-25 02:00:22 +0100
commitec22c84cb1a53091181922cc83d30b72adf5b325 (patch)
treedf7896deea74deebe151cca02b6d48b75bf40a5c /OpenSim/Region/Physics/BulletSPlugin
parentMerge commit 'a087dbed7f57f3ec431782dd51ba43110a0f4ae3' into careminster (diff)
parentMeshmerizer: remember to add the copied hull verts to the list of hulls. (diff)
downloadopensim-SC-ec22c84cb1a53091181922cc83d30b72adf5b325.zip
opensim-SC-ec22c84cb1a53091181922cc83d30b72adf5b325.tar.gz
opensim-SC-ec22c84cb1a53091181922cc83d30b72adf5b325.tar.bz2
opensim-SC-ec22c84cb1a53091181922cc83d30b72adf5b325.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs3
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs3
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapes.cs5
3 files changed, 9 insertions, 2 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)",
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
index 046c12c..395dbe3 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
@@ -580,7 +580,6 @@ public class BSShapeHull : BSShape
580 PrimitiveBaseShape pbs, OMV.Vector3 size, float lod) 580 PrimitiveBaseShape pbs, OMV.Vector3 size, float lod)
581 { 581 {
582 BulletShape newShape = new BulletShape(); 582 BulletShape newShape = new BulletShape();
583 newShape.shapeKey = newHullKey;
584 583
585 IMesh meshData = null; 584 IMesh meshData = null;
586 List<List<OMV.Vector3>> allHulls = null; 585 List<List<OMV.Vector3>> allHulls = null;
@@ -784,6 +783,7 @@ public class BSShapeHull : BSShape
784 // create the hull data structure in Bullet 783 // create the hull data structure in Bullet
785 newShape = physicsScene.PE.CreateHullShape(physicsScene.World, hullCount, convHulls); 784 newShape = physicsScene.PE.CreateHullShape(physicsScene.World, hullCount, convHulls);
786 } 785 }
786 newShape.shapeKey = newHullKey;
787 return newShape; 787 return newShape;
788 } 788 }
789 // Callback from convex hull creater with a newly created hull. 789 // Callback from convex hull creater with a newly created hull.
@@ -908,6 +908,7 @@ public class BSShapeCompound : BSShape
908 } 908 }
909 else 909 else
910 { 910 {
911 // Didn't find it in the lists of specific types. It could be compound.
911 if (physicsScene.PE.IsCompound(pShape)) 912 if (physicsScene.PE.IsCompound(pShape))
912 { 913 {
913 BSShapeCompound recursiveCompound = new BSShapeCompound(pShape); 914 BSShapeCompound recursiveCompound = new BSShapeCompound(pShape);
@@ -915,6 +916,7 @@ public class BSShapeCompound : BSShape
915 } 916 }
916 else 917 else
917 { 918 {
919 // If none of the above, maybe it is a simple native shape.
918 if (physicsScene.PE.IsNativeShape(pShape)) 920 if (physicsScene.PE.IsNativeShape(pShape))
919 { 921 {
920 BSShapeNative nativeShape = new BSShapeNative(pShape); 922 BSShapeNative nativeShape = new BSShapeNative(pShape);
@@ -1054,6 +1056,7 @@ public class BSShapeGImpact : BSShape
1054 1056
1055 // Check to see if mesh was created (might require an asset). 1057 // Check to see if mesh was created (might require an asset).
1056 newShape = VerifyMeshCreated(physicsScene, newShape, prim); 1058 newShape = VerifyMeshCreated(physicsScene, newShape, prim);
1059 newShape.shapeKey = newMeshKey;
1057 if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed) 1060 if (!newShape.isNativeShape || prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed)
1058 { 1061 {
1059 // If a mesh was what was created, remember the built shape for later sharing. 1062 // If a mesh was what was created, remember the built shape for later sharing.