diff options
author | Robert Adams | 2013-08-09 10:59:10 -0700 |
---|---|---|
committer | Robert Adams | 2013-09-11 09:11:52 -0700 |
commit | 455d36c4c70a55c5d48dc1410b8729929fafedf6 (patch) | |
tree | 2dad264f9a7c319cba213cfe486b38c6b0dca182 /OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs | |
parent | BulletSim: update C++ HACD parameters to values that handle enclosed hollow s... (diff) | |
download | opensim-SC_OLD-455d36c4c70a55c5d48dc1410b8729929fafedf6.zip opensim-SC_OLD-455d36c4c70a55c5d48dc1410b8729929fafedf6.tar.gz opensim-SC_OLD-455d36c4c70a55c5d48dc1410b8729929fafedf6.tar.bz2 opensim-SC_OLD-455d36c4c70a55c5d48dc1410b8729929fafedf6.tar.xz |
BulletSim: add physChangeLinkParams to set individual parameters on link constraints. Not fully functional. Remove double definition of ExtendedPhysics parameters by having BulletSim reference the optional module (addition to prebuild.xml and usings).
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs | 85 |
1 files changed, 31 insertions, 54 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs index 17fec9d..c09dd42 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs | |||
@@ -28,6 +28,8 @@ using System; | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Text; | 29 | using System.Text; |
30 | 30 | ||
31 | using OpenSim.Region.OptionalModules.Scripting; | ||
32 | |||
31 | using OMV = OpenMetaverse; | 33 | using OMV = OpenMetaverse; |
32 | 34 | ||
33 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.Physics.BulletSPlugin |
@@ -489,71 +491,46 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
489 | switch (pFunct) | 491 | switch (pFunct) |
490 | { | 492 | { |
491 | // pParams = (int linkNUm, PhysActor linkChild) | 493 | // pParams = (int linkNUm, PhysActor linkChild) |
492 | case BSScene.PhysFunctChangeLinkFixed: | 494 | case ExtendedPhysics.PhysFunctChangeLinkType: |
493 | if (pParams.Length > 1) | 495 | if (pParams.Length > 1) |
494 | { | 496 | { |
495 | BSPrimLinkable child = pParams[1] as BSPrimLinkable; | 497 | int requestedType = (int)pParams[1]; |
496 | if (child != null) | 498 | if (requestedType == (int)ConstraintType.FIXED_CONSTRAINT_TYPE |
499 | || requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE | ||
500 | || requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE | ||
501 | || requestedType == (int)ConstraintType.HINGE_CONSTRAINT_TYPE | ||
502 | || requestedType == (int)ConstraintType.CONETWIST_CONSTRAINT_TYPE | ||
503 | || requestedType == (int)ConstraintType.SLIDER_CONSTRAINT_TYPE) | ||
497 | { | 504 | { |
498 | m_physicsScene.TaintedObject("BSLinksetConstraint.PhysFunctChangeLinkFixed", delegate() | 505 | BSPrimLinkable child = pParams[0] as BSPrimLinkable; |
506 | if (child != null) | ||
499 | { | 507 | { |
500 | // Pick up all the constraints currently created. | 508 | m_physicsScene.TaintedObject("BSLinksetConstraint.PhysFunctChangeLinkFixed", delegate() |
501 | RemoveDependencies(child); | ||
502 | |||
503 | BSLinkInfo linkInfo = null; | ||
504 | if (m_children.TryGetValue(child, out linkInfo)) | ||
505 | { | 509 | { |
506 | BSLinkInfoConstraint linkInfoC = linkInfo as BSLinkInfoConstraint; | 510 | // Pick up all the constraints currently created. |
507 | if (linkInfoC != null) | 511 | RemoveDependencies(child); |
508 | { | ||
509 | // Setting to fixed is easy. The reset state is the fixed link configuration. | ||
510 | linkInfoC.ResetLink(); | ||
511 | ret = (object)true; | ||
512 | } | ||
513 | } | ||
514 | // Cause the whole linkset to be rebuilt in post-taint time. | ||
515 | Refresh(child); | ||
516 | }); | ||
517 | } | ||
518 | } | ||
519 | break; | ||
520 | case BSScene.PhysFunctChangeLinkSpring: | ||
521 | if (pParams.Length > 11) | ||
522 | { | ||
523 | BSPrimLinkable child = pParams[1] as BSPrimLinkable; | ||
524 | if (child != null) | ||
525 | { | ||
526 | m_physicsScene.TaintedObject("BSLinksetConstraint.PhysFunctChangeLinkFixed", delegate() | ||
527 | { | ||
528 | // Pick up all the constraints currently created. | ||
529 | RemoveDependencies(child); | ||
530 | 512 | ||
531 | BSLinkInfo linkInfo = null; | 513 | BSLinkInfo linkInfo = null; |
532 | if (m_children.TryGetValue(child, out linkInfo)) | 514 | if (m_children.TryGetValue(child, out linkInfo)) |
533 | { | ||
534 | BSLinkInfoConstraint linkInfoC = linkInfo as BSLinkInfoConstraint; | ||
535 | if (linkInfoC != null) | ||
536 | { | 515 | { |
537 | // Start with a reset link definition | 516 | BSLinkInfoConstraint linkInfoC = linkInfo as BSLinkInfoConstraint; |
538 | linkInfoC.ResetLink(); | 517 | if (linkInfoC != null) |
539 | linkInfoC.constraintType = ConstraintType.D6_SPRING_CONSTRAINT_TYPE; | 518 | { |
540 | linkInfoC.frameInAloc = (OMV.Vector3)pParams[2]; | 519 | // Setting to fixed is easy. The reset state is the fixed link configuration. |
541 | linkInfoC.frameInArot = (OMV.Quaternion)pParams[3]; | 520 | linkInfoC.ResetLink(); |
542 | linkInfoC.frameInBloc = (OMV.Vector3)pParams[4]; | 521 | linkInfoC.constraintType = (ConstraintType)requestedType; |
543 | linkInfoC.frameInBrot = (OMV.Quaternion)pParams[5]; | 522 | ret = (object)true; |
544 | linkInfoC.linearLimitLow = (OMV.Vector3)pParams[6]; | 523 | } |
545 | linkInfoC.linearLimitHigh = (OMV.Vector3)pParams[7]; | ||
546 | linkInfoC.angularLimitLow = (OMV.Vector3)pParams[8]; | ||
547 | linkInfoC.angularLimitHigh = (OMV.Vector3)pParams[9]; | ||
548 | ret = (object)true; | ||
549 | } | 524 | } |
550 | } | 525 | // Cause the whole linkset to be rebuilt in post-taint time. |
551 | // Cause the whole linkset to be rebuilt in post-taint time. | 526 | Refresh(child); |
552 | Refresh(child); | 527 | }); |
553 | }); | 528 | } |
554 | } | 529 | } |
555 | } | 530 | } |
556 | break; | 531 | break; |
532 | case ExtendedPhysics.PhysFunctChangeLinkParams: | ||
533 | break; | ||
557 | default: | 534 | default: |
558 | ret = base.Extension(pFunct, pParams); | 535 | ret = base.Extension(pFunct, pParams); |
559 | break; | 536 | break; |