diff options
author | Robert Adams | 2012-09-19 08:21:29 -0700 |
---|---|---|
committer | Robert Adams | 2012-09-27 22:01:21 -0700 |
commit | a27e4ce6cbfb0a2e852624fd4d81121ca829f85c (patch) | |
tree | cd467ddf5dcc8a7109eef5d82f1929c1b5bf77b8 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: Convert BSCharacter to use common BSPhysObject code and variables. (diff) | |
download | opensim-SC-a27e4ce6cbfb0a2e852624fd4d81121ca829f85c.zip opensim-SC-a27e4ce6cbfb0a2e852624fd4d81121ca829f85c.tar.gz opensim-SC-a27e4ce6cbfb0a2e852624fd4d81121ca829f85c.tar.bz2 opensim-SC-a27e4ce6cbfb0a2e852624fd4d81121ca829f85c.tar.xz |
BulletSim: add class and infrastructure for shape and object
tracking in the C# code. Needed for the changing body type
(to and from GhostObjects) for volumeDetect.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index dabced5..76da42d 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -73,8 +73,10 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
73 | 73 | ||
74 | public string BulletSimVersion = "?"; | 74 | public string BulletSimVersion = "?"; |
75 | 75 | ||
76 | public Dictionary<uint, BSPhysObject> PhysObjects = new Dictionary<uint, BSPhysObject>(); | 76 | public Dictionary<uint, BSPhysObject> PhysObjects; |
77 | public BSShapeCollection Shapes; | ||
77 | 78 | ||
79 | // Keeping track of the objects with collisions so we can report begin and end of a collision | ||
78 | public HashSet<BSPhysObject> ObjectsWithCollisions = new HashSet<BSPhysObject>(); | 80 | public HashSet<BSPhysObject> ObjectsWithCollisions = new HashSet<BSPhysObject>(); |
79 | public HashSet<BSPhysObject> ObjectsWithNoMoreCollisions = new HashSet<BSPhysObject>(); | 81 | public HashSet<BSPhysObject> ObjectsWithNoMoreCollisions = new HashSet<BSPhysObject>(); |
80 | // Keep track of all the avatars so we can send them a collision event | 82 | // Keep track of all the avatars so we can send them a collision event |
@@ -203,6 +205,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
203 | 205 | ||
204 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 206 | public override void Initialise(IMesher meshmerizer, IConfigSource config) |
205 | { | 207 | { |
208 | mesher = meshmerizer; | ||
209 | _taintedObjects = new List<TaintCallbackEntry>(); | ||
210 | PhysObjects = new Dictionary<uint, BSPhysObject>(); | ||
211 | Shapes = new BSShapeCollection(this); | ||
212 | |||
206 | // Allocate pinned memory to pass parameters. | 213 | // Allocate pinned memory to pass parameters. |
207 | m_params = new ConfigurationParameters[1]; | 214 | m_params = new ConfigurationParameters[1]; |
208 | m_paramsHandle = GCHandle.Alloc(m_params, GCHandleType.Pinned); | 215 | m_paramsHandle = GCHandle.Alloc(m_params, GCHandleType.Pinned); |
@@ -216,12 +223,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
216 | m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; | 223 | m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; |
217 | m_updateArrayPinnedHandle = GCHandle.Alloc(m_updateArray, GCHandleType.Pinned); | 224 | m_updateArrayPinnedHandle = GCHandle.Alloc(m_updateArray, GCHandleType.Pinned); |
218 | 225 | ||
219 | mesher = meshmerizer; | ||
220 | _taintedObjects = new List<TaintCallbackEntry>(); | ||
221 | |||
222 | // Enable very detailed logging. | 226 | // Enable very detailed logging. |
223 | // By creating an empty logger when not logging, the log message invocation code | 227 | // By creating an empty logger when not logging, the log message invocation code |
224 | // can be left in and every call doesn't have to check for null. | 228 | // can be left in and every call doesn't have to check for null. |
225 | if (m_physicsLoggingEnabled) | 229 | if (m_physicsLoggingEnabled) |
226 | { | 230 | { |
227 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); | 231 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); |
@@ -252,7 +256,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
252 | // a child in a mega-region. | 256 | // a child in a mega-region. |
253 | // Turns out that Bullet really doesn't care about the extents of the simulated | 257 | // Turns out that Bullet really doesn't care about the extents of the simulated |
254 | // area. It tracks active objects no matter where they are. | 258 | // area. It tracks active objects no matter where they are. |
255 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, 8192f); | 259 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); |
256 | 260 | ||
257 | // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); | 261 | // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); |
258 | WorldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(), | 262 | WorldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(), |