diff options
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | 64 | ||||
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 40 |
2 files changed, 52 insertions, 52 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs index 2c0cb43..9d8f60d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | |||
@@ -55,10 +55,10 @@ private sealed class BulletBodyUnman : BulletBody | |||
55 | : base(id) | 55 | : base(id) |
56 | { | 56 | { |
57 | ptr = xx; | 57 | ptr = xx; |
58 | } | 58 | } |
59 | public override bool HasPhysicalBody | 59 | public override bool HasPhysicalBody |
60 | { | 60 | { |
61 | get { return ptr != IntPtr.Zero; } | 61 | get { return ptr != IntPtr.Zero; } |
62 | } | 62 | } |
63 | public override void Clear() | 63 | public override void Clear() |
64 | { | 64 | { |
@@ -79,10 +79,10 @@ private sealed class BulletShapeUnman : BulletShape | |||
79 | ptr = xx; | 79 | ptr = xx; |
80 | type = typ; | 80 | type = typ; |
81 | } | 81 | } |
82 | public override bool HasPhysicalShape | 82 | public override bool HasPhysicalShape |
83 | { | 83 | { |
84 | get { return ptr != IntPtr.Zero; } | 84 | get { return ptr != IntPtr.Zero; } |
85 | } | 85 | } |
86 | public override void Clear() | 86 | public override void Clear() |
87 | { | 87 | { |
88 | ptr = IntPtr.Zero; | 88 | ptr = IntPtr.Zero; |
@@ -202,7 +202,7 @@ public override int PhysicsStep(BulletWorld world, float timeStep, int maxSubSte | |||
202 | 202 | ||
203 | public override void Shutdown(BulletWorld world) | 203 | public override void Shutdown(BulletWorld world) |
204 | { | 204 | { |
205 | BulletWorldUnman worldu = world as BulletWorldUnman; | 205 | BulletWorldUnman worldu = world as BulletWorldUnman; |
206 | BSAPICPP.Shutdown2(worldu.ptr); | 206 | BSAPICPP.Shutdown2(worldu.ptr); |
207 | } | 207 | } |
208 | 208 | ||
@@ -249,7 +249,7 @@ public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShap | |||
249 | 249 | ||
250 | public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData) | 250 | public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData) |
251 | { | 251 | { |
252 | BulletWorldUnman worldu = world as BulletWorldUnman; | 252 | BulletWorldUnman worldu = world as BulletWorldUnman; |
253 | return new BulletShapeUnman(BSAPICPP.BuildNativeShape2(worldu.ptr, shapeData), shapeData.Type); | 253 | return new BulletShapeUnman(BSAPICPP.BuildNativeShape2(worldu.ptr, shapeData), shapeData.Type); |
254 | } | 254 | } |
255 | 255 | ||
@@ -334,7 +334,7 @@ public override BulletShape DuplicateCollisionShape(BulletWorld world, BulletSha | |||
334 | 334 | ||
335 | public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape) | 335 | public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape) |
336 | { | 336 | { |
337 | BulletWorldUnman worldu = world as BulletWorldUnman; | 337 | BulletWorldUnman worldu = world as BulletWorldUnman; |
338 | BulletShapeUnman shapeu = shape as BulletShapeUnman; | 338 | BulletShapeUnman shapeu = shape as BulletShapeUnman; |
339 | return BSAPICPP.DeleteCollisionShape2(worldu.ptr, shapeu.ptr); | 339 | return BSAPICPP.DeleteCollisionShape2(worldu.ptr, shapeu.ptr); |
340 | } | 340 | } |
@@ -360,7 +360,7 @@ public override BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, u | |||
360 | 360 | ||
361 | public override BulletBody CreateGhostFromShape(BulletWorld world, BulletShape shape, uint id, Vector3 pos, Quaternion rot) | 361 | public override BulletBody CreateGhostFromShape(BulletWorld world, BulletShape shape, uint id, Vector3 pos, Quaternion rot) |
362 | { | 362 | { |
363 | BulletWorldUnman worldu = world as BulletWorldUnman; | 363 | BulletWorldUnman worldu = world as BulletWorldUnman; |
364 | BulletShapeUnman shapeu = shape as BulletShapeUnman; | 364 | BulletShapeUnman shapeu = shape as BulletShapeUnman; |
365 | return new BulletBodyUnman(id, BSAPICPP.CreateGhostFromShape2(worldu.ptr, shapeu.ptr, id, pos, rot)); | 365 | return new BulletBodyUnman(id, BSAPICPP.CreateGhostFromShape2(worldu.ptr, shapeu.ptr, id, pos, rot)); |
366 | } | 366 | } |
@@ -393,7 +393,7 @@ public override BulletConstraint Create6DofConstraint(BulletWorld world, BulletB | |||
393 | Vector3 frame2loc, Quaternion frame2rot, | 393 | Vector3 frame2loc, Quaternion frame2rot, |
394 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | 394 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
395 | { | 395 | { |
396 | BulletWorldUnman worldu = world as BulletWorldUnman; | 396 | BulletWorldUnman worldu = world as BulletWorldUnman; |
397 | BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; | 397 | BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; |
398 | BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; | 398 | BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; |
399 | return new BulletConstraintUnman(BSAPICPP.Create6DofConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, frame1loc, frame1rot, | 399 | return new BulletConstraintUnman(BSAPICPP.Create6DofConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, frame1loc, frame1rot, |
@@ -404,7 +404,7 @@ public override BulletConstraint Create6DofConstraintToPoint(BulletWorld world, | |||
404 | Vector3 joinPoint, | 404 | Vector3 joinPoint, |
405 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | 405 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
406 | { | 406 | { |
407 | BulletWorldUnman worldu = world as BulletWorldUnman; | 407 | BulletWorldUnman worldu = world as BulletWorldUnman; |
408 | BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; | 408 | BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; |
409 | BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; | 409 | BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; |
410 | return new BulletConstraintUnman(BSAPICPP.Create6DofConstraintToPoint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, | 410 | return new BulletConstraintUnman(BSAPICPP.Create6DofConstraintToPoint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, |
@@ -416,7 +416,7 @@ public override BulletConstraint CreateHingeConstraint(BulletWorld world, Bullet | |||
416 | Vector3 axisInA, Vector3 axisInB, | 416 | Vector3 axisInA, Vector3 axisInB, |
417 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) | 417 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) |
418 | { | 418 | { |
419 | BulletWorldUnman worldu = world as BulletWorldUnman; | 419 | BulletWorldUnman worldu = world as BulletWorldUnman; |
420 | BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; | 420 | BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; |
421 | BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; | 421 | BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; |
422 | return new BulletConstraintUnman(BSAPICPP.CreateHingeConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, | 422 | return new BulletConstraintUnman(BSAPICPP.CreateHingeConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, |
@@ -494,7 +494,7 @@ public override bool DestroyConstraint(BulletWorld world, BulletConstraint const | |||
494 | // ===================================================================================== | 494 | // ===================================================================================== |
495 | // btCollisionWorld entries | 495 | // btCollisionWorld entries |
496 | public override void UpdateSingleAabb(BulletWorld world, BulletBody obj) | 496 | public override void UpdateSingleAabb(BulletWorld world, BulletBody obj) |
497 | { | 497 | { |
498 | BulletWorldUnman worldu = world as BulletWorldUnman; | 498 | BulletWorldUnman worldu = world as BulletWorldUnman; |
499 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 499 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
500 | BSAPICPP.UpdateSingleAabb2(worldu.ptr, bodyu.ptr); | 500 | BSAPICPP.UpdateSingleAabb2(worldu.ptr, bodyu.ptr); |
@@ -502,19 +502,19 @@ public override void UpdateSingleAabb(BulletWorld world, BulletBody obj) | |||
502 | 502 | ||
503 | public override void UpdateAabbs(BulletWorld world) | 503 | public override void UpdateAabbs(BulletWorld world) |
504 | { | 504 | { |
505 | BulletWorldUnman worldu = world as BulletWorldUnman; | 505 | BulletWorldUnman worldu = world as BulletWorldUnman; |
506 | BSAPICPP.UpdateAabbs2(worldu.ptr); | 506 | BSAPICPP.UpdateAabbs2(worldu.ptr); |
507 | } | 507 | } |
508 | 508 | ||
509 | public override bool GetForceUpdateAllAabbs(BulletWorld world) | 509 | public override bool GetForceUpdateAllAabbs(BulletWorld world) |
510 | { | 510 | { |
511 | BulletWorldUnman worldu = world as BulletWorldUnman; | 511 | BulletWorldUnman worldu = world as BulletWorldUnman; |
512 | return BSAPICPP.GetForceUpdateAllAabbs2(worldu.ptr); | 512 | return BSAPICPP.GetForceUpdateAllAabbs2(worldu.ptr); |
513 | } | 513 | } |
514 | 514 | ||
515 | public override void SetForceUpdateAllAabbs(BulletWorld world, bool force) | 515 | public override void SetForceUpdateAllAabbs(BulletWorld world, bool force) |
516 | { | 516 | { |
517 | BulletWorldUnman worldu = world as BulletWorldUnman; | 517 | BulletWorldUnman worldu = world as BulletWorldUnman; |
518 | BSAPICPP.SetForceUpdateAllAabbs2(worldu.ptr, force); | 518 | BSAPICPP.SetForceUpdateAllAabbs2(worldu.ptr, force); |
519 | } | 519 | } |
520 | 520 | ||
@@ -522,28 +522,28 @@ public override void SetForceUpdateAllAabbs(BulletWorld world, bool force) | |||
522 | // btDynamicsWorld entries | 522 | // btDynamicsWorld entries |
523 | public override bool AddObjectToWorld(BulletWorld world, BulletBody obj) | 523 | public override bool AddObjectToWorld(BulletWorld world, BulletBody obj) |
524 | { | 524 | { |
525 | BulletWorldUnman worldu = world as BulletWorldUnman; | 525 | BulletWorldUnman worldu = world as BulletWorldUnman; |
526 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 526 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
527 | return BSAPICPP.AddObjectToWorld2(worldu.ptr, bodyu.ptr); | 527 | return BSAPICPP.AddObjectToWorld2(worldu.ptr, bodyu.ptr); |
528 | } | 528 | } |
529 | 529 | ||
530 | public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj) | 530 | public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj) |
531 | { | 531 | { |
532 | BulletWorldUnman worldu = world as BulletWorldUnman; | 532 | BulletWorldUnman worldu = world as BulletWorldUnman; |
533 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 533 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
534 | return BSAPICPP.RemoveObjectFromWorld2(worldu.ptr, bodyu.ptr); | 534 | return BSAPICPP.RemoveObjectFromWorld2(worldu.ptr, bodyu.ptr); |
535 | } | 535 | } |
536 | 536 | ||
537 | public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects) | 537 | public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects) |
538 | { | 538 | { |
539 | BulletWorldUnman worldu = world as BulletWorldUnman; | 539 | BulletWorldUnman worldu = world as BulletWorldUnman; |
540 | BulletConstraintUnman constrainu = constrain as BulletConstraintUnman; | 540 | BulletConstraintUnman constrainu = constrain as BulletConstraintUnman; |
541 | return BSAPICPP.AddConstraintToWorld2(worldu.ptr, constrainu.ptr, disableCollisionsBetweenLinkedObjects); | 541 | return BSAPICPP.AddConstraintToWorld2(worldu.ptr, constrainu.ptr, disableCollisionsBetweenLinkedObjects); |
542 | } | 542 | } |
543 | 543 | ||
544 | public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain) | 544 | public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain) |
545 | { | 545 | { |
546 | BulletWorldUnman worldu = world as BulletWorldUnman; | 546 | BulletWorldUnman worldu = world as BulletWorldUnman; |
547 | BulletConstraintUnman constrainu = constrain as BulletConstraintUnman; | 547 | BulletConstraintUnman constrainu = constrain as BulletConstraintUnman; |
548 | return BSAPICPP.RemoveConstraintFromWorld2(worldu.ptr, constrainu.ptr); | 548 | return BSAPICPP.RemoveConstraintFromWorld2(worldu.ptr, constrainu.ptr); |
549 | } | 549 | } |
@@ -605,16 +605,16 @@ public override bool HasContactResponse(BulletBody obj) | |||
605 | 605 | ||
606 | public override void SetCollisionShape(BulletWorld world, BulletBody obj, BulletShape shape) | 606 | public override void SetCollisionShape(BulletWorld world, BulletBody obj, BulletShape shape) |
607 | { | 607 | { |
608 | BulletWorldUnman worldu = world as BulletWorldUnman; | 608 | BulletWorldUnman worldu = world as BulletWorldUnman; |
609 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 609 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
610 | BulletShapeUnman shapeu = shape as BulletShapeUnman; | 610 | BulletShapeUnman shapeu = shape as BulletShapeUnman; |
611 | if (worldu != null && bodyu != null) | 611 | if (worldu != null && bodyu != null) |
612 | { | 612 | { |
613 | // Special case to allow the caller to zero out the reference to any physical shape | 613 | // Special case to allow the caller to zero out the reference to any physical shape |
614 | if (shapeu != null) | 614 | if (shapeu != null) |
615 | BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, shapeu.ptr); | 615 | BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, shapeu.ptr); |
616 | else | 616 | else |
617 | BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, IntPtr.Zero); | 617 | BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, IntPtr.Zero); |
618 | } | 618 | } |
619 | } | 619 | } |
620 | 620 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index cb8108d..d4e2e87 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -894,26 +894,26 @@ public sealed class BSPrim : BSPhysObject | |||
894 | // Object MUST NOT already be in the world. | 894 | // Object MUST NOT already be in the world. |
895 | // This routine exists because some assorted properties get mangled by adding to the world. | 895 | // This routine exists because some assorted properties get mangled by adding to the world. |
896 | internal void AddObjectToPhysicalWorld() | 896 | internal void AddObjectToPhysicalWorld() |
897 | { | 897 | { |
898 | if (PhysBody.HasPhysicalBody) | 898 | if (PhysBody.HasPhysicalBody) |
899 | { | 899 | { |
900 | PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody); | 900 | PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody); |
901 | 901 | ||
902 | // TODO: Fix this. Total kludge because adding object to world resets its gravity to default. | 902 | // TODO: Fix this. Total kludge because adding object to world resets its gravity to default. |
903 | // Replace this when the new AddObjectToWorld function is complete. | 903 | // Replace this when the new AddObjectToWorld function is complete. |
904 | PhysicsScene.PE.SetGravity(PhysBody, ComputeGravity()); | 904 | PhysicsScene.PE.SetGravity(PhysBody, ComputeGravity()); |
905 | 905 | ||
906 | // Collision filter can be set only when the object is in the world | 906 | // Collision filter can be set only when the object is in the world |
907 | if (!PhysBody.ApplyCollisionMask(PhysicsScene)) | 907 | if (!PhysBody.ApplyCollisionMask(PhysicsScene)) |
908 | { | 908 | { |
909 | m_log.ErrorFormat("{0} Failed setting object collision mask: id={1}", LogHeader, LocalID); | 909 | m_log.ErrorFormat("{0} Failed setting object collision mask: id={1}", LogHeader, LocalID); |
910 | DetailLog("{0},BSPrim.UpdatePhysicalParameters,failedSetMaskGroup,cType={1}", LocalID, PhysBody.collisionType); | 910 | DetailLog("{0},BSPrim.UpdatePhysicalParameters,failedSetMaskGroup,cType={1}", LocalID, PhysBody.collisionType); |
911 | } | 911 | } |
912 | } | 912 | } |
913 | else | 913 | else |
914 | { | 914 | { |
915 | m_log.ErrorFormat("{0} Attempt to add physical object without body. id={1}", LogHeader, LocalID); | 915 | m_log.ErrorFormat("{0} Attempt to add physical object without body. id={1}", LogHeader, LocalID); |
916 | DetailLog("{0},BSPrim.UpdatePhysicalParameters,addObjectWithoutBody,cType={1}", LocalID, PhysBody.collisionType); | 916 | DetailLog("{0},BSPrim.UpdatePhysicalParameters,addObjectWithoutBody,cType={1}", LocalID, PhysBody.collisionType); |
917 | } | 917 | } |
918 | } | 918 | } |
919 | 919 | ||