diff options
author | UbitUmarov | 2012-04-13 20:34:56 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-13 20:34:56 +0100 |
commit | b574d43c5d5706cf6325c909ddf0ff573e44e49b (patch) | |
tree | 9253deb93ff3f46f9202bd4dd48d9a46e51d1735 /OpenSim | |
parent | don't do Animator.UpdateMovementAnimations() in scenepresence RegionHeartbea... (diff) | |
download | opensim-SC_OLD-b574d43c5d5706cf6325c909ddf0ff573e44e49b.zip opensim-SC_OLD-b574d43c5d5706cf6325c909ddf0ff573e44e49b.tar.gz opensim-SC_OLD-b574d43c5d5706cf6325c909ddf0ff573e44e49b.tar.bz2 opensim-SC_OLD-b574d43c5d5706cf6325c909ddf0ff573e44e49b.tar.xz |
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).
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c4b75bd..855a341 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -753,7 +753,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
753 | if (m_movementAnimationUpdateCounter >= 2) | 753 | if (m_movementAnimationUpdateCounter >= 2) |
754 | { | 754 | { |
755 | m_movementAnimationUpdateCounter = 0; | 755 | m_movementAnimationUpdateCounter = 0; |
756 | if (Animator != null && ParentID == 0) // don't do it sitting | 756 | if (Animator != null && ParentID == 0) // skip it if sitting |
757 | { | 757 | { |
758 | Animator.UpdateMovementAnimations(); | 758 | Animator.UpdateMovementAnimations(); |
759 | } | 759 | } |
@@ -1386,8 +1386,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1386 | { | 1386 | { |
1387 | if (m_followCamAuto) | 1387 | if (m_followCamAuto) |
1388 | { | 1388 | { |
1389 | Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT; | 1389 | // Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT; |
1390 | m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback); | 1390 | // m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback); |
1391 | Vector3 posAdjusted = AbsolutePosition + HEAD_ADJUSTMENT; | ||
1392 | Vector3 distTocam = CameraPosition - posAdjusted; | ||
1393 | float distTocamlen = distTocam.Length(); | ||
1394 | if (distTocamlen > 0) | ||
1395 | { | ||
1396 | distTocam *= 1.0f / distTocamlen; | ||
1397 | m_scene.PhysicsScene.RaycastWorld(posAdjusted, distTocam, distTocamlen + 0.3f, RayCastCameraCallback); | ||
1398 | } | ||
1391 | } | 1399 | } |
1392 | } | 1400 | } |
1393 | 1401 | ||