* The client prevents the avatar from landing if the avatar is going above an unknown certain speed, so, add a speed check on the server.
* This addresses the 'hump the prim' animation playing while you're moving forward full speed and pressing page down over a prim to land.0.6.8-post-fixes
parent
8db97f7dab
commit
c155099faf
|
@ -152,6 +152,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private Quaternion m_bodyRot= Quaternion.Identity;
|
private Quaternion m_bodyRot= Quaternion.Identity;
|
||||||
|
|
||||||
|
private const int LAND_VELOCITYMAG_MAX = 12;
|
||||||
|
|
||||||
public bool IsRestrictedToRegion;
|
public bool IsRestrictedToRegion;
|
||||||
|
|
||||||
public string JID = String.Empty;
|
public string JID = String.Empty;
|
||||||
|
@ -978,8 +980,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void StopFlying()
|
public void StopFlying()
|
||||||
{
|
{
|
||||||
// It turns out to get the agent to stop flying, you have to feed it stop flying velocities
|
// It turns out to get the agent to stop flying, you have to feed it stop flying velocities
|
||||||
// and send a full object update.
|
// There's no explicit message to send the client to tell it to stop flying.. it relies on the
|
||||||
// There's no message to send the client to tell it to stop flying
|
// velocity, collision plane and avatar height
|
||||||
|
|
||||||
// Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
|
// Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
|
||||||
// when the avatar stands up
|
// when the avatar stands up
|
||||||
|
@ -993,8 +995,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f));
|
AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f));
|
||||||
}
|
}
|
||||||
|
|
||||||
Animator.TrySetMovementAnimation("LAND");
|
|
||||||
//SendFullUpdateToAllClients();
|
|
||||||
ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
|
ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
|
||||||
AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
|
AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
|
||||||
}
|
}
|
||||||
|
@ -1431,6 +1431,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Only do this if we're flying
|
// Only do this if we're flying
|
||||||
if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly)
|
if (m_physicsActor != null && m_physicsActor.Flying && !m_forceFly)
|
||||||
{
|
{
|
||||||
|
// Landing detection code
|
||||||
|
|
||||||
// Are the landing controls requirements filled?
|
// Are the landing controls requirements filled?
|
||||||
bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) ||
|
bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) ||
|
||||||
((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
|
((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
|
||||||
|
@ -1440,7 +1442,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (m_physicsActor.Flying && colliding && controlland)
|
if (m_physicsActor.Flying && colliding && controlland)
|
||||||
{
|
{
|
||||||
StopFlying();
|
// nesting this check because LengthSquared() is expensive and we don't
|
||||||
|
// want to do it every step when flying.
|
||||||
|
if ((Velocity.LengthSquared() <= LAND_VELOCITYMAG_MAX))
|
||||||
|
StopFlying();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue