aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-03 16:25:51 -0800
committerRobert Adams2012-12-03 16:25:51 -0800
commit787636b97ac242c3a903664a2fe1f26ea8c0130a (patch)
treeaee245069b829730b85f2f56005a7da029596bd8 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
parentBulletSim: rework angular corrections to remove any hybrid code and compute a... (diff)
downloadopensim-SC_OLD-787636b97ac242c3a903664a2fe1f26ea8c0130a.zip
opensim-SC_OLD-787636b97ac242c3a903664a2fe1f26ea8c0130a.tar.gz
opensim-SC_OLD-787636b97ac242c3a903664a2fe1f26ea8c0130a.tar.bz2
opensim-SC_OLD-787636b97ac242c3a903664a2fe1f26ea8c0130a.tar.xz
BulletSim: Reduce idle region physics overhead where there are MANY
static objects by more restrictive selection of objects that collide with static objects. Rename collision mask fuctions from 'filter' to 'group' so it is clear what is being set. Rename BulletSimAPI.SetCollisionFilterMask() to SetCollisionGroupMask to match above. Restore passing of time step to linear and angular motion component routines. Use buffering vehicle physical parameter get/set routines consistantly. Make range enforcement clearer by using ClampInRange() function for parameter setting. Remove commented out experimental vehicle calculations.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 42a362f..ea1f71a 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -646,9 +646,13 @@ public sealed class BSPrim : BSPhysObject
646 BulletSimAPI.UpdateSingleAabb2(PhysicsScene.World.ptr, PhysBody.ptr); 646 BulletSimAPI.UpdateSingleAabb2(PhysicsScene.World.ptr, PhysBody.ptr);
647 647
648 // Collision filter can be set only when the object is in the world 648 // Collision filter can be set only when the object is in the world
649 if (PhysBody.collisionFilter != 0 || PhysBody.collisionMask != 0) 649 if (PhysBody.collisionGroup != 0 || PhysBody.collisionMask != 0)
650 { 650 {
651 BulletSimAPI.SetCollisionFilterMask2(PhysBody.ptr, (uint)PhysBody.collisionFilter, (uint)PhysBody.collisionMask); 651 if (!BulletSimAPI.SetCollisionGroupMask2(PhysBody.ptr, (uint)PhysBody.collisionGroup, (uint)PhysBody.collisionMask))
652 {
653 PhysicsScene.Logger.ErrorFormat("{0} Failure setting prim collision mask. localID={1}, grp={2:X}, mask={3:X}",
654 LogHeader, LocalID, PhysBody.collisionGroup, PhysBody.collisionMask);
655 }
652 } 656 }
653 657
654 // Recompute any linkset parameters. 658 // Recompute any linkset parameters.
@@ -691,7 +695,7 @@ public sealed class BSPrim : BSPhysObject
691 // Start it out sleeping and physical actions could wake it up. 695 // Start it out sleeping and physical actions could wake it up.
692 BulletSimAPI.ForceActivationState2(PhysBody.ptr, ActivationState.ISLAND_SLEEPING); 696 BulletSimAPI.ForceActivationState2(PhysBody.ptr, ActivationState.ISLAND_SLEEPING);
693 697
694 PhysBody.collisionFilter = CollisionFilterGroups.StaticObjectFilter; 698 PhysBody.collisionGroup = CollisionFilterGroups.StaticObjectGroup;
695 PhysBody.collisionMask = CollisionFilterGroups.StaticObjectMask; 699 PhysBody.collisionMask = CollisionFilterGroups.StaticObjectMask;
696 } 700 }
697 else 701 else
@@ -737,7 +741,7 @@ public sealed class BSPrim : BSPhysObject
737 BulletSimAPI.ForceActivationState2(PhysBody.ptr, ActivationState.ACTIVE_TAG); 741 BulletSimAPI.ForceActivationState2(PhysBody.ptr, ActivationState.ACTIVE_TAG);
738 // BulletSimAPI.Activate2(BSBody.ptr, true); 742 // BulletSimAPI.Activate2(BSBody.ptr, true);
739 743
740 PhysBody.collisionFilter = CollisionFilterGroups.ObjectFilter; 744 PhysBody.collisionGroup = CollisionFilterGroups.ObjectGroup;
741 PhysBody.collisionMask = CollisionFilterGroups.ObjectMask; 745 PhysBody.collisionMask = CollisionFilterGroups.ObjectMask;
742 } 746 }
743 } 747 }
@@ -765,7 +769,7 @@ public sealed class BSPrim : BSPhysObject
765 m_log.ErrorFormat("{0} MakeSolid: physical body of wrong type for non-solidness. id={1}, type={2}", LogHeader, LocalID, bodyType); 769 m_log.ErrorFormat("{0} MakeSolid: physical body of wrong type for non-solidness. id={1}, type={2}", LogHeader, LocalID, bodyType);
766 } 770 }
767 CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(PhysBody.ptr, CollisionFlags.CF_NO_CONTACT_RESPONSE); 771 CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(PhysBody.ptr, CollisionFlags.CF_NO_CONTACT_RESPONSE);
768 PhysBody.collisionFilter = CollisionFilterGroups.VolumeDetectFilter; 772 PhysBody.collisionGroup = CollisionFilterGroups.VolumeDetectGroup;
769 PhysBody.collisionMask = CollisionFilterGroups.VolumeDetectMask; 773 PhysBody.collisionMask = CollisionFilterGroups.VolumeDetectMask;
770 } 774 }
771 } 775 }