diff options
author | Justin Clark-Casey (justincc) | 2011-08-11 03:05:51 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-11 03:06:38 +0100 |
commit | 1aa171189397f34d7d18fb358f7bd767d241675a (patch) | |
tree | 474334e8cd0c01f4d39a7aab1aaae5bef55316ea /OpenSim/Region/Framework/Scenes | |
parent | instead of setting avatar rotation twice in SP.HandleAgentUpdate(), eliminate... (diff) | |
download | opensim-SC_OLD-1aa171189397f34d7d18fb358f7bd767d241675a.zip opensim-SC_OLD-1aa171189397f34d7d18fb358f7bd767d241675a.tar.gz opensim-SC_OLD-1aa171189397f34d7d18fb358f7bd767d241675a.tar.bz2 opensim-SC_OLD-1aa171189397f34d7d18fb358f7bd767d241675a.tar.xz |
eliminate the rotation parameter from SP.HandleMoveToTargetUpdate(). This can just use the currently set Rotation
looks like I spoke to soon about eliminating jerkiness on "go here"/autopilot. It's still there.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a1bd672..afa896c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1496,7 +1496,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1496 | } | 1496 | } |
1497 | else if (bAllowUpdateMoveToPosition) | 1497 | else if (bAllowUpdateMoveToPosition) |
1498 | { | 1498 | { |
1499 | if (HandleMoveToTargetUpdate(ref agent_control_v3, bodyRotation)) | 1499 | if (HandleMoveToTargetUpdate(ref agent_control_v3)) |
1500 | update_movementflag = true; | 1500 | update_movementflag = true; |
1501 | } | 1501 | } |
1502 | } | 1502 | } |
@@ -1556,9 +1556,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1556 | /// This doesn't actually perform the movement. Instead, it adds its vector to agent_control_v3. | 1556 | /// This doesn't actually perform the movement. Instead, it adds its vector to agent_control_v3. |
1557 | /// </remarks> | 1557 | /// </remarks> |
1558 | /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> | 1558 | /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> |
1559 | /// <param value="bodyRotation">New body rotation of the avatar.</param> | ||
1560 | /// <returns>True if movement has been updated in some way. False otherwise.</returns> | 1559 | /// <returns>True if movement has been updated in some way. False otherwise.</returns> |
1561 | public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3, Quaternion bodyRotation) | 1560 | public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3) |
1562 | { | 1561 | { |
1563 | // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); | 1562 | // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); |
1564 | 1563 | ||
@@ -1594,7 +1593,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1594 | // to such forces, but the following simple approach seems to works fine. | 1593 | // to such forces, but the following simple approach seems to works fine. |
1595 | Vector3 LocalVectorToTarget3D = | 1594 | Vector3 LocalVectorToTarget3D = |
1596 | (MoveToPositionTarget - AbsolutePosition) // vector from cur. pos to target in global coords | 1595 | (MoveToPositionTarget - AbsolutePosition) // vector from cur. pos to target in global coords |
1597 | * Matrix4.CreateFromQuaternion(Quaternion.Inverse(bodyRotation)); // change to avatar coords | 1596 | * Matrix4.CreateFromQuaternion(Quaternion.Inverse(Rotation)); // change to avatar coords |
1598 | // Ignore z component of vector | 1597 | // Ignore z component of vector |
1599 | // Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f); | 1598 | // Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f); |
1600 | LocalVectorToTarget3D.Normalize(); | 1599 | LocalVectorToTarget3D.Normalize(); |
@@ -1731,7 +1730,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1731 | MoveToPositionTarget = pos; | 1730 | MoveToPositionTarget = pos; |
1732 | 1731 | ||
1733 | Vector3 agent_control_v3 = new Vector3(); | 1732 | Vector3 agent_control_v3 = new Vector3(); |
1734 | HandleMoveToTargetUpdate(ref agent_control_v3, Rotation); | 1733 | HandleMoveToTargetUpdate(ref agent_control_v3); |
1735 | AddNewMovement(agent_control_v3); | 1734 | AddNewMovement(agent_control_v3); |
1736 | } | 1735 | } |
1737 | 1736 | ||