Thank you, idb, for a patch that fixes avatar height calculation

Our feet will now be above ground
0.6.1-post-fixes
Melanie Thielker 2008-11-10 01:28:37 +00:00
parent e0498e1638
commit ce37b80c68
2 changed files with 11 additions and 17 deletions

View File

@ -267,22 +267,15 @@ namespace OpenSim.Framework
{
Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length);
m_texture = textureEnt;
// m_log.DebugFormat("[APPEARANCE]: Setting an avatar appearance with {0} faces", m_texture.FaceTextures.Length);
// for (int i = 0; i < m_texture.FaceTextures.Length; i++)
// {
// Primitive.TextureEntryFace face = m_texture.FaceTextures[i];
// String textureIdString = (face != null ? face.TextureID.ToString() : "none");
// m_log.DebugFormat("[APPEARANCE]: Texture {0} is {1}", i, textureIdString);
// }
m_visualparams = visualParam.ToArray();
m_avatarHeight = 1.23077f // Shortest possible avatar height
+ 0.516945f * (float)m_visualparams[25] / 255.0f // Body height
+ 0.072514f * (float)m_visualparams[120] / 255.0f // Head size
+ 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length
+ 0.08f * (float)m_visualparams[77] / 255.0f // Shoe heel height
+ 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height
+ 0.076f * (float)m_visualparams[148] / 255.0f; // Neck length
// Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters.
// (float)m_visualParams[25] = Height
// (float)m_visualParams[125] = LegLength
m_avatarHeight = (1.50856f + (((float) m_visualparams[25]/255.0f)*(2.525506f - 1.50856f)))
+ (((float) m_visualparams[125]/255.0f)/1.5f);
}
public virtual void SetWearable(int wearableId, AvatarWearable wearable)

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
public class OdeCharacter : PhysicsActor
{
//private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private PhysicsVector _position;
private d.Vector3 _zeroPosition;
@ -145,7 +145,8 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_colliderarr[i] = false;
}
CAPSULE_LENGTH = (size.Z - ((size.Z * height_fudge_factor)));
CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
//m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
lock (_parent_scene.OdeLock)
{
@ -395,7 +396,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// float capsuleradius = CAPSULE_RADIUS;
//capsuleradius = 0.2f;
CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z * heightFudgeFactor))); // subtract 43% of the size
CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
//m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
d.BodyDestroy(Body);