send avatar Height to children, use it in region tp height check

avinationmerge
UbitUmarov 2014-08-16 21:46:25 +01:00
parent dc178959c5
commit 21b3980d2b
1 changed files with 12 additions and 4 deletions

View File

@ -430,7 +430,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
// TODO: Get proper AVG Height // TODO: Get proper AVG Height
float localAVHeight = 1.56f; float localHalfAVHeight = 0.8f;
if (sp.Appearance != null)
localHalfAVHeight = sp.Appearance.AvatarHeight / 2;
float posZLimit = 22; float posZLimit = 22;
// TODO: Check other Scene HeightField // TODO: Check other Scene HeightField
@ -439,10 +442,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
posZLimit = (float)sp.Scene.Heightmap[(int)position.X, (int)position.Y]; posZLimit = (float)sp.Scene.Heightmap[(int)position.X, (int)position.Y];
} }
float newPosZ = posZLimit + localAVHeight; posZLimit += localHalfAVHeight + 0.1f;
if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
if ((position.Z < posZLimit) && !(Single.IsInfinity(posZLimit) || Single.IsNaN(posZLimit)))
{ {
position.Z = newPosZ; position.Z = posZLimit;
} }
if (sp.Flying) if (sp.Flying)
@ -724,6 +728,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// agentCircuit.Appearance = sp.Appearance; // agentCircuit.Appearance = sp.Appearance;
// agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false); // agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false);
agentCircuit.Appearance = new AvatarAppearance(); agentCircuit.Appearance = new AvatarAppearance();
agentCircuit.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
if (currentAgentCircuit != null) if (currentAgentCircuit != null)
{ {
@ -1851,6 +1856,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
//agent.Appearance = sp.Appearance; //agent.Appearance = sp.Appearance;
//agent.Appearance = new AvatarAppearance(sp.Appearance, true, false); //agent.Appearance = new AvatarAppearance(sp.Appearance, true, false);
agent.Appearance = new AvatarAppearance(); agent.Appearance = new AvatarAppearance();
agent.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
@ -1969,6 +1975,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// agent.Appearance = sp.Appearance; // agent.Appearance = sp.Appearance;
// agent.Appearance = new AvatarAppearance(sp.Appearance, true, false); // agent.Appearance = new AvatarAppearance(sp.Appearance, true, false);
agent.Appearance = new AvatarAppearance(); agent.Appearance = new AvatarAppearance();
agent.Appearance.AvatarHeight = sp.Appearance.AvatarHeight;
if (currentAgentCircuit != null) if (currentAgentCircuit != null)
{ {
agent.ServiceURLs = currentAgentCircuit.ServiceURLs; agent.ServiceURLs = currentAgentCircuit.ServiceURLs;