From c73c2fb0707ee4dc78a354d932293f3e7e83ac50 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 7 Dec 2012 21:53:33 +0000 Subject: add some default size setting and checks --- OpenSim/Framework/AvatarAppearance.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index b01b8da..2183fb6 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -40,10 +40,12 @@ namespace OpenSim.Framework /// public class AvatarAppearance { + // SL box diferent to size const float AVBOXAJUST = 0.2f; + // constrains for ubitode physics const float AVBOXMINX = 0.2f; const float AVBOXMINY = 0.3f; - const float AVBOXMINZ = 0.5f; + const float AVBOXMINZ = 1.2f; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -60,7 +62,7 @@ namespace OpenSim.Framework protected AvatarWearable[] m_wearables; protected Dictionary> m_attachments; protected float m_avatarHeight = 0; - protected Vector3 m_avatarSize = new Vector3(0.45f, 0.6f, 1.9f); + protected Vector3 m_avatarSize = new Vector3(0.45f, 0.6f, 1.9f); // sl Z cloud value protected Vector3 m_avatarBoxSize = new Vector3(0.45f, 0.6f, 1.9f); protected float m_avatarFeetOffset = 0; protected float m_avatarAnimOffset = 0; @@ -157,6 +159,8 @@ namespace OpenSim.Framework SetDefaultParams(); // SetHeight(); + if(m_avatarHeight == 0) + SetSize(new Vector3(0.45f,0.6f,1.9f)); m_attachments = new Dictionary>(); } @@ -408,6 +412,20 @@ namespace OpenSim.Framework public void SetSize(Vector3 avSize) { + if (avSize.X > 32f) + avSize.X = 32f; + else if (avSize.X < 0.1f) + avSize.X = 0.1f; + + if (avSize.Y > 32f) + avSize.Y = 32f; + else if (avSize.Y < 0.1f) + avSize.Y = 0.1f; + if (avSize.Z > 32f) + avSize.Z = 32f; + else if (avSize.Z < 0.1f) + avSize.Z = 0.1f; + m_avatarSize = avSize; m_avatarBoxSize = avSize; m_avatarBoxSize.Z += AVBOXAJUST; -- cgit v1.1