aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
index b3347bf..aaf92c8 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
@@ -63,6 +63,8 @@ public sealed class BSLinksetConstraints : BSLinkset
63 public bool[] springAxisEnable; 63 public bool[] springAxisEnable;
64 public float[] springDamping; 64 public float[] springDamping;
65 public float[] springStiffness; 65 public float[] springStiffness;
66 public OMV.Vector3 springLinearEquilibriumPoint;
67 public OMV.Vector3 springAngularEquilibriumPoint;
66 68
67 public BSLinkInfoConstraint(BSPrimLinkable pMember) 69 public BSLinkInfoConstraint(BSPrimLinkable pMember)
68 : base(pMember) 70 : base(pMember)
@@ -102,6 +104,8 @@ public sealed class BSLinksetConstraints : BSLinkset
102 springDamping[ii] = BSAPITemplate.SPRING_NOT_SPECIFIED; 104 springDamping[ii] = BSAPITemplate.SPRING_NOT_SPECIFIED;
103 springStiffness[ii] = BSAPITemplate.SPRING_NOT_SPECIFIED; 105 springStiffness[ii] = BSAPITemplate.SPRING_NOT_SPECIFIED;
104 } 106 }
107 springLinearEquilibriumPoint = OMV.Vector3.Zero;
108 springAngularEquilibriumPoint = OMV.Vector3.Zero;
105 member.PhysScene.DetailLog("{0},BSLinkInfoConstraint.ResetLink", member.LocalID); 109 member.PhysScene.DetailLog("{0},BSLinkInfoConstraint.ResetLink", member.LocalID);
106 } 110 }
107 111
@@ -155,7 +159,12 @@ public sealed class BSLinksetConstraints : BSLinkset
155 if (springStiffness[ii] != BSAPITemplate.SPRING_NOT_SPECIFIED) 159 if (springStiffness[ii] != BSAPITemplate.SPRING_NOT_SPECIFIED)
156 constrainSpring.SetStiffness(ii, springStiffness[ii]); 160 constrainSpring.SetStiffness(ii, springStiffness[ii]);
157 } 161 }
158 constrainSpring.SetEquilibriumPoint(BSAPITemplate.SPRING_NOT_SPECIFIED, BSAPITemplate.SPRING_NOT_SPECIFIED); 162 constrainSpring.CalculateTransforms();
163
164 if (springLinearEquilibriumPoint != OMV.Vector3.Zero)
165 constrainSpring.SetEquilibriumPoint(springLinearEquilibriumPoint, springAngularEquilibriumPoint);
166 else
167 constrainSpring.SetEquilibriumPoint(BSAPITemplate.SPRING_NOT_SPECIFIED, BSAPITemplate.SPRING_NOT_SPECIFIED);
159 } 168 }
160 break; 169 break;
161 default: 170 default:
@@ -618,6 +627,7 @@ public sealed class BSLinksetConstraints : BSLinkset
618 float valueFloat; 627 float valueFloat;
619 bool valueBool; 628 bool valueBool;
620 OMV.Vector3 valueVector; 629 OMV.Vector3 valueVector;
630 OMV.Vector3 valueVector2;
621 OMV.Quaternion valueQuaternion; 631 OMV.Quaternion valueQuaternion;
622 int axisLow, axisHigh; 632 int axisLow, axisHigh;
623 633
@@ -764,6 +774,14 @@ public sealed class BSLinksetConstraints : BSLinkset
764 linkInfo.springStiffness[ii] = valueFloat; 774 linkInfo.springStiffness[ii] = valueFloat;
765 opIndex += 3; 775 opIndex += 3;
766 break; 776 break;
777 case ExtendedPhysics.PHYS_PARAM_SPRING_EQUILIBRIUM_POINT:
778 errMsg = "PHYS_PARAM_SPRING_EQUILIBRIUM_POINT takes two parameters of type vector";
779 valueVector = (OMV.Vector3)pParams[opIndex + 1];
780 valueVector2 = (OMV.Vector3)pParams[opIndex + 2];
781 linkInfo.springLinearEquilibriumPoint = valueVector;
782 linkInfo.springAngularEquilibriumPoint = valueVector2;
783 opIndex += 3;
784 break;
767 case ExtendedPhysics.PHYS_PARAM_USE_LINEAR_FRAMEA: 785 case ExtendedPhysics.PHYS_PARAM_USE_LINEAR_FRAMEA:
768 errMsg = "PHYS_PARAM_USE_LINEAR_FRAMEA takes one parameter of type integer (bool)"; 786 errMsg = "PHYS_PARAM_USE_LINEAR_FRAMEA takes one parameter of type integer (bool)";
769 valueBool = ((int)pParams[opIndex + 1]) != 0; 787 valueBool = ((int)pParams[opIndex + 1]) != 0;