diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs index 1376a29..63a4127 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |||
@@ -49,20 +49,23 @@ public abstract class BSConstraint : IDisposable | |||
49 | if (m_enabled) | 49 | if (m_enabled) |
50 | { | 50 | { |
51 | m_enabled = false; | 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.physicsScene.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 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | public BulletBody Body1 { get { return m_body1; } } | 58 | public BulletBody Body1 { get { return m_body1; } } |
59 | public BulletBody Body2 { get { return m_body2; } } | 59 | public BulletBody Body2 { get { return m_body2; } } |
60 | public BulletConstraint Constraint { get { return m_constraint; } } | ||
61 | public abstract ConstraintType Type { get; } | ||
62 | |||
60 | 63 | ||
61 | public virtual bool SetLinearLimits(Vector3 low, Vector3 high) | 64 | public virtual bool SetLinearLimits(Vector3 low, Vector3 high) |
62 | { | 65 | { |
63 | bool ret = false; | 66 | bool ret = false; |
64 | if (m_enabled) | 67 | if (m_enabled) |
65 | ret = BulletSimAPI.SetLinearLimits2(m_constraint.Ptr, low, high); | 68 | ret = BulletSimAPI.SetLinearLimits2(m_constraint.ptr, low, high); |
66 | return ret; | 69 | return ret; |
67 | } | 70 | } |
68 | 71 | ||
@@ -70,7 +73,7 @@ public abstract class BSConstraint : IDisposable | |||
70 | { | 73 | { |
71 | bool ret = false; | 74 | bool ret = false; |
72 | if (m_enabled) | 75 | if (m_enabled) |
73 | ret = BulletSimAPI.SetAngularLimits2(m_constraint.Ptr, low, high); | 76 | ret = BulletSimAPI.SetAngularLimits2(m_constraint.ptr, low, high); |
74 | return ret; | 77 | return ret; |
75 | } | 78 | } |
76 | 79 | ||
@@ -79,7 +82,7 @@ public abstract class BSConstraint : IDisposable | |||
79 | bool ret = false; | 82 | bool ret = false; |
80 | if (m_enabled) | 83 | if (m_enabled) |
81 | { | 84 | { |
82 | BulletSimAPI.SetConstraintNumSolverIterations2(m_constraint.Ptr, cnt); | 85 | BulletSimAPI.SetConstraintNumSolverIterations2(m_constraint.ptr, cnt); |
83 | ret = true; | 86 | ret = true; |
84 | } | 87 | } |
85 | return ret; | 88 | return ret; |
@@ -91,7 +94,7 @@ public abstract class BSConstraint : IDisposable | |||
91 | if (m_enabled) | 94 | if (m_enabled) |
92 | { | 95 | { |
93 | // Recompute the internal transforms | 96 | // Recompute the internal transforms |
94 | BulletSimAPI.CalculateTransforms2(m_constraint.Ptr); | 97 | BulletSimAPI.CalculateTransforms2(m_constraint.ptr); |
95 | ret = true; | 98 | ret = true; |
96 | } | 99 | } |
97 | return ret; | 100 | return ret; |
@@ -110,11 +113,11 @@ public abstract class BSConstraint : IDisposable | |||
110 | // Setting an object's mass to zero (making it static like when it's selected) | 113 | // Setting an object's mass to zero (making it static like when it's selected) |
111 | // automatically disables the constraints. | 114 | // automatically disables the constraints. |
112 | // If the link is enabled, be sure to set the constraint itself to enabled. | 115 | // If the link is enabled, be sure to set the constraint itself to enabled. |
113 | BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true)); | 116 | BulletSimAPI.SetConstraintEnable2(m_constraint.ptr, m_world.physicsScene.NumericBool(true)); |
114 | } | 117 | } |
115 | else | 118 | else |
116 | { | 119 | { |
117 | m_world.scene.Logger.ErrorFormat("[BULLETSIM CONSTRAINT] CalculateTransforms failed. A={0}, B={1}", Body1.ID, Body2.ID); | 120 | m_world.physicsScene.Logger.ErrorFormat("[BULLETSIM CONSTRAINT] CalculateTransforms failed. A={0}, B={1}", Body1.ID, Body2.ID); |
118 | } | 121 | } |
119 | } | 122 | } |
120 | return ret; | 123 | return ret; |