diff options
author | Robert Adams | 2012-09-25 15:01:18 -0700 |
---|---|---|
committer | Robert Adams | 2012-09-27 22:01:42 -0700 |
commit | 735d89e3692bb7c620b9e3c248a1dbd5924b8b3f (patch) | |
tree | 0d31723cc7302e4928de6ac69905787099442bf1 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |
parent | BulletSim: renamed members of BulletShape, BulletSim and BulletBody (diff) | |
download | opensim-SC-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.zip opensim-SC-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.tar.gz opensim-SC-735d89e3692bb7c620b9e3c248a1dbd5924b8b3f.tar.bz2 opensim-SC-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 '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index e4b1dd4..961bcde 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -90,7 +90,8 @@ public class BSCharacter : BSPhysObject | |||
90 | // Physics creates a unit capsule which is scaled by the physics engine. | 90 | // Physics creates a unit capsule which is scaled by the physics engine. |
91 | ComputeAvatarScale(_size); | 91 | ComputeAvatarScale(_size); |
92 | _avatarDensity = PhysicsScene.Params.avatarDensity; | 92 | _avatarDensity = PhysicsScene.Params.avatarDensity; |
93 | ComputeAvatarVolumeAndMass(); // set _avatarVolume and _mass based on capsule size, _density and _scale | 93 | // set _avatarVolume and _mass based on capsule size, _density and _scale |
94 | ComputeAvatarVolumeAndMass(); | ||
94 | 95 | ||
95 | ShapeData shapeData = new ShapeData(); | 96 | ShapeData shapeData = new ShapeData(); |
96 | shapeData.ID = LocalID; | 97 | shapeData.ID = LocalID; |
@@ -111,10 +112,15 @@ public class BSCharacter : BSPhysObject | |||
111 | DetailLog("{0},BSCharacter.create,taint", LocalID); | 112 | DetailLog("{0},BSCharacter.create,taint", LocalID); |
112 | BulletSimAPI.CreateObject(PhysicsScene.WorldID, shapeData); | 113 | BulletSimAPI.CreateObject(PhysicsScene.WorldID, shapeData); |
113 | 114 | ||
114 | // Set the buoyancy for flying. This will be refactored when all the settings happen in C# | 115 | // Set the buoyancy for flying. This will be refactored when all the settings happen in C#. |
116 | // If not set at creation, the avatar will stop flying when created after crossing a region boundry. | ||
115 | BulletSimAPI.SetObjectBuoyancy(PhysicsScene.WorldID, LocalID, _buoyancy); | 117 | BulletSimAPI.SetObjectBuoyancy(PhysicsScene.WorldID, LocalID, _buoyancy); |
116 | 118 | ||
117 | BSBody = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(PhysicsScene.World.ptr, LocalID)); | 119 | BSBody = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(PhysicsScene.World.ptr, LocalID)); |
120 | |||
121 | // This works here because CreateObject has already put the character into the physical world. | ||
122 | BulletSimAPI.SetCollisionFilterMask2(BSBody.ptr, | ||
123 | (uint)CollisionFilterGroups.AvatarFilter, (uint)CollisionFilterGroups.AvatarMask); | ||
118 | }); | 124 | }); |
119 | 125 | ||
120 | return; | 126 | return; |