diff options
author | Robert Adams | 2012-12-24 20:18:06 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-24 20:18:06 -0800 |
commit | bbc5a5089f79a4c5543f4a3f1cd4ffaf1de8c07e (patch) | |
tree | 508491dfb64055fde104f5f4459feeaee7a8526c /OpenSim/Region/Physics | |
parent | BulletSim: Default avatar density changed to 3.5 which is WAY closer (diff) | |
download | opensim-SC_OLD-bbc5a5089f79a4c5543f4a3f1cd4ffaf1de8c07e.zip opensim-SC_OLD-bbc5a5089f79a4c5543f4a3f1cd4ffaf1de8c07e.tar.gz opensim-SC_OLD-bbc5a5089f79a4c5543f4a3f1cd4ffaf1de8c07e.tar.bz2 opensim-SC_OLD-bbc5a5089f79a4c5543f4a3f1cd4ffaf1de8c07e.tar.xz |
BulletSim: Rename some of the interface structures (BulletWorld, ...)
to get ready for...
Start creation of BulletAPITemplate. This defines the abstract interface
functions. Following commits will move over to the new interface.
This will enable switching between the managed and unmanaged version of
Bullet.
Diffstat (limited to 'OpenSim/Region/Physics')
9 files changed, 412 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs index e77fb50..59584b2 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |||
@@ -36,7 +36,7 @@ public abstract class BSConstraint : IDisposable | |||
36 | { | 36 | { |
37 | private static string LogHeader = "[BULLETSIM CONSTRAINT]"; | 37 | private static string LogHeader = "[BULLETSIM CONSTRAINT]"; |
38 | 38 | ||
39 | protected BulletSim m_world; | 39 | protected BulletWorld m_world; |
40 | protected BulletBody m_body1; | 40 | protected BulletBody m_body1; |
41 | protected BulletBody m_body2; | 41 | protected BulletBody m_body2; |
42 | protected BulletConstraint m_constraint; | 42 | protected BulletConstraint m_constraint; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint6Dof.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint6Dof.cs index b073555..b946870 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint6Dof.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint6Dof.cs | |||
@@ -39,7 +39,7 @@ public sealed class BSConstraint6Dof : BSConstraint | |||
39 | public override ConstraintType Type { get { return ConstraintType.D6_CONSTRAINT_TYPE; } } | 39 | public override ConstraintType Type { get { return ConstraintType.D6_CONSTRAINT_TYPE; } } |
40 | 40 | ||
41 | // Create a btGeneric6DofConstraint | 41 | // Create a btGeneric6DofConstraint |
42 | public BSConstraint6Dof(BulletSim world, BulletBody obj1, BulletBody obj2, | 42 | public BSConstraint6Dof(BulletWorld world, BulletBody obj1, BulletBody obj2, |
43 | Vector3 frame1, Quaternion frame1rot, | 43 | Vector3 frame1, Quaternion frame1rot, |
44 | Vector3 frame2, Quaternion frame2rot, | 44 | Vector3 frame2, Quaternion frame2rot, |
45 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | 45 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
@@ -58,7 +58,7 @@ public sealed class BSConstraint6Dof : BSConstraint | |||
58 | obj1.ID, obj1.ptr.ToString("X"), obj2.ID, obj2.ptr.ToString("X")); | 58 | obj1.ID, obj1.ptr.ToString("X"), obj2.ID, obj2.ptr.ToString("X")); |
59 | } | 59 | } |
60 | 60 | ||
61 | public BSConstraint6Dof(BulletSim world, BulletBody obj1, BulletBody obj2, | 61 | public BSConstraint6Dof(BulletWorld world, BulletBody obj1, BulletBody obj2, |
62 | Vector3 joinPoint, | 62 | Vector3 joinPoint, |
63 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | 63 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
64 | { | 64 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs index a9fd826..2aeff25 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs | |||
@@ -41,9 +41,9 @@ public sealed class BSConstraintCollection : IDisposable | |||
41 | delegate bool ConstraintAction(BSConstraint constrain); | 41 | delegate bool ConstraintAction(BSConstraint constrain); |
42 | 42 | ||
43 | private List<BSConstraint> m_constraints; | 43 | private List<BSConstraint> m_constraints; |
44 | private BulletSim m_world; | 44 | private BulletWorld m_world; |
45 | 45 | ||
46 | public BSConstraintCollection(BulletSim world) | 46 | public BSConstraintCollection(BulletWorld world) |
47 | { | 47 | { |
48 | m_world = world; | 48 | m_world = world; |
49 | m_constraints = new List<BSConstraint>(); | 49 | m_constraints = new List<BSConstraint>(); |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintHinge.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintHinge.cs index ed3ffa7..a5378b9 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintHinge.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraintHinge.cs | |||
@@ -36,7 +36,7 @@ public sealed class BSConstraintHinge : BSConstraint | |||
36 | { | 36 | { |
37 | public override ConstraintType Type { get { return ConstraintType.HINGE_CONSTRAINT_TYPE; } } | 37 | public override ConstraintType Type { get { return ConstraintType.HINGE_CONSTRAINT_TYPE; } } |
38 | 38 | ||
39 | public BSConstraintHinge(BulletSim world, BulletBody obj1, BulletBody obj2, | 39 | public BSConstraintHinge(BulletWorld world, BulletBody obj1, BulletBody obj2, |
40 | Vector3 pivotInA, Vector3 pivotInB, | 40 | Vector3 pivotInA, Vector3 pivotInB, |
41 | Vector3 axisInA, Vector3 axisInB, | 41 | Vector3 axisInA, Vector3 axisInB, |
42 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | 42 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index e8e0d50..0022e45 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -74,7 +74,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
74 | 74 | ||
75 | public IMesher mesher; | 75 | public IMesher mesher; |
76 | public uint WorldID { get; private set; } | 76 | public uint WorldID { get; private set; } |
77 | public BulletSim World { get; private set; } | 77 | public BulletWorld World { get; private set; } |
78 | 78 | ||
79 | // All the constraints that have been allocated in this instance. | 79 | // All the constraints that have been allocated in this instance. |
80 | public BSConstraintCollection Constraints { get; private set; } | 80 | public BSConstraintCollection Constraints { get; private set; } |
@@ -242,7 +242,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
242 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); | 242 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); |
243 | 243 | ||
244 | // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); | 244 | // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); |
245 | World = new BulletSim(0, this, BulletSimAPI.Initialize2(worldExtent, m_paramsHandle.AddrOfPinnedObject(), | 245 | World = new BulletWorld(0, this, BulletSimAPI.Initialize2(worldExtent, m_paramsHandle.AddrOfPinnedObject(), |
246 | m_maxCollisionsPerFrame, m_collisionArrayPinnedHandle.AddrOfPinnedObject(), | 246 | m_maxCollisionsPerFrame, m_collisionArrayPinnedHandle.AddrOfPinnedObject(), |
247 | m_maxUpdatesPerFrame, m_updateArrayPinnedHandle.AddrOfPinnedObject(), | 247 | m_maxUpdatesPerFrame, m_updateArrayPinnedHandle.AddrOfPinnedObject(), |
248 | m_DebugLogCallbackHandle)); | 248 | m_DebugLogCallbackHandle)); |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index 939d5e9..65ebcaa 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -98,7 +98,7 @@ public sealed class BSShapeCollection : IDisposable | |||
98 | // higher level dependencies on the shape or body. Mostly used for LinkSets to | 98 | // higher level dependencies on the shape or body. Mostly used for LinkSets to |
99 | // remove the physical constraints before the body is destroyed. | 99 | // remove the physical constraints before the body is destroyed. |
100 | // Called at taint-time!! | 100 | // Called at taint-time!! |
101 | public bool GetBodyAndShape(bool forceRebuild, BulletSim sim, BSPhysObject prim, | 101 | public bool GetBodyAndShape(bool forceRebuild, BulletWorld sim, BSPhysObject prim, |
102 | ShapeDestructionCallback shapeCallback, BodyDestructionCallback bodyCallback) | 102 | ShapeDestructionCallback shapeCallback, BodyDestructionCallback bodyCallback) |
103 | { | 103 | { |
104 | PhysicsScene.AssertInTaintTime("BSShapeCollection.GetBodyAndShape"); | 104 | PhysicsScene.AssertInTaintTime("BSShapeCollection.GetBodyAndShape"); |
@@ -126,7 +126,7 @@ public sealed class BSShapeCollection : IDisposable | |||
126 | return ret; | 126 | return ret; |
127 | } | 127 | } |
128 | 128 | ||
129 | public bool GetBodyAndShape(bool forceRebuild, BulletSim sim, BSPhysObject prim) | 129 | public bool GetBodyAndShape(bool forceRebuild, BulletWorld sim, BSPhysObject prim) |
130 | { | 130 | { |
131 | return GetBodyAndShape(forceRebuild, sim, prim, null, null); | 131 | return GetBodyAndShape(forceRebuild, sim, prim, null, null); |
132 | } | 132 | } |
@@ -918,7 +918,7 @@ public sealed class BSShapeCollection : IDisposable | |||
918 | // Updates prim.BSBody with the information about the new body if one is created. | 918 | // Updates prim.BSBody with the information about the new body if one is created. |
919 | // Returns 'true' if an object was actually created. | 919 | // Returns 'true' if an object was actually created. |
920 | // Called at taint-time. | 920 | // Called at taint-time. |
921 | private bool CreateBody(bool forceRebuild, BSPhysObject prim, BulletSim sim, BulletShape shape, | 921 | private bool CreateBody(bool forceRebuild, BSPhysObject prim, BulletWorld sim, BulletShape shape, |
922 | BodyDestructionCallback bodyCallback) | 922 | BodyDestructionCallback bodyCallback) |
923 | { | 923 | { |
924 | bool ret = false; | 924 | bool ret = false; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 7857eaa..afe5bca 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |||
@@ -288,6 +288,398 @@ public enum ConstraintParamAxis : int | |||
288 | AXIS_ALL | 288 | AXIS_ALL |
289 | }; | 289 | }; |
290 | 290 | ||
291 | public abstract class BulletSimAPITemplate | ||
292 | { | ||
293 | // Initialization and simulation | ||
294 | public abstract BulletWorld Initialize2(Vector3 maxPosition, IntPtr parms, | ||
295 | int maxCollisions, IntPtr collisionArray, | ||
296 | int maxUpdates, IntPtr updateArray | ||
297 | ); | ||
298 | |||
299 | public abstract bool UpdateParameter2(BulletWorld world, uint localID, String parm, float value); | ||
300 | |||
301 | public abstract void SetHeightMap2(BulletWorld world, float[] heightmap); | ||
302 | |||
303 | public abstract void Shutdown2(BulletWorld sim); | ||
304 | |||
305 | public abstract int PhysicsStep2(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, | ||
306 | out int updatedEntityCount, | ||
307 | out IntPtr updatedEntitiesPtr, | ||
308 | out int collidersCount, | ||
309 | out IntPtr collidersPtr); | ||
310 | |||
311 | public abstract bool PushUpdate2(BulletBody obj); | ||
312 | |||
313 | // ===================================================================================== | ||
314 | // Mesh, hull, shape and body creation helper routines | ||
315 | public abstract BulletShape CreateMeshShape2(BulletWorld world, | ||
316 | int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | ||
317 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); | ||
318 | |||
319 | public abstract BulletShape CreateHullShape2(BulletWorld world, | ||
320 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | ||
321 | |||
322 | public abstract BulletShape BuildHullShapeFromMesh2(BulletWorld world, BulletShape meshShape); | ||
323 | |||
324 | public abstract BulletShape BuildNativeShape2(BulletWorld world, ShapeData shapeData); | ||
325 | |||
326 | public abstract bool IsNativeShape2(BulletShape shape); | ||
327 | |||
328 | public abstract void SetShapeCollisionMargin(BulletShape shape, float margin); | ||
329 | |||
330 | public abstract BulletShape BuildCapsuleShape2(BulletWorld world, float radius, float height, Vector3 scale); | ||
331 | |||
332 | public abstract BulletShape CreateCompoundShape2(BulletWorld sim, bool enableDynamicAabbTree); | ||
333 | |||
334 | public abstract int GetNumberOfCompoundChildren2(BulletShape cShape); | ||
335 | |||
336 | public abstract void AddChildShapeToCompoundShape2(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot); | ||
337 | |||
338 | public abstract BulletShape GetChildShapeFromCompoundShapeIndex2(BulletShape cShape, int indx); | ||
339 | |||
340 | public abstract BulletShape RemoveChildShapeFromCompoundShapeIndex2(BulletShape cShape, int indx); | ||
341 | |||
342 | public abstract void RemoveChildShapeFromCompoundShape2(BulletShape cShape, BulletShape removeShape); | ||
343 | |||
344 | public abstract void RecalculateCompoundShapeLocalAabb2(BulletShape cShape); | ||
345 | |||
346 | public abstract BulletShape DuplicateCollisionShape2(BulletWorld sim, BulletShape srcShape, uint id); | ||
347 | |||
348 | public abstract BulletBody CreateBodyFromShapeAndInfo2(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo); | ||
349 | |||
350 | public abstract bool DeleteCollisionShape2(BulletWorld world, BulletShape shape); | ||
351 | |||
352 | public abstract int GetBodyType2(BulletBody obj); | ||
353 | |||
354 | public abstract BulletBody CreateBodyFromShape2(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
355 | |||
356 | public abstract BulletBody CreateBodyWithDefaultMotionState2(BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
357 | |||
358 | public abstract BulletBody CreateGhostFromShape2(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
359 | |||
360 | public abstract IntPtr AllocateBodyInfo2(BulletBody obj); | ||
361 | |||
362 | public abstract void ReleaseBodyInfo2(IntPtr obj); | ||
363 | |||
364 | public abstract void DestroyObject2(BulletWorld sim, BulletBody obj); | ||
365 | |||
366 | // ===================================================================================== | ||
367 | // Terrain creation and helper routines | ||
368 | public abstract IntPtr CreateHeightMapInfo2(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
369 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
370 | |||
371 | public abstract IntPtr FillHeightMapInfo2(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
372 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
373 | |||
374 | public abstract bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); | ||
375 | |||
376 | public abstract BulletBody CreateGroundPlaneShape2(uint id, float height, float collisionMargin); | ||
377 | |||
378 | public abstract BulletBody CreateTerrainShape2(IntPtr mapInfo); | ||
379 | |||
380 | // ===================================================================================== | ||
381 | // Constraint creation and helper routines | ||
382 | public abstract BulletConstraint Create6DofConstraint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
383 | Vector3 frame1loc, Quaternion frame1rot, | ||
384 | Vector3 frame2loc, Quaternion frame2rot, | ||
385 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
386 | |||
387 | public abstract BulletConstraint Create6DofConstraintToPoint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
388 | Vector3 joinPoint, | ||
389 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
390 | |||
391 | public abstract BulletConstraint CreateHingeConstraint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
392 | Vector3 pivotinA, Vector3 pivotinB, | ||
393 | Vector3 axisInA, Vector3 axisInB, | ||
394 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
395 | |||
396 | public abstract void SetConstraintEnable2(BulletConstraint constrain, float numericTrueFalse); | ||
397 | |||
398 | public abstract void SetConstraintNumSolverIterations2(BulletConstraint constrain, float iterations); | ||
399 | |||
400 | public abstract bool SetFrames2(BulletConstraint constrain, | ||
401 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); | ||
402 | |||
403 | public abstract bool SetLinearLimits2(BulletConstraint constrain, Vector3 low, Vector3 hi); | ||
404 | |||
405 | public abstract bool SetAngularLimits2(BulletConstraint constrain, Vector3 low, Vector3 hi); | ||
406 | |||
407 | public abstract bool UseFrameOffset2(BulletConstraint constrain, float enable); | ||
408 | |||
409 | public abstract bool TranslationalLimitMotor2(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce); | ||
410 | |||
411 | public abstract bool SetBreakingImpulseThreshold2(BulletConstraint constrain, float threshold); | ||
412 | |||
413 | public abstract bool CalculateTransforms2(BulletConstraint constrain); | ||
414 | |||
415 | public abstract bool SetConstraintParam2(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | ||
416 | |||
417 | public abstract bool DestroyConstraint2(BulletWorld world, BulletConstraint constrain); | ||
418 | |||
419 | // ===================================================================================== | ||
420 | // btCollisionWorld entries | ||
421 | public abstract void UpdateSingleAabb2(BulletWorld world, BulletBody obj); | ||
422 | |||
423 | public abstract void UpdateAabbs2(BulletWorld world); | ||
424 | |||
425 | public abstract bool GetForceUpdateAllAabbs2(BulletWorld world); | ||
426 | |||
427 | public abstract void SetForceUpdateAllAabbs2(BulletWorld world, bool force); | ||
428 | |||
429 | // ===================================================================================== | ||
430 | // btDynamicsWorld entries | ||
431 | public abstract bool AddObjectToWorld2(BulletWorld world, BulletBody obj); | ||
432 | |||
433 | public abstract bool RemoveObjectFromWorld2(BulletWorld world, BulletBody obj); | ||
434 | |||
435 | public abstract bool AddConstraintToWorld2(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); | ||
436 | |||
437 | public abstract bool RemoveConstraintFromWorld2(BulletWorld world, BulletConstraint constrain); | ||
438 | // ===================================================================================== | ||
439 | // btCollisionObject entries | ||
440 | public abstract Vector3 GetAnisotripicFriction2(BulletConstraint constrain); | ||
441 | |||
442 | public abstract Vector3 SetAnisotripicFriction2(BulletConstraint constrain, Vector3 frict); | ||
443 | |||
444 | public abstract bool HasAnisotripicFriction2(BulletConstraint constrain); | ||
445 | |||
446 | public abstract void SetContactProcessingThreshold2(BulletBody obj, float val); | ||
447 | |||
448 | public abstract float GetContactProcessingThreshold2(BulletBody obj); | ||
449 | |||
450 | public abstract bool IsStaticObject2(BulletBody obj); | ||
451 | |||
452 | public abstract bool IsKinematicObject2(BulletBody obj); | ||
453 | |||
454 | public abstract bool IsStaticOrKinematicObject2(BulletBody obj); | ||
455 | |||
456 | public abstract bool HasContactResponse2(BulletBody obj); | ||
457 | |||
458 | public abstract void SetCollisionShape2(BulletWorld sim, BulletBody obj, BulletBody shape); | ||
459 | |||
460 | public abstract BulletShape GetCollisionShape2(BulletBody obj); | ||
461 | |||
462 | public abstract int GetActivationState2(BulletBody obj); | ||
463 | |||
464 | public abstract void SetActivationState2(BulletBody obj, int state); | ||
465 | |||
466 | public abstract void SetDeactivationTime2(BulletBody obj, float dtime); | ||
467 | |||
468 | public abstract float GetDeactivationTime2(BulletBody obj); | ||
469 | |||
470 | public abstract void ForceActivationState2(BulletBody obj, ActivationState state); | ||
471 | |||
472 | public abstract void Activate2(BulletBody obj, bool forceActivation); | ||
473 | |||
474 | public abstract bool IsActive2(BulletBody obj); | ||
475 | |||
476 | public abstract void SetRestitution2(BulletBody obj, float val); | ||
477 | |||
478 | public abstract float GetRestitution2(BulletBody obj); | ||
479 | |||
480 | public abstract void SetFriction2(BulletBody obj, float val); | ||
481 | |||
482 | public abstract float GetFriction2(BulletBody obj); | ||
483 | |||
484 | /* Haven't defined the type 'Transform' | ||
485 | public abstract Transform GetWorldTransform2(BulletBody obj); | ||
486 | |||
487 | public abstract void setWorldTransform2(BulletBody obj, Transform trans); | ||
488 | */ | ||
489 | |||
490 | public abstract Vector3 GetPosition2(BulletBody obj); | ||
491 | |||
492 | public abstract Quaternion GetOrientation2(BulletBody obj); | ||
493 | |||
494 | public abstract void SetTranslation2(BulletBody obj, Vector3 position, Quaternion rotation); | ||
495 | |||
496 | public abstract IntPtr GetBroadphaseHandle2(BulletBody obj); | ||
497 | |||
498 | public abstract void SetBroadphaseHandle2(BulletBody obj, IntPtr handle); | ||
499 | |||
500 | /* | ||
501 | public abstract Transform GetInterpolationWorldTransform2(IntPtr obj); | ||
502 | |||
503 | public abstract void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); | ||
504 | */ | ||
505 | |||
506 | public abstract void SetInterpolationLinearVelocity2(BulletBody obj, Vector3 vel); | ||
507 | |||
508 | public abstract void SetInterpolationAngularVelocity2(BulletBody obj, Vector3 vel); | ||
509 | |||
510 | public abstract void SetInterpolationVelocity2(BulletBody obj, Vector3 linearVel, Vector3 angularVel); | ||
511 | |||
512 | public abstract float GetHitFraction2(BulletBody obj); | ||
513 | |||
514 | public abstract void SetHitFraction2(BulletBody obj, float val); | ||
515 | |||
516 | public abstract CollisionFlags GetCollisionFlags2(BulletBody obj); | ||
517 | |||
518 | public abstract CollisionFlags SetCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
519 | |||
520 | public abstract CollisionFlags AddToCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
521 | |||
522 | public abstract CollisionFlags RemoveFromCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
523 | |||
524 | public abstract float GetCcdMotionThreshold2(BulletBody obj); | ||
525 | |||
526 | public abstract void SetCcdMotionThreshold2(BulletBody obj, float val); | ||
527 | |||
528 | public abstract float GetCcdSweptSphereRadius2(BulletBody obj); | ||
529 | |||
530 | public abstract void SetCcdSweptSphereRadius2(BulletBody obj, float val); | ||
531 | |||
532 | public abstract IntPtr GetUserPointer2(BulletBody obj); | ||
533 | |||
534 | public abstract void SetUserPointer2(BulletBody obj, IntPtr val); | ||
535 | |||
536 | // ===================================================================================== | ||
537 | // btRigidBody entries | ||
538 | public abstract void ApplyGravity2(BulletBody obj); | ||
539 | |||
540 | public abstract void SetGravity2(BulletBody obj, Vector3 val); | ||
541 | |||
542 | public abstract Vector3 GetGravity2(BulletBody obj); | ||
543 | |||
544 | public abstract void SetDamping2(BulletBody obj, float lin_damping, float ang_damping); | ||
545 | |||
546 | public abstract void SetLinearDamping2(BulletBody obj, float lin_damping); | ||
547 | |||
548 | public abstract void SetAngularDamping2(BulletBody obj, float ang_damping); | ||
549 | |||
550 | public abstract float GetLinearDamping2(BulletBody obj); | ||
551 | |||
552 | public abstract float GetAngularDamping2(BulletBody obj); | ||
553 | |||
554 | public abstract float GetLinearSleepingThreshold2(BulletBody obj); | ||
555 | |||
556 | |||
557 | public abstract void ApplyDamping2(BulletBody obj, float timeStep); | ||
558 | |||
559 | public abstract void SetMassProps2(BulletBody obj, float mass, Vector3 inertia); | ||
560 | |||
561 | public abstract Vector3 GetLinearFactor2(BulletBody obj); | ||
562 | |||
563 | public abstract void SetLinearFactor2(BulletBody obj, Vector3 factor); | ||
564 | |||
565 | /* | ||
566 | public abstract void SetCenterOfMassTransform2(BulletBody obj, Transform trans); | ||
567 | */ | ||
568 | |||
569 | public abstract void SetCenterOfMassByPosRot2(BulletBody obj, Vector3 pos, Quaternion rot); | ||
570 | |||
571 | // Add a force to the object as if its mass is one. | ||
572 | public abstract void ApplyCentralForce2(BulletBody obj, Vector3 force); | ||
573 | |||
574 | // Set the force being applied to the object as if its mass is one. | ||
575 | public abstract void SetObjectForce2(BulletBody obj, Vector3 force); | ||
576 | |||
577 | public abstract Vector3 GetTotalForce2(BulletBody obj); | ||
578 | |||
579 | public abstract Vector3 GetTotalTorque2(BulletBody obj); | ||
580 | |||
581 | public abstract Vector3 GetInvInertiaDiagLocal2(BulletBody obj); | ||
582 | |||
583 | public abstract void SetInvInertiaDiagLocal2(BulletBody obj, Vector3 inert); | ||
584 | |||
585 | public abstract void SetSleepingThresholds2(BulletBody obj, float lin_threshold, float ang_threshold); | ||
586 | |||
587 | public abstract void ApplyTorque2(BulletBody obj, Vector3 torque); | ||
588 | |||
589 | // Apply force at the given point. Will add torque to the object. | ||
590 | public abstract void ApplyForce2(BulletBody obj, Vector3 force, Vector3 pos); | ||
591 | |||
592 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. | ||
593 | public abstract void ApplyCentralImpulse2(BulletBody obj, Vector3 imp); | ||
594 | |||
595 | // Apply impulse to the object's torque. Force is scaled by object's mass. | ||
596 | public abstract void ApplyTorqueImpulse2(BulletBody obj, Vector3 imp); | ||
597 | |||
598 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. | ||
599 | public abstract void ApplyImpulse2(BulletBody obj, Vector3 imp, Vector3 pos); | ||
600 | |||
601 | public abstract void ClearForces2(BulletBody obj); | ||
602 | |||
603 | public abstract void ClearAllForces2(BulletBody obj); | ||
604 | |||
605 | public abstract void UpdateInertiaTensor2(BulletBody obj); | ||
606 | |||
607 | |||
608 | /* | ||
609 | public abstract Transform GetCenterOfMassTransform2(BulletBody obj); | ||
610 | */ | ||
611 | |||
612 | public abstract Vector3 GetLinearVelocity2(BulletBody obj); | ||
613 | |||
614 | public abstract Vector3 GetAngularVelocity2(BulletBody obj); | ||
615 | |||
616 | public abstract void SetLinearVelocity2(BulletBody obj, Vector3 val); | ||
617 | |||
618 | public abstract void SetAngularVelocity2(BulletBody obj, Vector3 angularVelocity); | ||
619 | |||
620 | public abstract Vector3 GetVelocityInLocalPoint2(BulletBody obj, Vector3 pos); | ||
621 | |||
622 | public abstract void Translate2(BulletBody obj, Vector3 trans); | ||
623 | |||
624 | public abstract void UpdateDeactivation2(BulletBody obj, float timeStep); | ||
625 | |||
626 | public abstract bool WantsSleeping2(BulletBody obj); | ||
627 | |||
628 | public abstract void SetAngularFactor2(BulletBody obj, float factor); | ||
629 | |||
630 | public abstract void SetAngularFactorV2(BulletBody obj, Vector3 factor); | ||
631 | |||
632 | public abstract Vector3 GetAngularFactor2(BulletBody obj); | ||
633 | |||
634 | public abstract bool IsInWorld2(BulletBody obj); | ||
635 | |||
636 | public abstract void AddConstraintRef2(BulletBody obj, BulletConstraint constrain); | ||
637 | |||
638 | public abstract void RemoveConstraintRef2(BulletBody obj, BulletConstraint constrain); | ||
639 | |||
640 | public abstract BulletConstraint GetConstraintRef2(BulletBody obj, int index); | ||
641 | |||
642 | public abstract int GetNumConstraintRefs2(BulletBody obj); | ||
643 | |||
644 | public abstract bool SetCollisionGroupMask2(BulletBody body, uint filter, uint mask); | ||
645 | |||
646 | // ===================================================================================== | ||
647 | // btCollisionShape entries | ||
648 | |||
649 | public abstract float GetAngularMotionDisc2(BulletShape shape); | ||
650 | |||
651 | public abstract float GetContactBreakingThreshold2(BulletShape shape, float defaultFactor); | ||
652 | |||
653 | public abstract bool IsPolyhedral2(BulletShape shape); | ||
654 | |||
655 | public abstract bool IsConvex2d2(BulletShape shape); | ||
656 | |||
657 | public abstract bool IsConvex2(BulletShape shape); | ||
658 | |||
659 | public abstract bool IsNonMoving2(BulletShape shape); | ||
660 | |||
661 | public abstract bool IsConcave2(BulletShape shape); | ||
662 | |||
663 | public abstract bool IsCompound2(BulletShape shape); | ||
664 | |||
665 | public abstract bool IsSoftBody2(BulletShape shape); | ||
666 | |||
667 | public abstract bool IsInfinite2(BulletShape shape); | ||
668 | |||
669 | public abstract void SetLocalScaling2(BulletShape shape, Vector3 scale); | ||
670 | |||
671 | public abstract Vector3 GetLocalScaling2(BulletShape shape); | ||
672 | |||
673 | public abstract Vector3 CalculateLocalInertia2(BulletShape shape, float mass); | ||
674 | |||
675 | public abstract int GetShapeType2(BulletShape shape); | ||
676 | |||
677 | public abstract void SetMargin2(BulletShape shape, float val); | ||
678 | |||
679 | public abstract float GetMargin2(BulletShape shape); | ||
680 | |||
681 | }; | ||
682 | |||
291 | // =============================================================================== | 683 | // =============================================================================== |
292 | static class BulletSimAPI { | 684 | static class BulletSimAPI { |
293 | // =============================================================================== | 685 | // =============================================================================== |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs index 662177f..36d38d4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs | |||
@@ -35,9 +35,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
35 | // These hold pointers to allocated objects in the unmanaged space. | 35 | // These hold pointers to allocated objects in the unmanaged space. |
36 | 36 | ||
37 | // The physics engine controller class created at initialization | 37 | // The physics engine controller class created at initialization |
38 | public struct BulletSim | 38 | public struct BulletWorld |
39 | { | 39 | { |
40 | public BulletSim(uint worldId, BSScene bss, IntPtr xx) | 40 | public BulletWorld(uint worldId, BSScene bss, IntPtr xx) |
41 | { | 41 | { |
42 | ptr = xx; | 42 | ptr = xx; |
43 | worldID = worldId; | 43 | worldID = worldId; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index 0f27d67..35cb8f3 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | |||
@@ -146,6 +146,13 @@ Is there are more efficient method of implementing pre and post step actions? | |||
146 | See http://www.codeproject.com/Articles/29922/Weak-Events-in-C | 146 | See http://www.codeproject.com/Articles/29922/Weak-Events-in-C |
147 | 147 | ||
148 | Physics Arena central pyramid: why is one side permiable? | 148 | Physics Arena central pyramid: why is one side permiable? |
149 | Enforce physical parameter min/max: | ||
150 | Gravity: [-1, 28] | ||
151 | Friction: [0, 255] | ||
152 | Density: [1, 22587] | ||
153 | Restitution [0, 1] | ||
154 | http://wiki.secondlife.com/wiki/Physics_Material_Settings_test | ||
155 | Avatar attachments have no mass? http://forums-archive.secondlife.com/54/f0/31796/1.html | ||
149 | 156 | ||
150 | INTERNAL IMPROVEMENT/CLEANUP | 157 | INTERNAL IMPROVEMENT/CLEANUP |
151 | ================================================= | 158 | ================================================= |