diff options
author | Melanie Thielker | 2008-11-10 01:28:37 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-10 01:28:37 +0000 |
commit | ce37b80c685d089c89311671f526936d39ae965a (patch) | |
tree | 3907bc2872fc263e4866e67dd91b91ca03abd741 /OpenSim | |
parent | * Fixed asset bug. (diff) | |
download | opensim-SC_OLD-ce37b80c685d089c89311671f526936d39ae965a.zip opensim-SC_OLD-ce37b80c685d089c89311671f526936d39ae965a.tar.gz opensim-SC_OLD-ce37b80c685d089c89311671f526936d39ae965a.tar.bz2 opensim-SC_OLD-ce37b80c685d089c89311671f526936d39ae965a.tar.xz |
Thank you, idb, for a patch that fixes avatar height calculation
Our feet will now be above ground
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 7 |
2 files changed, 11 insertions, 17 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 74a9f92..f2ceb20 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -267,22 +267,15 @@ namespace OpenSim.Framework | |||
267 | { | 267 | { |
268 | Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length); | 268 | Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length); |
269 | m_texture = textureEnt; | 269 | m_texture = textureEnt; |
270 | |||
271 | // m_log.DebugFormat("[APPEARANCE]: Setting an avatar appearance with {0} faces", m_texture.FaceTextures.Length); | ||
272 | // for (int i = 0; i < m_texture.FaceTextures.Length; i++) | ||
273 | // { | ||
274 | // Primitive.TextureEntryFace face = m_texture.FaceTextures[i]; | ||
275 | // String textureIdString = (face != null ? face.TextureID.ToString() : "none"); | ||
276 | // m_log.DebugFormat("[APPEARANCE]: Texture {0} is {1}", i, textureIdString); | ||
277 | // } | ||
278 | |||
279 | m_visualparams = visualParam.ToArray(); | 270 | m_visualparams = visualParam.ToArray(); |
271 | m_avatarHeight = 1.23077f // Shortest possible avatar height | ||
272 | + 0.516945f * (float)m_visualparams[25] / 255.0f // Body height | ||
273 | + 0.072514f * (float)m_visualparams[120] / 255.0f // Head size | ||
274 | + 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length | ||
275 | + 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height | ||
276 | + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height | ||
277 | + 0.076f * (float)m_visualparams[148] / 255.0f; // Neck length | ||
280 | 278 | ||
281 | // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. | ||
282 | // (float)m_visualParams[25] = Height | ||
283 | // (float)m_visualParams[125] = LegLength | ||
284 | m_avatarHeight = (1.50856f + (((float) m_visualparams[25]/255.0f)*(2.525506f - 1.50856f))) | ||
285 | + (((float) m_visualparams[125]/255.0f)/1.5f); | ||
286 | } | 279 | } |
287 | 280 | ||
288 | public virtual void SetWearable(int wearableId, AvatarWearable wearable) | 281 | public virtual void SetWearable(int wearableId, AvatarWearable wearable) |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 2cb7e43..e947dc7 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
55 | } | 55 | } |
56 | public class OdeCharacter : PhysicsActor | 56 | public class OdeCharacter : PhysicsActor |
57 | { | 57 | { |
58 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 58 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
59 | 59 | ||
60 | private PhysicsVector _position; | 60 | private PhysicsVector _position; |
61 | private d.Vector3 _zeroPosition; | 61 | private d.Vector3 _zeroPosition; |
@@ -145,7 +145,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
145 | { | 145 | { |
146 | m_colliderarr[i] = false; | 146 | m_colliderarr[i] = false; |
147 | } | 147 | } |
148 | CAPSULE_LENGTH = (size.Z - ((size.Z * height_fudge_factor))); | 148 | CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; |
149 | //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); | ||
149 | 150 | ||
150 | lock (_parent_scene.OdeLock) | 151 | lock (_parent_scene.OdeLock) |
151 | { | 152 | { |
@@ -395,7 +396,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
395 | // float capsuleradius = CAPSULE_RADIUS; | 396 | // float capsuleradius = CAPSULE_RADIUS; |
396 | //capsuleradius = 0.2f; | 397 | //capsuleradius = 0.2f; |
397 | 398 | ||
398 | CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z * heightFudgeFactor))); // subtract 43% of the size | 399 | CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f; |
399 | //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); | 400 | //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); |
400 | d.BodyDestroy(Body); | 401 | d.BodyDestroy(Body); |
401 | 402 | ||