applied Melanie's Avatar hip offset changes from Trunk revision 7286 to the 0.6 stable branch
parent
fdbe41926b
commit
a2c55d7fdb
|
@ -231,6 +231,7 @@ namespace OpenSim.Framework
|
|||
}
|
||||
|
||||
protected float m_avatarHeight = 0;
|
||||
protected float m_hipOffset = 0;
|
||||
|
||||
public virtual float AvatarHeight
|
||||
{
|
||||
|
@ -238,6 +239,11 @@ namespace OpenSim.Framework
|
|||
set { m_avatarHeight = value; }
|
||||
}
|
||||
|
||||
public virtual float HipOffset
|
||||
{
|
||||
get { return m_hipOffset; }
|
||||
}
|
||||
|
||||
public AvatarAppearance()
|
||||
{
|
||||
m_wearables = new AvatarWearable[MAX_WEARABLES];
|
||||
|
@ -279,7 +285,12 @@ namespace OpenSim.Framework
|
|||
+ 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height
|
||||
+ 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height
|
||||
+ 0.076f * (float)m_visualparams[148] / 255.0f; // Neck length
|
||||
|
||||
m_hipOffset = (0.615385f // Half of avatar
|
||||
+ 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height
|
||||
+ 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height
|
||||
+ 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length
|
||||
- m_avatarHeight / 2) * 0.3f - 0.04f;
|
||||
System.Console.WriteLine("Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset);
|
||||
}
|
||||
|
||||
public virtual void SetWearable(int wearableId, AvatarWearable wearable)
|
||||
|
|
|
@ -758,7 +758,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
|
||||
float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y);
|
||||
float newPosZ = posZLimit + localAVHeight;
|
||||
float newPosZ = posZLimit + localAVHeight / 2;
|
||||
if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
|
||||
{
|
||||
pos.Z = newPosZ;
|
||||
|
@ -1751,6 +1751,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
Vector3 pos = m_pos;
|
||||
Vector3 vel = Velocity;
|
||||
Quaternion rot = m_bodyRot;
|
||||
pos.Z -= m_appearance.HipOffset;
|
||||
remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z),
|
||||
new Vector3(vel.X, vel.Y, vel.Z), rot);
|
||||
|
||||
|
@ -1834,6 +1835,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// Note: because Quaternion is a struct, it can't be null
|
||||
Quaternion rot = m_bodyRot;
|
||||
|
||||
Vector3 pos = m_pos;
|
||||
pos.Z -= m_appearance.HipOffset;
|
||||
|
||||
remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid,
|
||||
LocalId, m_pos, m_appearance.Texture.ToBytes(),
|
||||
m_parentID, rot);
|
||||
|
@ -1899,6 +1903,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// Note: because Quaternion is a struct, it can't be null
|
||||
Quaternion rot = m_bodyRot;
|
||||
|
||||
Vector3 pos = m_pos;
|
||||
pos.Z -= m_appearance.HipOffset;
|
||||
|
||||
m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId,
|
||||
m_pos, m_appearance.Texture.ToBytes(), m_parentID, rot);
|
||||
|
||||
|
|
Loading…
Reference in New Issue