aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
diff options
context:
space:
mode:
authorRobert Adams2013-08-20 13:09:40 -0700
committerRobert Adams2013-09-11 09:12:05 -0700
commitd09c35f5063114880aecb94a938bfc49f5af5f7d (patch)
tree8af9cf90bdbde7b63bb49844d550d36529cadd46 /OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
parentBulletSim: add ID parameter to TaintedObject calls so logging will include Lo... (diff)
downloadopensim-SC_OLD-d09c35f5063114880aecb94a938bfc49f5af5f7d.zip
opensim-SC_OLD-d09c35f5063114880aecb94a938bfc49f5af5f7d.tar.gz
opensim-SC_OLD-d09c35f5063114880aecb94a938bfc49f5af5f7d.tar.bz2
opensim-SC_OLD-d09c35f5063114880aecb94a938bfc49f5af5f7d.tar.xz
BulletSim: pass both root and child BSPhysObjects to Extension function. Update routines to use the new parameters list from above change.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs32
1 files changed, 17 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
index b2a9501..a9ae89d 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
@@ -385,7 +385,7 @@ public sealed class BSLinksetConstraints : BSLinkset
385 linkInfo.frameInAloc, linkInfo.frameInArot, linkInfo.frameInBloc, linkInfo.frameInBrot, 385 linkInfo.frameInAloc, linkInfo.frameInArot, linkInfo.frameInBloc, linkInfo.frameInBrot,
386 true /*useLinearReferenceFrameA*/, 386 true /*useLinearReferenceFrameA*/,
387 true /*disableCollisionsBetweenLinkedBodies*/); 387 true /*disableCollisionsBetweenLinkedBodies*/);
388 DetailLog("{0},BSLinksetConstraint.BuildConstraint,spring,root={1},rBody={2},child={3},cBody={4},rLoc={5},cLoc={6},midLoc={7}", 388 DetailLog("{0},BSLinksetConstraint.BuildConstraint,spring,root={1},rBody={2},child={3},cBody={4},rLoc={5},cLoc={6}",
389 rootPrim.LocalID, 389 rootPrim.LocalID,
390 rootPrim.LocalID, rootPrim.PhysBody.AddrString, 390 rootPrim.LocalID, rootPrim.PhysBody.AddrString,
391 linkInfo.member.LocalID, linkInfo.member.PhysBody.AddrString, 391 linkInfo.member.LocalID, linkInfo.member.PhysBody.AddrString,
@@ -492,12 +492,12 @@ public sealed class BSLinksetConstraints : BSLinkset
492 object ret = null; 492 object ret = null;
493 switch (pFunct) 493 switch (pFunct)
494 { 494 {
495 // pParams = [ BSPhysObject child, integer linkType ] 495 // pParams = [ BSPhysObject root, BSPhysObject child, integer linkType ]
496 case ExtendedPhysics.PhysFunctChangeLinkType: 496 case ExtendedPhysics.PhysFunctChangeLinkType:
497 if (pParams.Length > 1) 497 if (pParams.Length > 2)
498 { 498 {
499 int requestedType = (int)pParams[1]; 499 int requestedType = (int)pParams[2];
500 DetailLog("{0},BSLinksetConstraint.SetLinkType,requestedType={1}", LinksetRoot.LocalID, requestedType); 500 DetailLog("{0},BSLinksetConstraint.ChangeLinkType,requestedType={1}", LinksetRoot.LocalID, requestedType);
501 if (requestedType == (int)ConstraintType.FIXED_CONSTRAINT_TYPE 501 if (requestedType == (int)ConstraintType.FIXED_CONSTRAINT_TYPE
502 || requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE 502 || requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE
503 || requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE 503 || requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE
@@ -505,9 +505,11 @@ public sealed class BSLinksetConstraints : BSLinkset
505 || requestedType == (int)ConstraintType.CONETWIST_CONSTRAINT_TYPE 505 || requestedType == (int)ConstraintType.CONETWIST_CONSTRAINT_TYPE
506 || requestedType == (int)ConstraintType.SLIDER_CONSTRAINT_TYPE) 506 || requestedType == (int)ConstraintType.SLIDER_CONSTRAINT_TYPE)
507 { 507 {
508 BSPrimLinkable child = pParams[0] as BSPrimLinkable; 508 BSPrimLinkable child = pParams[1] as BSPrimLinkable;
509 if (child != null) 509 if (child != null)
510 { 510 {
511 DetailLog("{0},BSLinksetConstraint.ChangeLinkType,rootID={1},childID={2},type={3}",
512 LinksetRoot.LocalID, LinksetRoot.LocalID, child.LocalID, requestedType);
511 m_physicsScene.TaintedObject(child.LocalID, "BSLinksetConstraint.PhysFunctChangeLinkType", delegate() 513 m_physicsScene.TaintedObject(child.LocalID, "BSLinksetConstraint.PhysFunctChangeLinkType", delegate()
512 { 514 {
513 // Pick up all the constraints currently created. 515 // Pick up all the constraints currently created.
@@ -523,17 +525,17 @@ public sealed class BSLinksetConstraints : BSLinkset
523 linkInfoC.ResetLink(); 525 linkInfoC.ResetLink();
524 linkInfoC.constraintType = (ConstraintType)requestedType; 526 linkInfoC.constraintType = (ConstraintType)requestedType;
525 ret = (object)true; 527 ret = (object)true;
526 DetailLog("{0},BSLinksetConstraint.SetLinkType,link={1},type={2}", 528 DetailLog("{0},BSLinksetConstraint.ChangeLinkType,link={1},type={2}",
527 linkInfo.member.LocalID, linkInfo.member.LocalID, linkInfoC.constraintType); 529 linkInfo.member.LocalID, linkInfo.member.LocalID, linkInfoC.constraintType);
528 } 530 }
529 else 531 else
530 { 532 {
531 DetailLog("{0},BSLinksetConstraint.SetLinkType,linkInfoNotConstraint,childID={1}", LinksetRoot.LocalID, child.LocalID); 533 DetailLog("{0},BSLinksetConstraint.ChangeLinkType,linkInfoNotConstraint,childID={1}", LinksetRoot.LocalID, child.LocalID);
532 } 534 }
533 } 535 }
534 else 536 else
535 { 537 {
536 DetailLog("{0},BSLinksetConstraint.SetLinkType,noLinkInfoForChild,childID={1}", LinksetRoot.LocalID, child.LocalID); 538 DetailLog("{0},BSLinksetConstraint.ChangeLinkType,noLinkInfoForChild,childID={1}", LinksetRoot.LocalID, child.LocalID);
537 } 539 }
538 // Cause the whole linkset to be rebuilt in post-taint time. 540 // Cause the whole linkset to be rebuilt in post-taint time.
539 Refresh(child); 541 Refresh(child);
@@ -551,11 +553,11 @@ public sealed class BSLinksetConstraints : BSLinkset
551 } 553 }
552 } 554 }
553 break; 555 break;
554 // pParams = [] 556 // pParams = [ BSPhysObject root, BSPhysObject child ]
555 case ExtendedPhysics.PhysFunctGetLinkType: 557 case ExtendedPhysics.PhysFunctGetLinkType:
556 if (pParams.Length > 0) 558 if (pParams.Length > 0)
557 { 559 {
558 BSPrimLinkable child = pParams[0] as BSPrimLinkable; 560 BSPrimLinkable child = pParams[1] as BSPrimLinkable;
559 if (child != null) 561 if (child != null)
560 { 562 {
561 BSLinkInfo linkInfo = null; 563 BSLinkInfo linkInfo = null;
@@ -573,14 +575,14 @@ public sealed class BSLinksetConstraints : BSLinkset
573 } 575 }
574 } 576 }
575 break; 577 break;
576 // pParams = [ BSPhysObject child, int op, object opParams, int op, object opParams, ... ] 578 // pParams = [ BSPhysObject root, BSPhysObject child, int op, object opParams, int op, object opParams, ... ]
577 case ExtendedPhysics.PhysFunctChangeLinkParams: 579 case ExtendedPhysics.PhysFunctChangeLinkParams:
578 // There should be two parameters: the childActor and a list of parameters to set 580 // There should be two parameters: the childActor and a list of parameters to set
579 try 581 try
580 { 582 {
581 if (pParams.Length > 1) 583 if (pParams.Length > 2)
582 { 584 {
583 BSPrimLinkable child = pParams[0] as BSPrimLinkable; 585 BSPrimLinkable child = pParams[1] as BSPrimLinkable;
584 BSLinkInfo baseLinkInfo = null; 586 BSLinkInfo baseLinkInfo = null;
585 if (TryGetLinkInfo(child, out baseLinkInfo)) 587 if (TryGetLinkInfo(child, out baseLinkInfo))
586 { 588 {
@@ -592,7 +594,7 @@ public sealed class BSLinksetConstraints : BSLinkset
592 OMV.Vector3 valueVector; 594 OMV.Vector3 valueVector;
593 OMV.Quaternion valueQuaternion; 595 OMV.Quaternion valueQuaternion;
594 596
595 int opIndex = 1; 597 int opIndex = 2;
596 while (opIndex < pParams.Length) 598 while (opIndex < pParams.Length)
597 { 599 {
598 int thisOp = (int)pParams[opIndex]; 600 int thisOp = (int)pParams[opIndex];