FIX small avatars movement on terrain. (avatar appearance getting even

more messy)
avinationmerge
UbitUmarov 2012-12-13 07:34:27 +00:00
parent 20773dcfcc
commit b3a77c16bd
2 changed files with 39 additions and 5 deletions

View File

@ -5122,7 +5122,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
update.PCode = (byte)PCode.Avatar; update.PCode = (byte)PCode.Avatar;
update.ProfileCurve = 1; update.ProfileCurve = 1;
update.PSBlock = Utils.EmptyBytes; update.PSBlock = Utils.EmptyBytes;
update.Scale = new Vector3(0.45f, 0.6f, 1.9f); update.Scale = data.Appearance.AvatarSize;
// update.Scale.Z -= 0.2f;
update.Text = Utils.EmptyBytes; update.Text = Utils.EmptyBytes;
update.TextColor = new byte[4]; update.TextColor = new byte[4];

View File

@ -140,6 +140,8 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3 m_lastPosition; private Vector3 m_lastPosition;
private Quaternion m_lastRotation; private Quaternion m_lastRotation;
private Vector3 m_lastVelocity; private Vector3 m_lastVelocity;
private Vector3 m_lastSize = new Vector3(0.45f,0.6f,1.9f);
private Vector3? m_forceToApply; private Vector3? m_forceToApply;
private int m_userFlags; private int m_userFlags;
@ -563,6 +565,23 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public override Vector3 AngularVelocity
{
get
{
if (PhysicsActor != null)
{
m_rotationalvelocity = PhysicsActor.RotationalVelocity;
// m_log.DebugFormat(
// "[SCENE PRESENCE]: Set velocity {0} for {1} in {2} via getting Velocity!",
// m_velocity, Name, Scene.RegionInfo.RegionName);
}
return m_rotationalvelocity;
}
}
private Quaternion m_bodyRot = Quaternion.Identity; private Quaternion m_bodyRot = Quaternion.Identity;
public Quaternion Rotation public Quaternion Rotation
@ -1264,6 +1283,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (PhysicsActor != null && !IsChildAgent) if (PhysicsActor != null && !IsChildAgent)
PhysicsActor.setAvatarSize(size, feetoffset); PhysicsActor.setAvatarSize(size, feetoffset);
} }
/// <summary> /// <summary>
@ -2572,9 +2592,13 @@ namespace OpenSim.Region.Framework.Scenes
// NOTE: Velocity is not the same as m_velocity. Velocity will attempt to // NOTE: Velocity is not the same as m_velocity. Velocity will attempt to
// grab the latest PhysicsActor velocity, whereas m_velocity is often // grab the latest PhysicsActor velocity, whereas m_velocity is often
// storing a requested force instead of an actual traveling velocity // storing a requested force instead of an actual traveling velocity
if (Appearance.AvatarSize != m_lastSize)
{
m_lastSize = Appearance.AvatarSize;
SendAvatarDataToAllAgents();
}
// Throw away duplicate or insignificant updates else if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
!Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))
{ {
@ -2872,6 +2896,8 @@ namespace OpenSim.Region.Framework.Scenes
avatar.ControllingClient.SendAppearance( avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
} }
#endregion #endregion
@ -3517,10 +3543,9 @@ namespace OpenSim.Region.Framework.Scenes
// m_lastColCount = coldata.Count; // m_lastColCount = coldata.Count;
// } // }
CollisionPlane = Vector4.UnitW;
if (coldata.Count != 0) if (coldata.Count != 0)
{ {
/*
switch (Animator.CurrentMovementAnimation) switch (Animator.CurrentMovementAnimation)
{ {
case "STAND": case "STAND":
@ -3529,6 +3554,7 @@ namespace OpenSim.Region.Framework.Scenes
case "CROUCH": case "CROUCH":
case "CROUCHWALK": case "CROUCHWALK":
{ {
*/
ContactPoint lowest; ContactPoint lowest;
lowest.SurfaceNormal = Vector3.Zero; lowest.SurfaceNormal = Vector3.Zero;
lowest.Position = Vector3.Zero; lowest.Position = Vector3.Zero;
@ -3548,10 +3574,16 @@ namespace OpenSim.Region.Framework.Scenes
lowest.SurfaceNormal = -lowest.SurfaceNormal; lowest.SurfaceNormal = -lowest.SurfaceNormal;
CollisionPlane = new Vector4(lowest.SurfaceNormal, Vector3.Dot(lowest.Position, lowest.SurfaceNormal)); CollisionPlane = new Vector4(lowest.SurfaceNormal, Vector3.Dot(lowest.Position, lowest.SurfaceNormal));
} }
else
CollisionPlane = Vector4.UnitW;
/*
} }
break; break;
} }
*/
} }
else
CollisionPlane = Vector4.UnitW;
RaiseCollisionScriptEvents(coldata); RaiseCollisionScriptEvents(coldata);