Fix previous commit to ignore water height and allow flying underwater (swimming)
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>bullet-2.82
parent
ff892b5bcf
commit
db0c41501c
|
@ -139,21 +139,6 @@ public class BSActorAvatarMove : BSActor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private float ComputeMinFlightHeight()
|
|
||||||
{
|
|
||||||
float waterHeight = m_physicsScene.TerrainManager.GetWaterLevelAtXYZ(m_controllingPrim.RawPosition);
|
|
||||||
float groundHeight = m_physicsScene.TerrainManager.GetTerrainHeightAtXYZ(m_controllingPrim.RawPosition);
|
|
||||||
|
|
||||||
if (groundHeight > waterHeight)
|
|
||||||
{
|
|
||||||
return groundHeight + 8f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return waterHeight + 8f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DeactivateAvatarMove()
|
private void DeactivateAvatarMove()
|
||||||
{
|
{
|
||||||
if (m_velocityMotor != null)
|
if (m_velocityMotor != null)
|
||||||
|
@ -283,7 +268,7 @@ public class BSActorAvatarMove : BSActor
|
||||||
//Alicia: Maintain minimum height when flying
|
//Alicia: Maintain minimum height when flying
|
||||||
if (m_controllingPrim.Flying)
|
if (m_controllingPrim.Flying)
|
||||||
{
|
{
|
||||||
float hover_height = ComputeMinFlightHeight();
|
float hover_height = m_physicsScene.TerrainManager.GetTerrainHeightAtXYZ(m_controllingPrim.RawPosition) + 8f;
|
||||||
|
|
||||||
if( m_controllingPrim.Position.Z < hover_height)
|
if( m_controllingPrim.Position.Z < hover_height)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue