diff options
author | Melanie | 2011-11-05 11:17:40 +0000 |
---|---|---|
committer | Melanie | 2011-11-05 11:17:40 +0000 |
commit | 03f5bbcaf2a58990b59d573cdde671ae803e2224 (patch) | |
tree | caa6bad1f5f66f7933be6f6f36013e26fba7a100 /OpenSim/Framework/AvatarAppearance.cs | |
parent | Merge branch 'master' into bigmerge (diff) | |
parent | add myself to the contributors.txt (diff) | |
download | opensim-SC_OLD-03f5bbcaf2a58990b59d573cdde671ae803e2224.zip opensim-SC_OLD-03f5bbcaf2a58990b59d573cdde671ae803e2224.tar.gz opensim-SC_OLD-03f5bbcaf2a58990b59d573cdde671ae803e2224.tar.bz2 opensim-SC_OLD-03f5bbcaf2a58990b59d573cdde671ae803e2224.tar.xz |
Merge branch 'master' into bigmerge
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Framework/AvatarAppearance.cs')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index f147e14..f0580df 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -53,7 +53,6 @@ namespace OpenSim.Framework | |||
53 | protected AvatarWearable[] m_wearables; | 53 | protected AvatarWearable[] m_wearables; |
54 | protected Dictionary<int, List<AvatarAttachment>> m_attachments; | 54 | protected Dictionary<int, List<AvatarAttachment>> m_attachments; |
55 | protected float m_avatarHeight = 0; | 55 | protected float m_avatarHeight = 0; |
56 | protected float m_hipOffset = 0; | ||
57 | 56 | ||
58 | public virtual int Serial | 57 | public virtual int Serial |
59 | { | 58 | { |
@@ -89,11 +88,6 @@ namespace OpenSim.Framework | |||
89 | set { m_avatarHeight = value; } | 88 | set { m_avatarHeight = value; } |
90 | } | 89 | } |
91 | 90 | ||
92 | public virtual float HipOffset | ||
93 | { | ||
94 | get { return m_hipOffset; } | ||
95 | } | ||
96 | |||
97 | public AvatarAppearance() | 91 | public AvatarAppearance() |
98 | { | 92 | { |
99 | // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance"); | 93 | // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance"); |
@@ -184,7 +178,6 @@ namespace OpenSim.Framework | |||
184 | m_visualparams = (byte[])appearance.VisualParams.Clone(); | 178 | m_visualparams = (byte[])appearance.VisualParams.Clone(); |
185 | 179 | ||
186 | m_avatarHeight = appearance.m_avatarHeight; | 180 | m_avatarHeight = appearance.m_avatarHeight; |
187 | m_hipOffset = appearance.m_hipOffset; | ||
188 | 181 | ||
189 | // Copy the attachment, force append mode since that ensures consistency | 182 | // Copy the attachment, force append mode since that ensures consistency |
190 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); | 183 | m_attachments = new Dictionary<int, List<AvatarAttachment>>(); |
@@ -347,20 +340,18 @@ namespace OpenSim.Framework | |||
347 | 340 | ||
348 | public virtual void SetHeight() | 341 | public virtual void SetHeight() |
349 | { | 342 | { |
350 | m_avatarHeight = 1.23077f // Shortest possible avatar height | 343 | // Start with shortest possible female avatar height |
351 | + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height | 344 | m_avatarHeight = 1.14597f; |
352 | + 0.072514f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f // Head size | 345 | // Add offset for male avatars |
353 | + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length | 346 | if (m_visualparams[(int)VPElement.SHAPE_MALE] != 0) |
354 | + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height | 347 | m_avatarHeight += 0.0848f; |
355 | + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height | 348 | // Add offsets for visual params |
356 | + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; // Neck length | 349 | m_avatarHeight += 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f |
357 | 350 | + 0.08117f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f | |
358 | m_hipOffset = (((1.23077f // Half of avatar | 351 | + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f |
359 | + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height | 352 | + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f |
360 | + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length | 353 | + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f |
361 | + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height | 354 | + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; |
362 | + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height | ||
363 | ) / 2) - m_avatarHeight / 2) * 0.31f - 0.0425f; | ||
364 | } | 355 | } |
365 | 356 | ||
366 | public virtual void SetWearable(int wearableId, AvatarWearable wearable) | 357 | public virtual void SetWearable(int wearableId, AvatarWearable wearable) |
@@ -591,7 +582,6 @@ namespace OpenSim.Framework | |||
591 | 582 | ||
592 | data["serial"] = OSD.FromInteger(m_serial); | 583 | data["serial"] = OSD.FromInteger(m_serial); |
593 | data["height"] = OSD.FromReal(m_avatarHeight); | 584 | data["height"] = OSD.FromReal(m_avatarHeight); |
594 | data["hipoffset"] = OSD.FromReal(m_hipOffset); | ||
595 | 585 | ||
596 | // Wearables | 586 | // Wearables |
597 | OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES); | 587 | OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES); |
@@ -636,8 +626,6 @@ namespace OpenSim.Framework | |||
636 | m_serial = data["serial"].AsInteger(); | 626 | m_serial = data["serial"].AsInteger(); |
637 | if ((data != null) && (data["height"] != null)) | 627 | if ((data != null) && (data["height"] != null)) |
638 | m_avatarHeight = (float)data["height"].AsReal(); | 628 | m_avatarHeight = (float)data["height"].AsReal(); |
639 | if ((data != null) && (data["hipoffset"] != null)) | ||
640 | m_hipOffset = (float)data["hipoffset"].AsReal(); | ||
641 | 629 | ||
642 | try | 630 | try |
643 | { | 631 | { |