diff options
author | Teravus Ovares (Dan Olivares) | 2009-12-05 22:18:00 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-12-05 22:18:00 -0500 |
commit | 8d196dbd148f759f9fce1a2f456abfc084fd8f97 (patch) | |
tree | 785a7a351bbd2a435d0813210156e338cfe6141c /OpenSim/Region/Framework | |
parent | * Fix line endings in BaseHttpServer.cs (diff) | |
download | opensim-SC-8d196dbd148f759f9fce1a2f456abfc084fd8f97.zip opensim-SC-8d196dbd148f759f9fce1a2f456abfc084fd8f97.tar.gz opensim-SC-8d196dbd148f759f9fce1a2f456abfc084fd8f97.tar.bz2 opensim-SC-8d196dbd148f759f9fce1a2f456abfc084fd8f97.tar.xz |
* Adds Normal to the fields returned by the Physics Raycaster
* Fixes recognizing when a sit target is and isn't set.
* * 1. Vector3.Zero.
* * 2. Orientation: x:0, y:0, z:0, w:1 - ZERO_ROTATION
* * (or) Orientation: x:0, y:0, z:0, w:0 - Invalid Quaternion
* * (or) Orientation: x:0, y:0, z:1, w:0 - Invalid mapping, some older objects still exist with it
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a3ceecb..24840d4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1105,7 +1105,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1105 | /// <param name="collisionPoint"></param> | 1105 | /// <param name="collisionPoint"></param> |
1106 | /// <param name="localid"></param> | 1106 | /// <param name="localid"></param> |
1107 | /// <param name="distance"></param> | 1107 | /// <param name="distance"></param> |
1108 | public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) | 1108 | public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal) |
1109 | { | 1109 | { |
1110 | const float POSITION_TOLERANCE = 0.02f; | 1110 | const float POSITION_TOLERANCE = 0.02f; |
1111 | const float VELOCITY_TOLERANCE = 0.02f; | 1111 | const float VELOCITY_TOLERANCE = 0.02f; |
@@ -1686,8 +1686,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1686 | 1686 | ||
1687 | bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); | 1687 | bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); |
1688 | bool SitTargetisSet = | 1688 | bool SitTargetisSet = |
1689 | (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f && | 1689 | (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && |
1690 | avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f)); | 1690 | ( |
1691 | avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 1f // Valid Zero Rotation quaternion | ||
1692 | || avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f && avSitOrientation.W == 0f // W-Z Mapping was invalid at one point | ||
1693 | || avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 0f // Invalid Quaternion | ||
1694 | ) | ||
1695 | )); | ||
1691 | 1696 | ||
1692 | if (SitTargetisSet && SitTargetUnOccupied) | 1697 | if (SitTargetisSet && SitTargetUnOccupied) |
1693 | { | 1698 | { |
@@ -1750,7 +1755,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1750 | StandUp(); | 1755 | StandUp(); |
1751 | } | 1756 | } |
1752 | m_nextSitAnimation = "SIT"; | 1757 | m_nextSitAnimation = "SIT"; |
1753 | 1758 | ||
1754 | //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); | 1759 | //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); |
1755 | SceneObjectPart part = FindNextAvailableSitTarget(targetID); | 1760 | SceneObjectPart part = FindNextAvailableSitTarget(targetID); |
1756 | 1761 | ||
@@ -1762,12 +1767,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
1762 | } | 1767 | } |
1763 | m_requestedSitTargetID = part.LocalId; | 1768 | m_requestedSitTargetID = part.LocalId; |
1764 | //m_requestedSitOffset = offset; | 1769 | //m_requestedSitOffset = offset; |
1770 | //offset.X += part.Scale.X;// *offset.X; | ||
1771 | //offset.Y += part.Scale.Y;// * offset.Y; | ||
1772 | //offset.Z += part.Scale.Z;// * offset.Z; | ||
1773 | //m_requestedSitOffset = offset; | ||
1774 | m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); | ||
1765 | } | 1775 | } |
1766 | else | 1776 | else |
1767 | { | 1777 | { |
1768 | 1778 | ||
1769 | m_log.Warn("Sit requested on unknown object: " + targetID.ToString()); | 1779 | m_log.Warn("Sit requested on unknown object: " + targetID.ToString()); |
1770 | } | 1780 | } |
1781 | |||
1782 | if (m_scene.PhysicsScene.SupportsRayCast()) | ||
1783 | { | ||
1784 | //m_scene.PhysicsScene.RaycastWorld(Vector3.Zero,Vector3.Zero, 0.01f,new RaycastCallback()); | ||
1785 | } | ||
1786 | |||
1771 | SendSitResponse(remoteClient, targetID, offset); | 1787 | SendSitResponse(remoteClient, targetID, offset); |
1772 | } | 1788 | } |
1773 | 1789 | ||