aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
diff options
context:
space:
mode:
authorRobert Adams2012-09-25 15:01:18 -0700
committerRobert Adams2012-09-27 22:01:42 -0700
commit735d89e3692bb7c620b9e3c248a1dbd5924b8b3f (patch)
tree0d31723cc7302e4928de6ac69905787099442bf1 /OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
parentBulletSim: renamed members of BulletShape, BulletSim and BulletBody (diff)
downloadopensim-SC_OLD-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.zip
opensim-SC_OLD-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.tar.gz
opensim-SC_OLD-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.tar.bz2
opensim-SC_OLD-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.tar.xz
BulletSim: btGhostObjects working to make 'volume detect' work.
Rearrangement and cleanup of shape collection code. Much more readable. Enabling and use of collision filters and masks. Addition of ID to body creation BulletSimAPI calls so always set in shape for collision reporting. Change default of ShouldSplitSimulationIslands and ShouldRandomizeSolverOrder from 'false' to 'true'. When 'false', this suppresses NO_CONTACT_RESPONSE which makes volume detect fail.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
index 093d2a4..5d5d9cb 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
@@ -111,8 +111,12 @@ public class BSTerrainManager
111 BulletSimAPI.CreateGroundPlaneShape2(BSScene.GROUNDPLANE_ID, 1f, TERRAIN_COLLISION_MARGIN), 111 BulletSimAPI.CreateGroundPlaneShape2(BSScene.GROUNDPLANE_ID, 1f, TERRAIN_COLLISION_MARGIN),
112 ShapeData.PhysicsShapeType.SHAPE_GROUNDPLANE); 112 ShapeData.PhysicsShapeType.SHAPE_GROUNDPLANE);
113 m_groundPlane = new BulletBody(BSScene.GROUNDPLANE_ID, 113 m_groundPlane = new BulletBody(BSScene.GROUNDPLANE_ID,
114 BulletSimAPI.CreateBodyWithDefaultMotionState2(groundPlaneShape.ptr, Vector3.Zero, Quaternion.Identity)); 114 BulletSimAPI.CreateBodyWithDefaultMotionState2(groundPlaneShape.ptr, BSScene.GROUNDPLANE_ID,
115 Vector3.Zero, Quaternion.Identity));
115 BulletSimAPI.AddObjectToWorld2(PhysicsScene.World.ptr, m_groundPlane.ptr); 116 BulletSimAPI.AddObjectToWorld2(PhysicsScene.World.ptr, m_groundPlane.ptr);
117 // Everything collides with the ground plane.
118 BulletSimAPI.SetCollisionFilterMask2(m_groundPlane.ptr,
119 (uint)CollisionFilterGroups.GroundPlaneFilter, (uint)CollisionFilterGroups.GroundPlaneMask);
116 120
117 Vector3 minTerrainCoords = new Vector3(0f, 0f, HEIGHT_INITIALIZATION - HEIGHT_EQUAL_FUDGE); 121 Vector3 minTerrainCoords = new Vector3(0f, 0f, HEIGHT_INITIALIZATION - HEIGHT_EQUAL_FUDGE);
118 Vector3 maxTerrainCoords = new Vector3(DefaultRegionSize.X, DefaultRegionSize.Y, HEIGHT_INITIALIZATION); 122 Vector3 maxTerrainCoords = new Vector3(DefaultRegionSize.X, DefaultRegionSize.Y, HEIGHT_INITIALIZATION);
@@ -304,7 +308,11 @@ public class BSTerrainManager
304 308
305 mapInfo.terrainBody = new BulletBody(mapInfo.ID, 309 mapInfo.terrainBody = new BulletBody(mapInfo.ID,
306 BulletSimAPI.CreateBodyWithDefaultMotionState2(mapInfo.terrainShape.ptr, 310 BulletSimAPI.CreateBodyWithDefaultMotionState2(mapInfo.terrainShape.ptr,
307 centerPos, Quaternion.Identity)); 311 id, centerPos, Quaternion.Identity));
312
313 BulletSimAPI.SetCollisionFilterMask2(mapInfo.terrainBody.ptr,
314 (uint)CollisionFilterGroups.TerrainFilter,
315 (uint)CollisionFilterGroups.TerrainMask);
308 } 316 }
309 317
310 // Make sure the entry is in the heightmap table 318 // Make sure the entry is in the heightmap table