diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 9e912de..b01b8da 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -40,6 +40,11 @@ namespace OpenSim.Framework | |||
40 | /// </summary> | 40 | /// </summary> |
41 | public class AvatarAppearance | 41 | public class AvatarAppearance |
42 | { | 42 | { |
43 | const float AVBOXAJUST = 0.2f; | ||
44 | const float AVBOXMINX = 0.2f; | ||
45 | const float AVBOXMINY = 0.3f; | ||
46 | const float AVBOXMINZ = 0.5f; | ||
47 | |||
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 49 | ||
45 | // this is viewer capabilities and weared things dependent | 50 | // this is viewer capabilities and weared things dependent |
@@ -60,9 +65,6 @@ namespace OpenSim.Framework | |||
60 | protected float m_avatarFeetOffset = 0; | 65 | protected float m_avatarFeetOffset = 0; |
61 | protected float m_avatarAnimOffset = 0; | 66 | protected float m_avatarAnimOffset = 0; |
62 | 67 | ||
63 | |||
64 | private AvatarSkeleton skeleton = new AvatarSkeleton(); | ||
65 | |||
66 | public virtual int Serial | 68 | public virtual int Serial |
67 | { | 69 | { |
68 | get { return m_serial; } | 70 | get { return m_serial; } |
@@ -120,7 +122,8 @@ namespace OpenSim.Framework | |||
120 | SetDefaultWearables(); | 122 | SetDefaultWearables(); |
121 | SetDefaultTexture(); | 123 | SetDefaultTexture(); |
122 | SetDefaultParams(); | 124 | SetDefaultParams(); |
123 | SetHeight(); | 125 | // SetHeight(); |
126 | SetSize(new Vector3(0.45f,0.6f,1.9f)); | ||
124 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); | 127 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); |
125 | } | 128 | } |
126 | 129 | ||
@@ -129,7 +132,7 @@ namespace OpenSim.Framework | |||
129 | // m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap"); | 132 | // m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap"); |
130 | 133 | ||
131 | Unpack(map); | 134 | Unpack(map); |
132 | SetHeight(); | 135 | // SetHeight(); done in Unpack |
133 | } | 136 | } |
134 | 137 | ||
135 | public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams) | 138 | public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams) |
@@ -153,7 +156,7 @@ namespace OpenSim.Framework | |||
153 | else | 156 | else |
154 | SetDefaultParams(); | 157 | SetDefaultParams(); |
155 | 158 | ||
156 | SetHeight(); | 159 | // SetHeight(); |
157 | 160 | ||
158 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); | 161 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); |
159 | } | 162 | } |
@@ -172,7 +175,8 @@ namespace OpenSim.Framework | |||
172 | SetDefaultWearables(); | 175 | SetDefaultWearables(); |
173 | SetDefaultTexture(); | 176 | SetDefaultTexture(); |
174 | SetDefaultParams(); | 177 | SetDefaultParams(); |
175 | SetHeight(); | 178 | // SetHeight(); |
179 | SetSize(new Vector3(0.45f, 0.6f, 1.9f)); | ||
176 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); | 180 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); |
177 | 181 | ||
178 | return; | 182 | return; |
@@ -201,7 +205,8 @@ namespace OpenSim.Framework | |||
201 | if (appearance.VisualParams != null) | 205 | if (appearance.VisualParams != null) |
202 | m_visualparams = (byte[])appearance.VisualParams.Clone(); | 206 | m_visualparams = (byte[])appearance.VisualParams.Clone(); |
203 | 207 | ||
204 | m_avatarHeight = appearance.m_avatarHeight; | 208 | // m_avatarHeight = appearance.m_avatarHeight; |
209 | SetSize(appearance.AvatarSize); | ||
205 | 210 | ||
206 | // Copy the attachment, force append mode since that ensures consistency | 211 | // Copy the attachment, force append mode since that ensures consistency |
207 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); | 212 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); |
@@ -368,8 +373,8 @@ namespace OpenSim.Framework | |||
368 | } | 373 | } |
369 | } | 374 | } |
370 | // Reset the height if the visual parameters actually changed | 375 | // Reset the height if the visual parameters actually changed |
371 | if (changed) | 376 | // if (changed) |
372 | SetHeight(); | 377 | // SetHeight(); |
373 | 378 | ||
374 | return changed; | 379 | return changed; |
375 | } | 380 | } |
@@ -399,11 +404,19 @@ namespace OpenSim.Framework | |||
399 | + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f | 404 | + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f |
400 | + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; | 405 | + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; |
401 | */ | 406 | */ |
402 | 407 | } | |
403 | skeleton.ApplyVisualParameters(m_visualparams); | 408 | |
404 | m_avatarSize = skeleton.StandSize; | 409 | public void SetSize(Vector3 avSize) |
405 | m_avatarBoxSize = skeleton.StandBoxSize; | 410 | { |
406 | m_avatarFeetOffset = skeleton.FeetOffset; | 411 | m_avatarSize = avSize; |
412 | m_avatarBoxSize = avSize; | ||
413 | m_avatarBoxSize.Z += AVBOXAJUST; | ||
414 | if (m_avatarBoxSize.X < AVBOXMINX) | ||
415 | m_avatarBoxSize.X = AVBOXMINX; | ||
416 | if (m_avatarBoxSize.Y < AVBOXMINY) | ||
417 | m_avatarBoxSize.Y = AVBOXMINY; | ||
418 | if (m_avatarBoxSize.Z < AVBOXMINZ) | ||
419 | m_avatarBoxSize.Z = AVBOXMINZ; | ||
407 | m_avatarHeight = m_avatarSize.Z; | 420 | m_avatarHeight = m_avatarSize.Z; |
408 | } | 421 | } |
409 | 422 | ||
@@ -678,8 +691,9 @@ namespace OpenSim.Framework | |||
678 | { | 691 | { |
679 | if ((data != null) && (data["serial"] != null)) | 692 | if ((data != null) && (data["serial"] != null)) |
680 | m_serial = data["serial"].AsInteger(); | 693 | m_serial = data["serial"].AsInteger(); |
681 | // if ((data != null) && (data["height"] != null)) | 694 | if ((data != null) && (data["height"] != null)) |
682 | // m_avatarHeight = (float)data["height"].AsReal(); | 695 | // m_avatarHeight = (float)data["height"].AsReal(); |
696 | SetSize(new Vector3(0.45f,0.6f, (float)data["height"].AsReal())); | ||
683 | 697 | ||
684 | try | 698 | try |
685 | { | 699 | { |
@@ -741,7 +755,6 @@ namespace OpenSim.Framework | |||
741 | // att.ItemID, att.AssetID, att.AttachPoint); | 755 | // att.ItemID, att.AssetID, att.AttachPoint); |
742 | } | 756 | } |
743 | } | 757 | } |
744 | SetHeight(); | ||
745 | } | 758 | } |
746 | catch (Exception e) | 759 | catch (Exception e) |
747 | { | 760 | { |