diff options
author | Melanie Thielker | 2008-11-14 03:32:20 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-14 03:32:20 +0000 |
commit | c79a11cbd1eeb8359ad08178830c94cc0d52f877 (patch) | |
tree | 7ed6329eb68c2077c9b74f0b2cb1b499ed4feaa9 /OpenSim/Framework | |
parent | make inventory item listing more robust. It turns out that a bad item (diff) | |
download | opensim-SC_OLD-c79a11cbd1eeb8359ad08178830c94cc0d52f877.zip opensim-SC_OLD-c79a11cbd1eeb8359ad08178830c94cc0d52f877.tar.gz opensim-SC_OLD-c79a11cbd1eeb8359ad08178830c94cc0d52f877.tar.bz2 opensim-SC_OLD-c79a11cbd1eeb8359ad08178830c94cc0d52f877.tar.xz |
Lots of experimentation yielded a fair approximation of a hip offset from the
physical center of an avatar, for display purposes. This should keep the
avatar feet above ground visually in most cases. Tweaked for both height
extremes and various leg lengths. Improvements welcome
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index f2ceb20..f549461 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -227,6 +227,7 @@ namespace OpenSim.Framework | |||
227 | } | 227 | } |
228 | 228 | ||
229 | protected float m_avatarHeight = 0; | 229 | protected float m_avatarHeight = 0; |
230 | protected float m_hipOffset = 0; | ||
230 | 231 | ||
231 | public virtual float AvatarHeight | 232 | public virtual float AvatarHeight |
232 | { | 233 | { |
@@ -234,6 +235,11 @@ namespace OpenSim.Framework | |||
234 | set { m_avatarHeight = value; } | 235 | set { m_avatarHeight = value; } |
235 | } | 236 | } |
236 | 237 | ||
238 | public virtual float HipOffset | ||
239 | { | ||
240 | get { return m_hipOffset; } | ||
241 | } | ||
242 | |||
237 | public AvatarAppearance() | 243 | public AvatarAppearance() |
238 | { | 244 | { |
239 | m_wearables = new AvatarWearable[MAX_WEARABLES]; | 245 | m_wearables = new AvatarWearable[MAX_WEARABLES]; |
@@ -275,7 +281,12 @@ namespace OpenSim.Framework | |||
275 | + 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height | 281 | + 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height |
276 | + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height | 282 | + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height |
277 | + 0.076f * (float)m_visualparams[148] / 255.0f; // Neck length | 283 | + 0.076f * (float)m_visualparams[148] / 255.0f; // Neck length |
278 | 284 | m_hipOffset = (0.615385f // Half of avatar | |
285 | + 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height | ||
286 | + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height | ||
287 | + 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length | ||
288 | - m_avatarHeight / 2) * 0.3f - 0.04f; | ||
289 | System.Console.WriteLine("Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset); | ||
279 | } | 290 | } |
280 | 291 | ||
281 | public virtual void SetWearable(int wearableId, AvatarWearable wearable) | 292 | public virtual void SetWearable(int wearableId, AvatarWearable wearable) |