diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs index aaf92c8..4384cdc 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs | |||
@@ -78,7 +78,7 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
78 | public override void ResetLink() | 78 | public override void ResetLink() |
79 | { | 79 | { |
80 | // constraintType = ConstraintType.D6_CONSTRAINT_TYPE; | 80 | // constraintType = ConstraintType.D6_CONSTRAINT_TYPE; |
81 | constraintType = ConstraintType.FIXED_CONSTRAINT_TYPE; | 81 | constraintType = ConstraintType.BS_FIXED_CONSTRAINT_TYPE; |
82 | linearLimitLow = OMV.Vector3.Zero; | 82 | linearLimitLow = OMV.Vector3.Zero; |
83 | linearLimitHigh = OMV.Vector3.Zero; | 83 | linearLimitHigh = OMV.Vector3.Zero; |
84 | angularLimitLow = OMV.Vector3.Zero; | 84 | angularLimitLow = OMV.Vector3.Zero; |
@@ -115,7 +115,7 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
115 | member.PhysScene.DetailLog("{0},BSLinkInfoConstraint.SetLinkParameters,type={1}", member.LocalID, constraintType); | 115 | member.PhysScene.DetailLog("{0},BSLinkInfoConstraint.SetLinkParameters,type={1}", member.LocalID, constraintType); |
116 | switch (constraintType) | 116 | switch (constraintType) |
117 | { | 117 | { |
118 | case ConstraintType.FIXED_CONSTRAINT_TYPE: | 118 | case ConstraintType.BS_FIXED_CONSTRAINT_TYPE: |
119 | case ConstraintType.D6_CONSTRAINT_TYPE: | 119 | case ConstraintType.D6_CONSTRAINT_TYPE: |
120 | BSConstraint6Dof constrain6dof = constrain as BSConstraint6Dof; | 120 | BSConstraint6Dof constrain6dof = constrain as BSConstraint6Dof; |
121 | if (constrain6dof != null) | 121 | if (constrain6dof != null) |
@@ -179,7 +179,7 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
179 | public override bool ShouldUpdateChildProperties() | 179 | public override bool ShouldUpdateChildProperties() |
180 | { | 180 | { |
181 | bool ret = true; | 181 | bool ret = true; |
182 | if (constraintType == ConstraintType.FIXED_CONSTRAINT_TYPE) | 182 | if (constraintType == ConstraintType.BS_FIXED_CONSTRAINT_TYPE) |
183 | ret = false; | 183 | ret = false; |
184 | 184 | ||
185 | return ret; | 185 | return ret; |
@@ -212,20 +212,28 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
212 | // When rebuilding, it is possible to set properties that would normally require a rebuild. | 212 | // When rebuilding, it is possible to set properties that would normally require a rebuild. |
213 | // If already rebuilding, don't request another rebuild. | 213 | // If already rebuilding, don't request another rebuild. |
214 | // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding. | 214 | // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding. |
215 | if (!Rebuilding && HasAnyChildren) | 215 | lock (this) |
216 | { | 216 | { |
217 | // Queue to happen after all the other taint processing | 217 | if (!RebuildScheduled) |
218 | m_physicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() | ||
219 | { | 218 | { |
220 | if (HasAnyChildren) | 219 | if (!Rebuilding && HasAnyChildren) |
221 | { | 220 | { |
222 | // Constraints that have not been changed are not rebuild but make sure | 221 | RebuildScheduled = true; |
223 | // the constraint of the requestor is rebuilt. | 222 | // Queue to happen after all the other taint processing |
224 | PhysicallyUnlinkAChildFromRoot(LinksetRoot, requestor); | 223 | m_physicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() |
225 | // Rebuild the linkset and all its constraints. | 224 | { |
226 | RecomputeLinksetConstraints(); | 225 | if (HasAnyChildren) |
226 | { | ||
227 | // Constraints that have not been changed are not rebuild but make sure | ||
228 | // the constraint of the requestor is rebuilt. | ||
229 | PhysicallyUnlinkAChildFromRoot(LinksetRoot, requestor); | ||
230 | // Rebuild the linkset and all its constraints. | ||
231 | RecomputeLinksetConstraints(); | ||
232 | } | ||
233 | RebuildScheduled = false; | ||
234 | }); | ||
227 | } | 235 | } |
228 | }); | 236 | } |
229 | } | 237 | } |
230 | } | 238 | } |
231 | 239 | ||
@@ -363,7 +371,7 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
363 | 371 | ||
364 | switch (linkInfo.constraintType) | 372 | switch (linkInfo.constraintType) |
365 | { | 373 | { |
366 | case ConstraintType.FIXED_CONSTRAINT_TYPE: | 374 | case ConstraintType.BS_FIXED_CONSTRAINT_TYPE: |
367 | case ConstraintType.D6_CONSTRAINT_TYPE: | 375 | case ConstraintType.D6_CONSTRAINT_TYPE: |
368 | // Relative position normalized to the root prim | 376 | // Relative position normalized to the root prim |
369 | // Essentually a vector pointing from center of rootPrim to center of li.member | 377 | // Essentually a vector pointing from center of rootPrim to center of li.member |
@@ -536,7 +544,7 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
536 | { | 544 | { |
537 | int requestedType = (int)pParams[2]; | 545 | int requestedType = (int)pParams[2]; |
538 | DetailLog("{0},BSLinksetConstraint.ChangeLinkType,requestedType={1}", LinksetRoot.LocalID, requestedType); | 546 | DetailLog("{0},BSLinksetConstraint.ChangeLinkType,requestedType={1}", LinksetRoot.LocalID, requestedType); |
539 | if (requestedType == (int)ConstraintType.FIXED_CONSTRAINT_TYPE | 547 | if (requestedType == (int)ConstraintType.BS_FIXED_CONSTRAINT_TYPE |
540 | || requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE | 548 | || requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE |
541 | || requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE | 549 | || requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE |
542 | || requestedType == (int)ConstraintType.HINGE_CONSTRAINT_TYPE | 550 | || requestedType == (int)ConstraintType.HINGE_CONSTRAINT_TYPE |
@@ -646,7 +654,7 @@ public sealed class BSLinksetConstraints : BSLinkset | |||
646 | case ExtendedPhysics.PHYS_PARAM_LINK_TYPE: | 654 | case ExtendedPhysics.PHYS_PARAM_LINK_TYPE: |
647 | valueInt = (int)pParams[opIndex + 1]; | 655 | valueInt = (int)pParams[opIndex + 1]; |
648 | ConstraintType valueType = (ConstraintType)valueInt; | 656 | ConstraintType valueType = (ConstraintType)valueInt; |
649 | if (valueType == ConstraintType.FIXED_CONSTRAINT_TYPE | 657 | if (valueType == ConstraintType.BS_FIXED_CONSTRAINT_TYPE |
650 | || valueType == ConstraintType.D6_CONSTRAINT_TYPE | 658 | || valueType == ConstraintType.D6_CONSTRAINT_TYPE |
651 | || valueType == ConstraintType.D6_SPRING_CONSTRAINT_TYPE | 659 | || valueType == ConstraintType.D6_SPRING_CONSTRAINT_TYPE |
652 | || valueType == ConstraintType.HINGE_CONSTRAINT_TYPE | 660 | || valueType == ConstraintType.HINGE_CONSTRAINT_TYPE |