aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs2
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs4
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs8
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs14
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs58
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs27
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs9
7 files changed, 78 insertions, 44 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 4f48cfb..f164afe 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -488,7 +488,7 @@ public class BSCharacter : PhysicsActor
488 // Avatars don't report their changes the usual way. Changes are checked for in the heartbeat loop. 488 // Avatars don't report their changes the usual way. Changes are checked for in the heartbeat loop.
489 // base.RequestPhysicsterseUpdate(); 489 // base.RequestPhysicsterseUpdate();
490 490
491 DetailLog("{0},BSCharacter.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", 491 DetailLog("{0},BSCharacter.UpdateProperties,call,pos={1},orient={2},vel={3},accel={4},rotVel={5}",
492 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, 492 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity,
493 entprop.Acceleration, entprop.RotationalVelocity); 493 entprop.Acceleration, entprop.RotationalVelocity);
494 } 494 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
index a17efea..da26b72 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs
@@ -49,7 +49,9 @@ public abstract class BSConstraint : IDisposable
49 if (m_enabled) 49 if (m_enabled)
50 { 50 {
51 // BulletSimAPI.RemoveConstraint(m_world.ID, m_body1.ID, m_body2.ID); 51 // BulletSimAPI.RemoveConstraint(m_world.ID, m_body1.ID, m_body2.ID);
52 BulletSimAPI.DestroyConstraint2(m_world.Ptr, m_constraint.Ptr); 52 bool success = BulletSimAPI.DestroyConstraint2(m_world.Ptr, m_constraint.Ptr);
53 m_world.scene.DetailLog("{0},BSConstraint.Dispose,taint,body1={1},body2={2},success={3}", BSScene.DetailLogZero, m_body1.ID, m_body2.ID, success);
54 m_constraint.Ptr = System.IntPtr.Zero;
53 m_enabled = false; 55 m_enabled = false;
54 } 56 }
55 } 57 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
index 397045a..3df2ddc 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs
@@ -68,6 +68,8 @@ public class BSConstraintCollection : IDisposable
68 // There is only one constraint between any bodies. Remove any old just to make sure. 68 // There is only one constraint between any bodies. Remove any old just to make sure.
69 RemoveAndDestroyConstraint(cons.Body1, cons.Body2); 69 RemoveAndDestroyConstraint(cons.Body1, cons.Body2);
70 70
71 m_world.scene.DetailLog("{0},BSConstraintCollection.AddConstraint,call,body1={1},body2={2}", BSScene.DetailLogZero, cons.Body1.ID, cons.Body2.ID);
72
71 m_constraints.Add(cons); 73 m_constraints.Add(cons);
72 74
73 return true; 75 return true;
@@ -108,6 +110,7 @@ public class BSConstraintCollection : IDisposable
108 110
109 if (this.TryGetConstraint(body1, body2, out constrain)) 111 if (this.TryGetConstraint(body1, body2, out constrain))
110 { 112 {
113 m_world.scene.DetailLog("{0},BSConstraintCollection.RemoveAndDestroyConstraint,taint,body1={1},body2={2}", BSScene.DetailLogZero, body1.ID, body2.ID);
111 // remove the constraint from our collection 114 // remove the constraint from our collection
112 m_constraints.Remove(constrain); 115 m_constraints.Remove(constrain);
113 // tell the engine that all its structures need to be freed 116 // tell the engine that all its structures need to be freed
@@ -148,10 +151,11 @@ public class BSConstraintCollection : IDisposable
148 151
149 public bool RecalculateAllConstraints() 152 public bool RecalculateAllConstraints()
150 { 153 {
151 foreach (BSConstraint constrain in m_constraints) 154 ForEachConstraint(delegate(BSConstraint constrain)
152 { 155 {
153 constrain.CalculateTransforms(); 156 constrain.CalculateTransforms();
154 } 157 return false;
158 });
155 return true; 159 return true;
156 } 160 }
157 161
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index f68e06e..4a71612 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
@@ -44,8 +44,6 @@ public class BSLinkset
44 44
45 private List<BSPrim> m_children; 45 private List<BSPrim> m_children;
46 46
47 public int NumberOfChildren { get { return m_children.Count; } }
48
49 // We lock the diddling of linkset classes to prevent any badness. 47 // We lock the diddling of linkset classes to prevent any badness.
50 // This locks the modification of the instances of this class. Changes 48 // This locks the modification of the instances of this class. Changes
51 // to the physical representation is done via the tainting mechenism. 49 // to the physical representation is done via the tainting mechenism.
@@ -83,14 +81,14 @@ public class BSLinkset
83 81
84 // Link to a linkset where the child knows the parent. 82 // Link to a linkset where the child knows the parent.
85 // Parent changing should not happen so do some sanity checking. 83 // Parent changing should not happen so do some sanity checking.
86 // We return the parent's linkset so the child can track it's membership. 84 // We return the parent's linkset so the child can track its membership.
87 public BSLinkset AddMeToLinkset(BSPrim child, BSPrim parent) 85 public BSLinkset AddMeToLinkset(BSPrim child)
88 { 86 {
89 lock (m_linksetActivityLock) 87 lock (m_linksetActivityLock)
90 { 88 {
91 parent.Linkset.AddChildToLinkset(child); 89 AddChildToLinkset(child);
92 } 90 }
93 return parent.Linkset; 91 return this;
94 } 92 }
95 93
96 public BSLinkset RemoveMeFromLinkset(BSPrim child) 94 public BSLinkset RemoveMeFromLinkset(BSPrim child)
@@ -176,6 +174,8 @@ public class BSLinkset
176 return (requestor.LocalID == m_linksetRoot.LocalID); 174 return (requestor.LocalID == m_linksetRoot.LocalID);
177 } 175 }
178 176
177 public int NumberOfChildren { get { return m_children.Count; } }
178
179 // Return 'true' if this linkset has any children (more than the root member) 179 // Return 'true' if this linkset has any children (more than the root member)
180 public bool HasAnyChildren { get { return (m_children.Count > 0); } } 180 public bool HasAnyChildren { get { return (m_children.Count > 0); } }
181 181
@@ -303,7 +303,7 @@ public class BSLinkset
303 // create a constraint that allows no freedom of movement between the two objects 303 // create a constraint that allows no freedom of movement between the two objects
304 // http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=4818 304 // http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=4818
305 // DebugLog("{0}: CreateLinkset: Adding a constraint between root prim {1} and child prim {2}", LogHeader, LocalID, childPrim.LocalID); 305 // DebugLog("{0}: CreateLinkset: Adding a constraint between root prim {1} and child prim {2}", LogHeader, LocalID, childPrim.LocalID);
306 DetailLog("{0},LinkAChildToMe,taint,root={1},child={2}", rootPrim.LocalID, rootPrim.LocalID, childPrim.LocalID); 306 DetailLog("{0},PhysicallyLinkAChildToRoot,taint,root={1},child={2}", rootPrim.LocalID, rootPrim.LocalID, childPrim.LocalID);
307 BS6DofConstraint constrain = new BS6DofConstraint( 307 BS6DofConstraint constrain = new BS6DofConstraint(
308 m_scene.World, rootPrim.Body, childPrim.Body, 308 m_scene.World, rootPrim.Body, childPrim.Body,
309 childRelativePosition, 309 childRelativePosition,
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 4193d22..05cc822 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -138,13 +138,14 @@ public sealed class BSPrim : PhysicsActor
138 _isPhysical = pisPhysical; 138 _isPhysical = pisPhysical;
139 _isVolumeDetect = false; 139 _isVolumeDetect = false;
140 _subscribedEventsMs = 0; 140 _subscribedEventsMs = 0;
141 _friction = _scene.Params.defaultFriction; // TODO: compute based on object material 141 _friction = _scene.Params.defaultFriction; // TODO: compute based on object material
142 _density = _scene.Params.defaultDensity; // TODO: compute based on object material 142 _density = _scene.Params.defaultDensity; // TODO: compute based on object material
143 _restitution = _scene.Params.defaultRestitution; 143 _restitution = _scene.Params.defaultRestitution;
144 _linkset = new BSLinkset(_scene, this); // a linkset of one 144 _linkset = new BSLinkset(_scene, this); // a linkset of one
145 _vehicle = new BSDynamics(this); // add vehicleness 145 _vehicle = new BSDynamics(this); // add vehicleness
146 _mass = CalculateMass(); 146 _mass = CalculateMass();
147 // do the actual object creation at taint time 147 // do the actual object creation at taint time
148 DetailLog("{0},BSPrim.constructor,call", LocalID);
148 _scene.TaintedObject("BSPrim.create", delegate() 149 _scene.TaintedObject("BSPrim.create", delegate()
149 { 150 {
150 RecreateGeomAndObject(); 151 RecreateGeomAndObject();
@@ -160,19 +161,22 @@ public sealed class BSPrim : PhysicsActor
160 public void Destroy() 161 public void Destroy()
161 { 162 {
162 // m_log.DebugFormat("{0}: Destroy, id={1}", LogHeader, LocalID); 163 // m_log.DebugFormat("{0}: Destroy, id={1}", LogHeader, LocalID);
163 // DetailLog("{0},BSPrim.Destroy", LocalID);
164
165 // Undo any vehicle properties
166 _vehicle.ProcessTypeChange(Vehicle.TYPE_NONE);
167 _scene.RemoveVehiclePrim(this); // just to make sure
168 164
169 // Undo any links between me and any other object 165 // Undo any links between me and any other object
166 BSPrim parentBefore = _linkset.Root;
167 int childrenBefore = _linkset.NumberOfChildren;
168
170 _linkset = _linkset.RemoveMeFromLinkset(this); 169 _linkset = _linkset.RemoveMeFromLinkset(this);
171 170
171 DetailLog("{0},BSPrim.Destroy,call,parentBefore={1},childrenBefore={2},parentAfter={3},childrenAfter={4}",
172 LocalID, parentBefore.LocalID, childrenBefore, _linkset.Root.LocalID, _linkset.NumberOfChildren);
173
174 // Undo any vehicle properties
175 this.VehicleType = (int)Vehicle.TYPE_NONE;
176
172 _scene.TaintedObject("BSPrim.destroy", delegate() 177 _scene.TaintedObject("BSPrim.destroy", delegate()
173 { 178 {
174 DetailLog("{0},BSPrim.Destroy,taint,", LocalID); 179 DetailLog("{0},BSPrim.Destroy,taint,", LocalID);
175
176 // everything in the C# world will get garbage collected. Tell the C++ world to free stuff. 180 // everything in the C# world will get garbage collected. Tell the C++ world to free stuff.
177 BulletSimAPI.DestroyObject(_scene.WorldID, LocalID); 181 BulletSimAPI.DestroyObject(_scene.WorldID, LocalID);
178 }); 182 });
@@ -229,8 +233,13 @@ public sealed class BSPrim : PhysicsActor
229 if (parent != null) 233 if (parent != null)
230 { 234 {
231 DebugLog("{0}: link {1}/{2} to {3}", LogHeader, _avName, _localID, parent.LocalID); 235 DebugLog("{0}: link {1}/{2} to {3}", LogHeader, _avName, _localID, parent.LocalID);
232 DetailLog("{0},BSPrim.link,parent={1}", LocalID, parent.LocalID); 236 BSPrim parentBefore = _linkset.Root;
233 _linkset = _linkset.AddMeToLinkset(this, parent); 237 int childrenBefore = _linkset.NumberOfChildren;
238
239 _linkset = parent.Linkset.AddMeToLinkset(this);
240
241 DetailLog("{0},BSPrim.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}",
242 LocalID, parentBefore.LocalID, childrenBefore, _linkset.Root.LocalID, _linkset.NumberOfChildren);
234 } 243 }
235 return; 244 return;
236 } 245 }
@@ -340,21 +349,14 @@ public sealed class BSPrim : PhysicsActor
340 } 349 }
341 set { 350 set {
342 Vehicle type = (Vehicle)value; 351 Vehicle type = (Vehicle)value;
343 _scene.TaintedObject("BSPrim.setVehicleType", delegate() 352 BSPrim vehiclePrim = this;
353 _scene.TaintedObject("setVehicleType", delegate()
344 { 354 {
345 DetailLog("{0},BSPrim.SetVehicleType,taint,type={1}", LocalID, type); 355 // Done at taint time so we're sure the physics engine is not using the variables
356 // Vehicle code changes the parameters for this vehicle type.
346 _vehicle.ProcessTypeChange(type); 357 _vehicle.ProcessTypeChange(type);
347 if (type == Vehicle.TYPE_NONE) 358 // Tell the scene about the vehicle so it will get processing each frame.
348 { 359 _scene.VehicleInSceneTypeChanged(this, type);
349 _scene.RemoveVehiclePrim(this);
350 }
351 else
352 {
353 BulletSimAPI.ClearForces2(this.Body.Ptr);
354 // make it so the scene will call us each tick to do vehicle things
355 _scene.AddVehiclePrim(this);
356 }
357 return;
358 }); 360 });
359 } 361 }
360 } 362 }
@@ -493,8 +495,10 @@ public sealed class BSPrim : PhysicsActor
493 // Bullet wants static objects to have a mass of zero 495 // Bullet wants static objects to have a mass of zero
494 float mass = IsStatic ? 0f : _mass; 496 float mass = IsStatic ? 0f : _mass;
495 497
496 DetailLog("{0},BSPrim.SetObjectDynamic,taint,static={1},solid={2},mass={3}", LocalID, IsStatic, IsSolid, mass);
497 BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass); 498 BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);
499
500 CollisionFlags cf = BulletSimAPI.GetCollisionFlags2(Body.Ptr);
501 DetailLog("{0},BSPrim.SetObjectDynamic,taint,static={1},solid={2},mass={3}, cf={4}", LocalID, IsStatic, IsSolid, mass, cf);
498 } 502 }
499 503
500 // prims don't fly 504 // prims don't fly
@@ -1224,7 +1228,7 @@ public sealed class BSPrim : PhysicsActor
1224 bool ret = BulletSimAPI.CreateObject(_scene.WorldID, shape); 1228 bool ret = BulletSimAPI.CreateObject(_scene.WorldID, shape);
1225 1229
1226 // the CreateObject() may have recreated the rigid body. Make sure we have the latest. 1230 // the CreateObject() may have recreated the rigid body. Make sure we have the latest.
1227 m_body.Ptr = BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID); 1231 Body = new BulletBody(LocalID, BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID));
1228 1232
1229 return ret; 1233 return ret;
1230 } 1234 }
@@ -1344,7 +1348,7 @@ public sealed class BSPrim : PhysicsActor
1344 else 1348 else
1345 { 1349 {
1346 // For debugging, we also report the movement of children 1350 // For debugging, we also report the movement of children
1347 DetailLog("{0},BSPrim.BSPrim.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", 1351 DetailLog("{0},BSPrim.UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}",
1348 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, 1352 LocalID, entprop.Position, entprop.Rotation, entprop.Velocity,
1349 entprop.Acceleration, entprop.RotationalVelocity); 1353 entprop.Acceleration, entprop.RotationalVelocity);
1350 } 1354 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 65a8014..beaea1f 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -255,7 +255,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
255 255
256 // Initialization to support the transition to a new API which puts most of the logic 256 // Initialization to support the transition to a new API which puts most of the logic
257 // into the C# code so it is easier to modify and add to. 257 // into the C# code so it is easier to modify and add to.
258 m_worldSim = new BulletSim(m_worldID, BulletSimAPI.GetSimHandle2(m_worldID)); 258 m_worldSim = new BulletSim(m_worldID, this, BulletSimAPI.GetSimHandle2(m_worldID));
259 m_constraintCollection = new BSConstraintCollection(World); 259 m_constraintCollection = new BSConstraintCollection(World);
260 260
261 m_initialized = true; 261 m_initialized = true;
@@ -362,6 +362,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
362 BSPrim bsprim = prim as BSPrim; 362 BSPrim bsprim = prim as BSPrim;
363 if (bsprim != null) 363 if (bsprim != null)
364 { 364 {
365 DetailLog("{0},RemovePrim,call", bsprim.LocalID);
365 // m_log.DebugFormat("{0}: RemovePrim. id={1}/{2}", LogHeader, bsprim.Name, bsprim.LocalID); 366 // m_log.DebugFormat("{0}: RemovePrim. id={1}/{2}", LogHeader, bsprim.Name, bsprim.LocalID);
366 try 367 try
367 { 368 {
@@ -387,6 +388,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters
387 388
388 if (!m_initialized) return null; 389 if (!m_initialized) return null;
389 390
391 DetailLog("{0},AddPrimShape,call", localID);
392
390 BSPrim prim = new BSPrim(localID, primName, this, position, size, rotation, pbs, isPhysical); 393 BSPrim prim = new BSPrim(localID, primName, this, position, size, rotation, pbs, isPhysical);
391 lock (m_prims) m_prims.Add(localID, prim); 394 lock (m_prims) m_prims.Add(localID, prim);
392 return prim; 395 return prim;
@@ -426,12 +429,12 @@ public class BSScene : PhysicsScene, IPhysicsParameters
426 { 429 {
427 numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep, 430 numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep,
428 out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); 431 out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr);
429 DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount); 432 DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", DetailLogZero, numSubSteps, updatedEntityCount, collidersCount);
430 } 433 }
431 catch (Exception e) 434 catch (Exception e)
432 { 435 {
433 m_log.WarnFormat("{0},PhysicsStep Exception: substeps={1}, updates={2}, colliders={3}, e={4}", LogHeader, numSubSteps, updatedEntityCount, collidersCount, e); 436 m_log.WarnFormat("{0},PhysicsStep Exception: substeps={1}, updates={2}, colliders={3}, e={4}", LogHeader, numSubSteps, updatedEntityCount, collidersCount, e);
434 DetailLog("{0},PhysicsStepException,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount); 437 DetailLog("{0},PhysicsStepException,call, substeps={1}, updates={2}, colliders={3}", DetailLogZero, numSubSteps, updatedEntityCount, collidersCount);
435 // updatedEntityCount = 0; 438 // updatedEntityCount = 0;
436 collidersCount = 0; 439 collidersCount = 0;
437 } 440 }
@@ -777,6 +780,20 @@ public class BSScene : PhysicsScene, IPhysicsParameters
777 } 780 }
778 781
779 #region Vehicles 782 #region Vehicles
783
784 public void VehicleInSceneTypeChanged(BSPrim vehic, Vehicle newType)
785 {
786 if (newType == Vehicle.TYPE_NONE)
787 {
788 RemoveVehiclePrim(vehic);
789 }
790 else
791 {
792 // make it so the scene will call us each tick to do vehicle things
793 AddVehiclePrim(vehic);
794 }
795 }
796
780 // Make so the scene will call this prim for vehicle actions each tick. 797 // Make so the scene will call this prim for vehicle actions each tick.
781 // Safe to call if prim is already in the vehicle list. 798 // Safe to call if prim is already in the vehicle list.
782 public void AddVehiclePrim(BSPrim vehicle) 799 public void AddVehiclePrim(BSPrim vehicle)
@@ -1304,10 +1321,12 @@ public class BSScene : PhysicsScene, IPhysicsParameters
1304 #endregion Runtime settable parameters 1321 #endregion Runtime settable parameters
1305 1322
1306 // Invoke the detailed logger and output something if it's enabled. 1323 // Invoke the detailed logger and output something if it's enabled.
1307 private void DetailLog(string msg, params Object[] args) 1324 public void DetailLog(string msg, params Object[] args)
1308 { 1325 {
1309 PhysicsLogging.Write(msg, args); 1326 PhysicsLogging.Write(msg, args);
1310 } 1327 }
1328 // used to fill in the LocalID when there isn't one
1329 public const string DetailLogZero = "0000000000";
1311 1330
1312} 1331}
1313} 1332}
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
index c016402..6800b96 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
@@ -35,9 +35,11 @@ namespace OpenSim.Region.Physics.BulletSPlugin {
35// Classes to allow some type checking for the API 35// Classes to allow some type checking for the API
36public struct BulletSim 36public struct BulletSim
37{ 37{
38 public BulletSim(uint id, IntPtr xx) { ID = id; Ptr = xx; } 38 public BulletSim(uint id, BSScene bss, IntPtr xx) { ID = id; scene = bss; Ptr = xx; }
39 public IntPtr Ptr;
40 public uint ID; 39 public uint ID;
40 // The scene is only in here so very low level routines have a handle to print debug/error messages
41 public BSScene scene;
42 public IntPtr Ptr;
41} 43}
42 44
43public struct BulletBody 45public struct BulletBody
@@ -492,6 +494,9 @@ public static extern bool SetLinearVelocity2(IntPtr obj, Vector3 val);
492public static extern bool SetInterpolation2(IntPtr obj, Vector3 lin, Vector3 ang); 494public static extern bool SetInterpolation2(IntPtr obj, Vector3 lin, Vector3 ang);
493 495
494[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 496[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
497public static extern CollisionFlags GetCollisionFlags2(IntPtr obj);
498
499[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
495public static extern IntPtr SetCollisionFlags2(IntPtr obj, CollisionFlags flags); 500public static extern IntPtr SetCollisionFlags2(IntPtr obj, CollisionFlags flags);
496 501
497[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 502[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]