diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 12baee9..2671995 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |||
@@ -57,12 +57,12 @@ public struct BulletBody | |||
57 | { | 57 | { |
58 | ID = id; | 58 | ID = id; |
59 | ptr = xx; | 59 | ptr = xx; |
60 | collisionFilter = 0; | 60 | collisionGroup = 0; |
61 | collisionMask = 0; | 61 | collisionMask = 0; |
62 | } | 62 | } |
63 | public IntPtr ptr; | 63 | public IntPtr ptr; |
64 | public uint ID; | 64 | public uint ID; |
65 | public CollisionFilterGroups collisionFilter; | 65 | public CollisionFilterGroups collisionGroup; |
66 | public CollisionFilterGroups collisionMask; | 66 | public CollisionFilterGroups collisionMask; |
67 | public override string ToString() | 67 | public override string ToString() |
68 | { | 68 | { |
@@ -71,10 +71,10 @@ public struct BulletBody | |||
71 | buff.Append(ID.ToString()); | 71 | buff.Append(ID.ToString()); |
72 | buff.Append(",p="); | 72 | buff.Append(",p="); |
73 | buff.Append(ptr.ToString("X")); | 73 | buff.Append(ptr.ToString("X")); |
74 | if (collisionFilter != 0 || collisionMask != 0) | 74 | if (collisionGroup != 0 || collisionMask != 0) |
75 | { | 75 | { |
76 | buff.Append(",f="); | 76 | buff.Append(",g="); |
77 | buff.Append(collisionFilter.ToString("X")); | 77 | buff.Append(collisionGroup.ToString("X")); |
78 | buff.Append(",m="); | 78 | buff.Append(",m="); |
79 | buff.Append(collisionMask.ToString("X")); | 79 | buff.Append(collisionMask.ToString("X")); |
80 | } | 80 | } |
@@ -357,9 +357,10 @@ public enum CollisionFlags : uint | |||
357 | CF_CHARACTER_OBJECT = 1 << 4, | 357 | CF_CHARACTER_OBJECT = 1 << 4, |
358 | CF_DISABLE_VISUALIZE_OBJECT = 1 << 5, | 358 | CF_DISABLE_VISUALIZE_OBJECT = 1 << 5, |
359 | CF_DISABLE_SPU_COLLISION_PROCESS = 1 << 6, | 359 | CF_DISABLE_SPU_COLLISION_PROCESS = 1 << 6, |
360 | // Following used by BulletSim to control collisions | 360 | // Following used by BulletSim to control collisions and updates |
361 | BS_SUBSCRIBE_COLLISION_EVENTS = 1 << 10, | 361 | BS_SUBSCRIBE_COLLISION_EVENTS = 1 << 10, |
362 | BS_FLOATS_ON_WATER = 1 << 11, | 362 | BS_FLOATS_ON_WATER = 1 << 11, |
363 | BS_VEHICLE_COLLISIONS = 1 << 12, | ||
363 | BS_NONE = 0, | 364 | BS_NONE = 0, |
364 | BS_ALL = 0xFFFFFFFF, | 365 | BS_ALL = 0xFFFFFFFF, |
365 | 366 | ||
@@ -376,36 +377,36 @@ public enum CollisionFilterGroups : uint | |||
376 | // Don't use the bit definitions!! Define the use in a | 377 | // Don't use the bit definitions!! Define the use in a |
377 | // filter/mask definition below. This way collision interactions | 378 | // filter/mask definition below. This way collision interactions |
378 | // are more easily debugged. | 379 | // are more easily debugged. |
379 | BNoneFilter = 0, | 380 | BNoneGroup = 0, |
380 | BDefaultFilter = 1 << 0, | 381 | BDefaultGroup = 1 << 0, |
381 | BStaticFilter = 1 << 1, | 382 | BStaticGroup = 1 << 1, |
382 | BKinematicFilter = 1 << 2, | 383 | BKinematicGroup = 1 << 2, |
383 | BDebrisFilter = 1 << 3, | 384 | BDebrisGroup = 1 << 3, |
384 | BSensorTrigger = 1 << 4, | 385 | BSensorTrigger = 1 << 4, |
385 | BCharacterFilter = 1 << 5, | 386 | BCharacterGroup = 1 << 5, |
386 | BAllFilter = 0xFFFFFFFF, | 387 | BAllGroup = 0xFFFFFFFF, |
387 | // Filter groups defined by BulletSim | 388 | // Filter groups defined by BulletSim |
388 | BGroundPlaneFilter = 1 << 10, | 389 | BGroundPlaneGroup = 1 << 10, |
389 | BTerrainFilter = 1 << 11, | 390 | BTerrainGroup = 1 << 11, |
390 | BRaycastFilter = 1 << 12, | 391 | BRaycastGroup = 1 << 12, |
391 | BSolidFilter = 1 << 13, | 392 | BSolidGroup = 1 << 13, |
392 | BLinksetFilter = 1 << 14, | 393 | BLinksetGroup = 1 << 14, |
393 | 394 | ||
394 | // The collsion filters and masked are defined in one place -- don't want them scattered | 395 | // The collsion filters and masked are defined in one place -- don't want them scattered |
395 | AvatarFilter = BCharacterFilter, | 396 | AvatarGroup = BCharacterGroup, |
396 | AvatarMask = BAllFilter, | 397 | AvatarMask = BAllGroup, |
397 | ObjectFilter = BSolidFilter, | 398 | ObjectGroup = BSolidGroup, |
398 | ObjectMask = BAllFilter, | 399 | ObjectMask = BAllGroup, |
399 | StaticObjectFilter = BStaticFilter, | 400 | StaticObjectGroup = BStaticGroup, |
400 | StaticObjectMask = BAllFilter & ~BStaticFilter, // static objects don't collide with each other | 401 | StaticObjectMask = AvatarGroup | ObjectGroup, // static things don't interact with much |
401 | LinksetFilter = BLinksetFilter, | 402 | LinksetGroup = BLinksetGroup, |
402 | LinksetMask = BAllFilter & ~BLinksetFilter, // linkset objects don't collide with each other | 403 | LinksetMask = BAllGroup & ~BLinksetGroup, // linkset objects don't collide with each other |
403 | VolumeDetectFilter = BSensorTrigger, | 404 | VolumeDetectGroup = BSensorTrigger, |
404 | VolumeDetectMask = ~BSensorTrigger, | 405 | VolumeDetectMask = ~BSensorTrigger, |
405 | TerrainFilter = BTerrainFilter, | 406 | TerrainGroup = BTerrainGroup, |
406 | TerrainMask = BAllFilter & ~BStaticFilter, // static objects on the ground don't collide | 407 | TerrainMask = BAllGroup & ~BStaticGroup, // static objects on the ground don't collide |
407 | GroundPlaneFilter = BGroundPlaneFilter, | 408 | GroundPlaneGroup = BGroundPlaneGroup, |
408 | GroundPlaneMask = BAllFilter | 409 | GroundPlaneMask = BAllGroup |
409 | 410 | ||
410 | }; | 411 | }; |
411 | 412 | ||
@@ -945,7 +946,7 @@ public static extern IntPtr GetConstraintRef2(IntPtr obj, int index); | |||
945 | public static extern int GetNumConstraintRefs2(IntPtr obj); | 946 | public static extern int GetNumConstraintRefs2(IntPtr obj); |
946 | 947 | ||
947 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 948 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
948 | public static extern void SetCollisionFilterMask2(IntPtr body, uint filter, uint mask); | 949 | public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask); |
949 | 950 | ||
950 | // ===================================================================================== | 951 | // ===================================================================================== |
951 | // btCollisionShape entries | 952 | // btCollisionShape entries |
@@ -1007,13 +1008,16 @@ public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); | |||
1007 | public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); | 1008 | public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); |
1008 | 1009 | ||
1009 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1010 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1011 | public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); | ||
1012 | |||
1013 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1010 | public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); | 1014 | public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); |
1011 | 1015 | ||
1012 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1016 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1013 | public static extern void DumpAllInfo2(IntPtr sim); | 1017 | public static extern void DumpActivationInfo2(IntPtr sim); |
1014 | 1018 | ||
1015 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1019 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1016 | public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); | 1020 | public static extern void DumpAllInfo2(IntPtr sim); |
1017 | 1021 | ||
1018 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1022 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1019 | public static extern void DumpPhysicsStatistics2(IntPtr sim); | 1023 | public static extern void DumpPhysicsStatistics2(IntPtr sim); |