diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs index a20be3a..65fac00 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |||
@@ -34,12 +34,20 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
34 | 34 | ||
35 | public abstract class BSConstraint : IDisposable | 35 | public abstract class BSConstraint : IDisposable |
36 | { | 36 | { |
37 | private static string LogHeader = "[BULLETSIM CONSTRAINT]"; | ||
38 | |||
37 | protected BulletSim m_world; | 39 | protected BulletSim m_world; |
38 | protected BulletBody m_body1; | 40 | protected BulletBody m_body1; |
39 | protected BulletBody m_body2; | 41 | protected BulletBody m_body2; |
40 | protected BulletConstraint m_constraint; | 42 | protected BulletConstraint m_constraint; |
41 | protected bool m_enabled = false; | 43 | protected bool m_enabled = false; |
42 | 44 | ||
45 | public BulletBody Body1 { get { return m_body1; } } | ||
46 | public BulletBody Body2 { get { return m_body2; } } | ||
47 | public BulletConstraint Constraint { get { return m_constraint; } } | ||
48 | public abstract ConstraintType Type { get; } | ||
49 | public bool IsEnabled { get { return m_enabled; } } | ||
50 | |||
43 | public BSConstraint() | 51 | public BSConstraint() |
44 | { | 52 | { |
45 | } | 53 | } |
@@ -53,7 +61,7 @@ public abstract class BSConstraint : IDisposable | |||
53 | { | 61 | { |
54 | bool success = BulletSimAPI.DestroyConstraint2(m_world.ptr, m_constraint.ptr); | 62 | bool success = BulletSimAPI.DestroyConstraint2(m_world.ptr, m_constraint.ptr); |
55 | m_world.physicsScene.DetailLog("{0},BSConstraint.Dispose,taint,id1={1},body1={2},id2={3},body2={4},success={5}", | 63 | m_world.physicsScene.DetailLog("{0},BSConstraint.Dispose,taint,id1={1},body1={2},id2={3},body2={4},success={5}", |
56 | BSScene.DetailLogZero, | 64 | BSScene.DetailLogZero, |
57 | m_body1.ID, m_body1.ptr.ToString("X"), | 65 | m_body1.ID, m_body1.ptr.ToString("X"), |
58 | m_body2.ID, m_body2.ptr.ToString("X"), | 66 | m_body2.ID, m_body2.ptr.ToString("X"), |
59 | success); | 67 | success); |
@@ -62,12 +70,6 @@ public abstract class BSConstraint : IDisposable | |||
62 | } | 70 | } |
63 | } | 71 | } |
64 | 72 | ||
65 | public BulletBody Body1 { get { return m_body1; } } | ||
66 | public BulletBody Body2 { get { return m_body2; } } | ||
67 | public BulletConstraint Constraint { get { return m_constraint; } } | ||
68 | public abstract ConstraintType Type { get; } | ||
69 | |||
70 | |||
71 | public virtual bool SetLinearLimits(Vector3 low, Vector3 high) | 73 | public virtual bool SetLinearLimits(Vector3 low, Vector3 high) |
72 | { | 74 | { |
73 | bool ret = false; | 75 | bool ret = false; |
@@ -124,7 +126,7 @@ public abstract class BSConstraint : IDisposable | |||
124 | } | 126 | } |
125 | else | 127 | else |
126 | { | 128 | { |
127 | m_world.physicsScene.Logger.ErrorFormat("[BULLETSIM CONSTRAINT] CalculateTransforms failed. A={0}, B={1}", Body1.ID, Body2.ID); | 129 | m_world.physicsScene.Logger.ErrorFormat("{0} CalculateTransforms failed. A={1}, B={2}", LogHeader, Body1.ID, Body2.ID); |
128 | } | 130 | } |
129 | } | 131 | } |
130 | return ret; | 132 | return ret; |