Use presence absolute position to request raycast to camera. Used m_pos maybe a sitting offset. For reasons i don't understand that also seems to crash ode more when i let this rays colide with heighmaps (ubitODE with normal ode lib).

avinationmerge
UbitUmarov 2012-04-13 20:34:56 +01:00
parent 5da77e047a
commit b574d43c5d
1 changed files with 11 additions and 3 deletions

View File

@ -753,7 +753,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_movementAnimationUpdateCounter >= 2) if (m_movementAnimationUpdateCounter >= 2)
{ {
m_movementAnimationUpdateCounter = 0; m_movementAnimationUpdateCounter = 0;
if (Animator != null && ParentID == 0) // don't do it sitting if (Animator != null && ParentID == 0) // skip it if sitting
{ {
Animator.UpdateMovementAnimations(); Animator.UpdateMovementAnimations();
} }
@ -1386,8 +1386,16 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (m_followCamAuto) if (m_followCamAuto)
{ {
Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT; // Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT;
m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback); // m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback);
Vector3 posAdjusted = AbsolutePosition + HEAD_ADJUSTMENT;
Vector3 distTocam = CameraPosition - posAdjusted;
float distTocamlen = distTocam.Length();
if (distTocamlen > 0)
{
distTocam *= 1.0f / distTocamlen;
m_scene.PhysicsScene.RaycastWorld(posAdjusted, distTocam, distTocamlen + 0.3f, RayCastCameraCallback);
}
} }
} }