diff options
author | Robert Adams | 2013-08-20 13:09:40 -0700 |
---|---|---|
committer | Robert Adams | 2013-09-11 09:12:05 -0700 |
commit | d09c35f5063114880aecb94a938bfc49f5af5f7d (patch) | |
tree | 8af9cf90bdbde7b63bb49844d550d36529cadd46 /OpenSim/Region/Physics | |
parent | BulletSim: add ID parameter to TaintedObject calls so logging will include Lo... (diff) | |
download | opensim-SC-d09c35f5063114880aecb94a938bfc49f5af5f7d.zip opensim-SC-d09c35f5063114880aecb94a938bfc49f5af5f7d.tar.gz opensim-SC-d09c35f5063114880aecb94a938bfc49f5af5f7d.tar.bz2 opensim-SC-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')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs | 32 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs | 14 |
2 files changed, 24 insertions, 22 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]; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs index 840265b..126b146 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs | |||
@@ -288,7 +288,7 @@ public class BSPrimLinkable : BSPrimDisplaced | |||
288 | switch (pFunct) | 288 | switch (pFunct) |
289 | { | 289 | { |
290 | // physGetLinksetType(); | 290 | // physGetLinksetType(); |
291 | // pParams = [] | 291 | // pParams = [ BSPhysObject root, null ] |
292 | case ExtendedPhysics.PhysFunctGetLinksetType: | 292 | case ExtendedPhysics.PhysFunctGetLinksetType: |
293 | { | 293 | { |
294 | ret = (object)LinksetType; | 294 | ret = (object)LinksetType; |
@@ -296,12 +296,12 @@ public class BSPrimLinkable : BSPrimDisplaced | |||
296 | break; | 296 | break; |
297 | } | 297 | } |
298 | // physSetLinksetType(type); | 298 | // physSetLinksetType(type); |
299 | // pParams = [ BSPhysObject child, integer type ] | 299 | // pParams = [ BSPhysObject root, null, integer type ] |
300 | case ExtendedPhysics.PhysFunctSetLinksetType: | 300 | case ExtendedPhysics.PhysFunctSetLinksetType: |
301 | { | 301 | { |
302 | if (pParams.Length > 0) | 302 | if (pParams.Length > 2) |
303 | { | 303 | { |
304 | BSLinkset.LinksetImplementation linksetType = (BSLinkset.LinksetImplementation)pParams[0]; | 304 | BSLinkset.LinksetImplementation linksetType = (BSLinkset.LinksetImplementation)pParams[2]; |
305 | if (Linkset.IsRoot(this)) | 305 | if (Linkset.IsRoot(this)) |
306 | { | 306 | { |
307 | PhysScene.TaintedObject(LocalID, "BSPrim.PhysFunctSetLinksetType", delegate() | 307 | PhysScene.TaintedObject(LocalID, "BSPrim.PhysFunctSetLinksetType", delegate() |
@@ -317,21 +317,21 @@ public class BSPrimLinkable : BSPrimDisplaced | |||
317 | break; | 317 | break; |
318 | } | 318 | } |
319 | // physChangeLinkType(linknum, typeCode); | 319 | // physChangeLinkType(linknum, typeCode); |
320 | // pParams = [ BSPhysObject child, integer linkType ] | 320 | // pParams = [ BSPhysObject root, BSPhysObject child, integer linkType ] |
321 | case ExtendedPhysics.PhysFunctChangeLinkType: | 321 | case ExtendedPhysics.PhysFunctChangeLinkType: |
322 | { | 322 | { |
323 | ret = Linkset.Extension(pFunct, pParams); | 323 | ret = Linkset.Extension(pFunct, pParams); |
324 | break; | 324 | break; |
325 | } | 325 | } |
326 | // physGetLinkType(linknum); | 326 | // physGetLinkType(linknum); |
327 | // pParams = [ BSPhysObject child ] | 327 | // pParams = [ BSPhysObject root, BSPhysObject child ] |
328 | case ExtendedPhysics.PhysFunctGetLinkType: | 328 | case ExtendedPhysics.PhysFunctGetLinkType: |
329 | { | 329 | { |
330 | ret = Linkset.Extension(pFunct, pParams); | 330 | ret = Linkset.Extension(pFunct, pParams); |
331 | break; | 331 | break; |
332 | } | 332 | } |
333 | // physChangeLinkParams(linknum, [code, value, code, value, ...]); | 333 | // physChangeLinkParams(linknum, [code, value, code, value, ...]); |
334 | // pParams = [ BSPhysObject child, object[] [ string op, object opParam, string op, object opParam, ... ] ] | 334 | // pParams = [ BSPhysObject root, BSPhysObject child, object[] [ string op, object opParam, string op, object opParam, ... ] ] |
335 | case ExtendedPhysics.PhysFunctChangeLinkParams: | 335 | case ExtendedPhysics.PhysFunctChangeLinkParams: |
336 | { | 336 | { |
337 | ret = Linkset.Extension(pFunct, pParams); | 337 | ret = Linkset.Extension(pFunct, pParams); |