aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAliciaRaven2014-06-18 04:13:45 +0100
committerMichael Cerquoni2014-06-17 23:06:49 -0400
commitdb0c41501c0ff3c45660c4c5360f98e109299b66 (patch)
tree6c439ade568cf9d43bd52aa56311ee0c28b11670
parentAdd upward force to flight when close to the ground. Prevents current belly f... (diff)
downloadopensim-SC_OLD-db0c41501c0ff3c45660c4c5360f98e109299b66.zip
opensim-SC_OLD-db0c41501c0ff3c45660c4c5360f98e109299b66.tar.gz
opensim-SC_OLD-db0c41501c0ff3c45660c4c5360f98e109299b66.tar.bz2
opensim-SC_OLD-db0c41501c0ff3c45660c4c5360f98e109299b66.tar.xz
Fix previous commit to ignore water height and allow flying underwater (swimming)
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs17
1 files changed, 1 insertions, 16 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
index 54bae21..557c4e2 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
@@ -139,21 +139,6 @@ public class BSActorAvatarMove : BSActor
139 } 139 }
140 } 140 }
141 141
142 private float ComputeMinFlightHeight()
143 {
144 float waterHeight = m_physicsScene.TerrainManager.GetWaterLevelAtXYZ(m_controllingPrim.RawPosition);
145 float groundHeight = m_physicsScene.TerrainManager.GetTerrainHeightAtXYZ(m_controllingPrim.RawPosition);
146
147 if (groundHeight > waterHeight)
148 {
149 return groundHeight + 8f;
150 }
151 else
152 {
153 return waterHeight + 8f;
154 }
155 }
156
157 private void DeactivateAvatarMove() 142 private void DeactivateAvatarMove()
158 { 143 {
159 if (m_velocityMotor != null) 144 if (m_velocityMotor != null)
@@ -283,7 +268,7 @@ public class BSActorAvatarMove : BSActor
283 //Alicia: Maintain minimum height when flying 268 //Alicia: Maintain minimum height when flying
284 if (m_controllingPrim.Flying) 269 if (m_controllingPrim.Flying)
285 { 270 {
286 float hover_height = ComputeMinFlightHeight(); 271 float hover_height = m_physicsScene.TerrainManager.GetTerrainHeightAtXYZ(m_controllingPrim.RawPosition) + 8f;
287 272
288 if( m_controllingPrim.Position.Z < hover_height) 273 if( m_controllingPrim.Position.Z < hover_height)
289 { 274 {