aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-27 22:04:12 -0800
committerRobert Adams2012-12-27 22:12:28 -0800
commit1f6aaad0b587f1589afd7a7ca6feb8d2bbba8641 (patch)
tree1edae51295588cc0805ecc11d0866c68a39f8a7c /OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
parentBulletSim: fix physical object not interacting with static objects. (diff)
downloadopensim-SC-1f6aaad0b587f1589afd7a7ca6feb8d2bbba8641.zip
opensim-SC-1f6aaad0b587f1589afd7a7ca6feb8d2bbba8641.tar.gz
opensim-SC-1f6aaad0b587f1589afd7a7ca6feb8d2bbba8641.tar.bz2
opensim-SC-1f6aaad0b587f1589afd7a7ca6feb8d2bbba8641.tar.xz
BulletSim: correct collision mask definition for linkset children.
Remove unused code. Add comments and TODOs.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs27
1 files changed, 4 insertions, 23 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
index 36d38d4..5ad6746 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs
@@ -72,12 +72,12 @@ public struct BulletBody
72 public bool HasPhysicalBody { get { return ptr != IntPtr.Zero; } } 72 public bool HasPhysicalBody { get { return ptr != IntPtr.Zero; } }
73 73
74 // Apply the specificed collision mask into the physical world 74 // Apply the specificed collision mask into the physical world
75 public void ApplyCollisionMask() 75 public bool ApplyCollisionMask()
76 { 76 {
77 // Should assert the body has been added to the physical world. 77 // Should assert the body has been added to the physical world.
78 // (The collision masks are stored in the collision proxy cache which only exists for 78 // (The collision masks are stored in the collision proxy cache which only exists for
79 // a collision body that is in the world.) 79 // a collision body that is in the world.)
80 BulletSimAPI.SetCollisionGroupMask2(ptr, 80 return BulletSimAPI.SetCollisionGroupMask2(ptr,
81 BulletSimData.CollisionTypeMasks[collisionType].group, 81 BulletSimData.CollisionTypeMasks[collisionType].group,
82 BulletSimData.CollisionTypeMasks[collisionType].mask); 82 BulletSimData.CollisionTypeMasks[collisionType].mask);
83 } 83 }
@@ -207,26 +207,6 @@ public struct CollisionTypeFilterGroup
207 public uint mask; 207 public uint mask;
208}; 208};
209 209
210 /* NOTE: old definitions kept for reference. Delete when things are working.
211 // The collsion filters and masked are defined in one place -- don't want them scattered
212 AvatarGroup = BCharacterGroup,
213 AvatarMask = BAllGroup,
214 ObjectGroup = BSolidGroup,
215 ObjectMask = BAllGroup,
216 StaticObjectGroup = BStaticGroup,
217 StaticObjectMask = AvatarGroup | ObjectGroup, // static things don't interact with much
218 LinksetGroup = BLinksetGroup,
219 LinksetMask = BAllGroup,
220 LinksetChildGroup = BLinksetChildGroup,
221 LinksetChildMask = BNoneGroup, // Linkset children disappear from the world
222 VolumeDetectGroup = BSensorTrigger,
223 VolumeDetectMask = ~BSensorTrigger,
224 TerrainGroup = BTerrainGroup,
225 TerrainMask = BAllGroup & ~BStaticGroup, // static objects on the ground don't collide
226 GroundPlaneGroup = BGroundPlaneGroup,
227 GroundPlaneMask = BAllGroup
228 */
229
230public static class BulletSimData 210public static class BulletSimData
231{ 211{
232 212
@@ -269,8 +249,9 @@ public static Dictionary<CollisionType, CollisionTypeFilterGroup> CollisionTypeM
269 }, 249 },
270 { CollisionType.LinksetChild, 250 { CollisionType.LinksetChild,
271 new CollisionTypeFilterGroup(CollisionType.LinksetChild, 251 new CollisionTypeFilterGroup(CollisionType.LinksetChild,
272 (uint)CollisionFilterGroups.BTerrainGroup, 252 (uint)CollisionFilterGroups.BLinksetChildGroup,
273 (uint)(CollisionFilterGroups.BNoneGroup)) 253 (uint)(CollisionFilterGroups.BNoneGroup))
254 // (uint)(CollisionFilterGroups.BCharacterGroup | CollisionFilterGroups.BSolidGroup))
274 }, 255 },
275}; 256};
276 257