diff options
author | Robert Adams | 2012-12-29 21:43:43 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-31 19:57:21 -0800 |
commit | 48f718f39fcd61501262878a8bcfbd98efed29d2 (patch) | |
tree | aa67dbaf54d75152f01302921bbc42226daaec8b /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: change physical data structures to classes. Add default (diff) | |
download | opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.zip opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.gz opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.bz2 opensim-SC-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.xz |
BulletSim: first round of conversion from direct BulletSimAPI interfacing by BulletSim core to using the BulletSimAPITemplate. Physical object creation and destruction first.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 4133107..bfc9df2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -50,6 +50,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
50 | 50 | ||
51 | public string BulletSimVersion = "?"; | 51 | public string BulletSimVersion = "?"; |
52 | 52 | ||
53 | // The handle to the underlying managed or unmanaged version of Bullet being used. | ||
54 | public BulletSimAPITemplate PE; | ||
55 | |||
53 | public Dictionary<uint, BSPhysObject> PhysObjects; | 56 | public Dictionary<uint, BSPhysObject> PhysObjects; |
54 | public BSShapeCollection Shapes; | 57 | public BSShapeCollection Shapes; |
55 | 58 | ||
@@ -187,12 +190,15 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
187 | 190 | ||
188 | // Allocate pinned memory to pass parameters. | 191 | // Allocate pinned memory to pass parameters. |
189 | UnmanagedParams = new ConfigurationParameters[1]; | 192 | UnmanagedParams = new ConfigurationParameters[1]; |
190 | m_paramsHandle = GCHandle.Alloc(UnmanagedParams, GCHandleType.Pinned); | ||
191 | 193 | ||
192 | // Set default values for physics parameters plus any overrides from the ini file | 194 | // Set default values for physics parameters plus any overrides from the ini file |
193 | GetInitialParameterValues(config); | 195 | GetInitialParameterValues(config); |
194 | 196 | ||
195 | // allocate more pinned memory close to the above in an attempt to get the memory all together | 197 | // For the moment, only one version of the interface |
198 | PE = new BSAPIUnman(); | ||
199 | |||
200 | // Allocate more pinned memory. Do this early to try and get all pinned memory close together. | ||
201 | m_paramsHandle = GCHandle.Alloc(UnmanagedParams, GCHandleType.Pinned); | ||
196 | m_collisionArray = new CollisionDesc[m_maxCollisionsPerFrame]; | 202 | m_collisionArray = new CollisionDesc[m_maxCollisionsPerFrame]; |
197 | m_collisionArrayPinnedHandle = GCHandle.Alloc(m_collisionArray, GCHandleType.Pinned); | 203 | m_collisionArrayPinnedHandle = GCHandle.Alloc(m_collisionArray, GCHandleType.Pinned); |
198 | m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; | 204 | m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; |