diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs index 25084d8..1376a29 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |||
@@ -48,11 +48,10 @@ public abstract class BSConstraint : IDisposable | |||
48 | { | 48 | { |
49 | if (m_enabled) | 49 | if (m_enabled) |
50 | { | 50 | { |
51 | // BulletSimAPI.RemoveConstraint(m_world.ID, m_body1.ID, m_body2.ID); | 51 | m_enabled = false; |
52 | bool success = BulletSimAPI.DestroyConstraint2(m_world.Ptr, m_constraint.Ptr); | 52 | bool success = BulletSimAPI.DestroyConstraint2(m_world.Ptr, m_constraint.Ptr); |
53 | m_world.scene.DetailLog("{0},BSConstraint.Dispose,taint,body1={1},body2={2},success={3}", BSScene.DetailLogZero, m_body1.ID, m_body2.ID, success); | 53 | m_world.scene.DetailLog("{0},BSConstraint.Dispose,taint,body1={1},body2={2},success={3}", BSScene.DetailLogZero, m_body1.ID, m_body2.ID, success); |
54 | m_constraint.Ptr = System.IntPtr.Zero; | 54 | m_constraint.Ptr = System.IntPtr.Zero; |
55 | m_enabled = false; | ||
56 | } | 55 | } |
57 | } | 56 | } |
58 | 57 | ||
@@ -75,6 +74,17 @@ public abstract class BSConstraint : IDisposable | |||
75 | return ret; | 74 | return ret; |
76 | } | 75 | } |
77 | 76 | ||
77 | public virtual bool SetSolverIterations(float cnt) | ||
78 | { | ||
79 | bool ret = false; | ||
80 | if (m_enabled) | ||
81 | { | ||
82 | BulletSimAPI.SetConstraintNumSolverIterations2(m_constraint.Ptr, cnt); | ||
83 | ret = true; | ||
84 | } | ||
85 | return ret; | ||
86 | } | ||
87 | |||
78 | public virtual bool CalculateTransforms() | 88 | public virtual bool CalculateTransforms() |
79 | { | 89 | { |
80 | bool ret = false; | 90 | bool ret = false; |
@@ -97,8 +107,9 @@ public abstract class BSConstraint : IDisposable | |||
97 | ret = CalculateTransforms(); | 107 | ret = CalculateTransforms(); |
98 | if (ret) | 108 | if (ret) |
99 | { | 109 | { |
100 | // m_world.scene.PhysicsLogging.Write("{0},BSConstraint.RecomputeConstraintVariables,taint,enabling,A={1},B={2}", | 110 | // Setting an object's mass to zero (making it static like when it's selected) |
101 | // BSScene.DetailLogZero, Body1.ID, Body2.ID); | 111 | // automatically disables the constraints. |
112 | // If the link is enabled, be sure to set the constraint itself to enabled. | ||
102 | BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true)); | 113 | BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true)); |
103 | } | 114 | } |
104 | else | 115 | else |