aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
diff options
context:
space:
mode:
authorRobert Adams2013-05-02 12:27:30 -0700
committerRobert Adams2013-05-02 12:27:30 -0700
commit4042c82a7293c40955a14d04d9e5ae05d35ef7cf (patch)
treec07959bf5d928e4c92f93d1a4c241742b7642dc2 /OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
parentBulletSim: Rebuild physical body if physical shape changes for mesh and hull. (diff)
downloadopensim-SC_OLD-4042c82a7293c40955a14d04d9e5ae05d35ef7cf.zip
opensim-SC_OLD-4042c82a7293c40955a14d04d9e5ae05d35ef7cf.tar.gz
opensim-SC_OLD-4042c82a7293c40955a14d04d9e5ae05d35ef7cf.tar.bz2
opensim-SC_OLD-4042c82a7293c40955a14d04d9e5ae05d35ef7cf.tar.xz
BulletSim: prims with no cuts created with single convex hull shape.
Parameter added to enable/disable this feature.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
index 809435d..794857c 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
@@ -226,8 +226,23 @@ public sealed class BSShapeCollection : IDisposable
226 // made. Native shapes work in either case. 226 // made. Native shapes work in either case.
227 if (prim.IsPhysical && BSParam.ShouldUseHullsForPhysicalObjects) 227 if (prim.IsPhysical && BSParam.ShouldUseHullsForPhysicalObjects)
228 { 228 {
229 // Update prim.BSShape to reference a hull of this shape. 229 // Use a simple, single mesh convex hull shape if the object is simple enough
230 BSShape potentialHull = BSShapeHull.GetReference(m_physicsScene, false /*forceRebuild*/, prim); 230 BSShape potentialHull = null;
231
232 PrimitiveBaseShape pbs = prim.BaseShape;
233 if (BSParam.ShouldUseSingleConvexHullForPrims
234 && pbs != null
235 && !pbs.SculptEntry
236 && PrimHasNoCuts(pbs)
237 )
238 {
239 potentialHull = BSShapeConvexHull.GetReference(m_physicsScene, false /* forceRebuild */, prim);
240 }
241 else
242 {
243 potentialHull = BSShapeHull.GetReference(m_physicsScene, false /*forceRebuild*/, prim);
244 }
245
231 // If the current shape is not what is on the prim at the moment, time to change. 246 // If the current shape is not what is on the prim at the moment, time to change.
232 if (!prim.PhysShape.HasPhysicalShape 247 if (!prim.PhysShape.HasPhysicalShape
233 || potentialHull.ShapeType != prim.PhysShape.ShapeType 248 || potentialHull.ShapeType != prim.PhysShape.ShapeType