diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs index 7801d8e..8b0fdeb 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs | |||
@@ -64,9 +64,9 @@ public class BSActorLockAxis : BSActor | |||
64 | public override void Refresh() | 64 | public override void Refresh() |
65 | { | 65 | { |
66 | m_physicsScene.DetailLog("{0},BSActorLockAxis,refresh,lockedAxis={1},enabled={2},pActive={3}", | 66 | m_physicsScene.DetailLog("{0},BSActorLockAxis,refresh,lockedAxis={1},enabled={2},pActive={3}", |
67 | m_controllingPrim.LocalID, m_controllingPrim.LockedAxis, Enabled, m_controllingPrim.IsPhysicallyActive); | 67 | m_controllingPrim.LocalID, m_controllingPrim.LockedAngularAxis, Enabled, m_controllingPrim.IsPhysicallyActive); |
68 | // If all the axis are free, we don't need to exist | 68 | // If all the axis are free, we don't need to exist |
69 | if (m_controllingPrim.LockedAxis == m_controllingPrim.LockedAxisFree) | 69 | if (m_controllingPrim.LockedAngularAxis == m_controllingPrim.LockedAxisFree) |
70 | { | 70 | { |
71 | Enabled = false; | 71 | Enabled = false; |
72 | } | 72 | } |
@@ -123,23 +123,38 @@ public class BSActorLockAxis : BSActor | |||
123 | // Free to move linearly in the region | 123 | // Free to move linearly in the region |
124 | OMV.Vector3 linearLow = OMV.Vector3.Zero; | 124 | OMV.Vector3 linearLow = OMV.Vector3.Zero; |
125 | OMV.Vector3 linearHigh = m_physicsScene.TerrainManager.DefaultRegionSize; | 125 | OMV.Vector3 linearHigh = m_physicsScene.TerrainManager.DefaultRegionSize; |
126 | if (m_controllingPrim.LockedLinearAxis.X != BSPhysObject.FreeAxis) | ||
127 | { | ||
128 | linearLow.X = m_controllingPrim.RawPosition.X; | ||
129 | linearHigh.X = m_controllingPrim.RawPosition.X; | ||
130 | } | ||
131 | if (m_controllingPrim.LockedLinearAxis.Y != BSPhysObject.FreeAxis) | ||
132 | { | ||
133 | linearLow.Y = m_controllingPrim.RawPosition.Y; | ||
134 | linearHigh.Y = m_controllingPrim.RawPosition.Y; | ||
135 | } | ||
136 | if (m_controllingPrim.LockedLinearAxis.Z != BSPhysObject.FreeAxis) | ||
137 | { | ||
138 | linearLow.Z = m_controllingPrim.RawPosition.Z; | ||
139 | linearHigh.Z = m_controllingPrim.RawPosition.Z; | ||
140 | } | ||
126 | axisConstrainer.SetLinearLimits(linearLow, linearHigh); | 141 | axisConstrainer.SetLinearLimits(linearLow, linearHigh); |
127 | 142 | ||
128 | // Angular with some axis locked | 143 | // Angular with some axis locked |
129 | float fPI = (float)Math.PI; | 144 | float fPI = (float)Math.PI; |
130 | OMV.Vector3 angularLow = new OMV.Vector3(-fPI, -fPI, -fPI); | 145 | OMV.Vector3 angularLow = new OMV.Vector3(-fPI, -fPI, -fPI); |
131 | OMV.Vector3 angularHigh = new OMV.Vector3(fPI, fPI, fPI); | 146 | OMV.Vector3 angularHigh = new OMV.Vector3(fPI, fPI, fPI); |
132 | if (m_controllingPrim.LockedAxis.X != 1f) | 147 | if (m_controllingPrim.LockedAngularAxis.X != BSPhysObject.FreeAxis) |
133 | { | 148 | { |
134 | angularLow.X = 0f; | 149 | angularLow.X = 0f; |
135 | angularHigh.X = 0f; | 150 | angularHigh.X = 0f; |
136 | } | 151 | } |
137 | if (m_controllingPrim.LockedAxis.Y != 1f) | 152 | if (m_controllingPrim.LockedAngularAxis.Y != BSPhysObject.FreeAxis) |
138 | { | 153 | { |
139 | angularLow.Y = 0f; | 154 | angularLow.Y = 0f; |
140 | angularHigh.Y = 0f; | 155 | angularHigh.Y = 0f; |
141 | } | 156 | } |
142 | if (m_controllingPrim.LockedAxis.Z != 1f) | 157 | if (m_controllingPrim.LockedAngularAxis.Z != BSPhysObject.FreeAxis) |
143 | { | 158 | { |
144 | angularLow.Z = 0f; | 159 | angularLow.Z = 0f; |
145 | angularHigh.Z = 0f; | 160 | angularHigh.Z = 0f; |