diff options
Diffstat (limited to 'OpenSim')
4 files changed, 105 insertions, 80 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5087882..be3a39a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -140,8 +140,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | private Vector3 m_lastPosition; | 140 | private Vector3 m_lastPosition; |
141 | private Quaternion m_lastRotation; | 141 | private Quaternion m_lastRotation; |
142 | private Vector3 m_lastVelocity; | 142 | private Vector3 m_lastVelocity; |
143 | private Vector3 m_lastSize = new Vector3(0.45f,0.6f,1.9f); | ||
144 | |||
145 | 143 | ||
146 | private Vector3? m_forceToApply; | 144 | private Vector3? m_forceToApply; |
147 | private int m_userFlags; | 145 | private int m_userFlags; |
@@ -227,8 +225,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
227 | /// </summary> | 225 | /// </summary> |
228 | public bool LandAtTarget { get; private set; } | 226 | public bool LandAtTarget { get; private set; } |
229 | 227 | ||
230 | private bool m_followCamAuto; | ||
231 | |||
232 | private int m_movementUpdateCount; | 228 | private int m_movementUpdateCount; |
233 | private const int NumMovementsBetweenRayCast = 5; | 229 | private const int NumMovementsBetweenRayCast = 5; |
234 | 230 | ||
@@ -357,6 +353,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
357 | /// </summary> | 353 | /// </summary> |
358 | protected Vector3 m_lastCameraPosition; | 354 | protected Vector3 m_lastCameraPosition; |
359 | 355 | ||
356 | private Vector4 m_lastCameraCollisionPlane = new Vector4(0f, 0f, 0f, 1); | ||
357 | private bool m_doingCamRayCast = false; | ||
358 | |||
360 | public Vector3 CameraPosition { get; set; } | 359 | public Vector3 CameraPosition { get; set; } |
361 | 360 | ||
362 | public Quaternion CameraRotation | 361 | public Quaternion CameraRotation |
@@ -1407,35 +1406,43 @@ namespace OpenSim.Region.Framework.Scenes | |||
1407 | /// <param name="collisionPoint"></param> | 1406 | /// <param name="collisionPoint"></param> |
1408 | /// <param name="localid"></param> | 1407 | /// <param name="localid"></param> |
1409 | /// <param name="distance"></param> | 1408 | /// <param name="distance"></param> |
1409 | /// | ||
1410 | |||
1411 | private void UpdateCameraCollisionPlane(Vector4 plane) | ||
1412 | { | ||
1413 | if (m_lastCameraCollisionPlane != plane) | ||
1414 | { | ||
1415 | m_lastCameraCollisionPlane = plane; | ||
1416 | ControllingClient.SendCameraConstraint(plane); | ||
1417 | } | ||
1418 | } | ||
1419 | |||
1410 | public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal) | 1420 | public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal) |
1411 | { | 1421 | { |
1412 | const float POSITION_TOLERANCE = 0.02f; | 1422 | const float POSITION_TOLERANCE = 0.02f; |
1413 | const float VELOCITY_TOLERANCE = 0.02f; | ||
1414 | const float ROTATION_TOLERANCE = 0.02f; | 1423 | const float ROTATION_TOLERANCE = 0.02f; |
1415 | 1424 | ||
1416 | if (m_followCamAuto) | 1425 | m_doingCamRayCast = false; |
1426 | if (hitYN && localid != LocalId) | ||
1417 | { | 1427 | { |
1418 | if (hitYN) | 1428 | CameraConstraintActive = true; |
1419 | { | 1429 | pNormal.X = (float)Math.Round(pNormal.X, 2); |
1420 | CameraConstraintActive = true; | 1430 | pNormal.Y = (float)Math.Round(pNormal.Y, 2); |
1421 | //m_log.DebugFormat("[RAYCASTRESULT]: {0}, {1}, {2}, {3}", hitYN, collisionPoint, localid, distance); | 1431 | pNormal.Z = (float)Math.Round(pNormal.Z, 2); |
1422 | 1432 | pNormal.Normalize(); | |
1423 | Vector3 normal = Vector3.Normalize(new Vector3(0f, 0f, collisionPoint.Z) - collisionPoint); | 1433 | collisionPoint.X = (float)Math.Round(collisionPoint.X, 1); |
1424 | ControllingClient.SendCameraConstraint(new Vector4(normal.X, normal.Y, normal.Z, -1 * Vector3.Distance(new Vector3(0,0,collisionPoint.Z),collisionPoint))); | 1434 | collisionPoint.Y = (float)Math.Round(collisionPoint.Y, 1); |
1425 | } | 1435 | collisionPoint.Z = (float)Math.Round(collisionPoint.Z, 1); |
1426 | else | 1436 | |
1427 | { | 1437 | Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z, Vector3.Dot(collisionPoint, pNormal)); |
1428 | if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || | 1438 | UpdateCameraCollisionPlane(plane); |
1429 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || | 1439 | } |
1430 | !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)) | 1440 | else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
1431 | { | 1441 | !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)) |
1432 | if (CameraConstraintActive) | 1442 | { |
1433 | { | 1443 | Vector4 plane = new Vector4(0.9f, 0.0f, 0.361f, -9000f); // not right... |
1434 | ControllingClient.SendCameraConstraint(new Vector4(0f, 0.5f, 0.9f, -3000f)); | 1444 | UpdateCameraCollisionPlane(plane); |
1435 | CameraConstraintActive = false; | 1445 | CameraConstraintActive = false; |
1436 | } | ||
1437 | } | ||
1438 | } | ||
1439 | } | 1446 | } |
1440 | } | 1447 | } |
1441 | 1448 | ||
@@ -1510,12 +1517,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1510 | // DrawDistance = agentData.Far; | 1517 | // DrawDistance = agentData.Far; |
1511 | DrawDistance = Scene.DefaultDrawDistance; | 1518 | DrawDistance = Scene.DefaultDrawDistance; |
1512 | 1519 | ||
1513 | // Check if Client has camera in 'follow cam' or 'build' mode. | ||
1514 | Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); | ||
1515 | |||
1516 | m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f) | ||
1517 | && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false; | ||
1518 | |||
1519 | m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; | 1520 | m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; |
1520 | m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0; | 1521 | m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0; |
1521 | 1522 | ||
@@ -1535,24 +1536,38 @@ namespace OpenSim.Region.Framework.Scenes | |||
1535 | StandUp(); | 1536 | StandUp(); |
1536 | } | 1537 | } |
1537 | 1538 | ||
1538 | //m_log.DebugFormat("[FollowCam]: {0}", m_followCamAuto); | ||
1539 | // Raycast from the avatar's head to the camera to see if there's anything blocking the view | 1539 | // Raycast from the avatar's head to the camera to see if there's anything blocking the view |
1540 | if ((m_movementUpdateCount % NumMovementsBetweenRayCast) == 0 && m_scene.PhysicsScene.SupportsRayCast()) | 1540 | // this exclude checks may not be complete |
1541 | |||
1542 | if (m_movementUpdateCount % NumMovementsBetweenRayCast == 0 && m_scene.PhysicsScene.SupportsRayCast()) | ||
1541 | { | 1543 | { |
1542 | if (m_followCamAuto) | 1544 | if (!m_doingCamRayCast && !m_mouseLook && ParentID == 0) |
1543 | { | 1545 | { |
1544 | // Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT; | 1546 | Vector3 posAdjusted = AbsolutePosition; |
1545 | // m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback); | 1547 | // posAdjusted.Z += 0.5f * Appearance.AvatarSize.Z - 0.5f; |
1546 | 1548 | posAdjusted.Z += 1.0f; // viewer current camera focus point | |
1547 | Vector3 posAdjusted = AbsolutePosition + HEAD_ADJUSTMENT; | 1549 | Vector3 tocam = CameraPosition - posAdjusted; |
1548 | Vector3 distTocam = CameraPosition - posAdjusted; | 1550 | tocam.X = (float)Math.Round(tocam.X, 1); |
1549 | float distTocamlen = distTocam.Length(); | 1551 | tocam.Y = (float)Math.Round(tocam.Y, 1); |
1550 | if (distTocamlen > 0) | 1552 | tocam.Z = (float)Math.Round(tocam.Z, 1); |
1553 | |||
1554 | float distTocamlen = tocam.Length(); | ||
1555 | if (distTocamlen > 0.3f) | ||
1551 | { | 1556 | { |
1552 | distTocam *= 1.0f / distTocamlen; | 1557 | tocam *= (1.0f / distTocamlen); |
1553 | m_scene.PhysicsScene.RaycastWorld(posAdjusted, distTocam, distTocamlen + 0.3f, RayCastCameraCallback); | 1558 | posAdjusted.X = (float)Math.Round(posAdjusted.X, 1); |
1559 | posAdjusted.Y = (float)Math.Round(posAdjusted.Y, 1); | ||
1560 | posAdjusted.Z = (float)Math.Round(posAdjusted.Z, 1); | ||
1561 | |||
1562 | m_doingCamRayCast = true; | ||
1563 | m_scene.PhysicsScene.RaycastWorld(posAdjusted, tocam, distTocamlen + 1.0f, RayCastCameraCallback); | ||
1554 | } | 1564 | } |
1555 | 1565 | } | |
1566 | else if (CameraConstraintActive && (m_mouseLook || ParentID != 0)) | ||
1567 | { | ||
1568 | Vector4 plane = new Vector4(0.9f, 0.0f, 0.361f, -10000f); // not right... | ||
1569 | UpdateCameraCollisionPlane(plane); | ||
1570 | CameraConstraintActive = false; | ||
1556 | } | 1571 | } |
1557 | } | 1572 | } |
1558 | 1573 | ||
@@ -2282,7 +2297,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2282 | ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot"); | 2297 | ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot"); |
2283 | return; | 2298 | return; |
2284 | } | 2299 | } |
2285 | // m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString()); | ||
2286 | 2300 | ||
2287 | RemoveFromPhysicalScene(); | 2301 | RemoveFromPhysicalScene(); |
2288 | 2302 | ||
@@ -2293,7 +2307,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2293 | 2307 | ||
2294 | part.AddSittingAvatar(UUID); | 2308 | part.AddSittingAvatar(UUID); |
2295 | 2309 | ||
2296 | |||
2297 | Vector3 cameraAtOffset = part.GetCameraAtOffset(); | 2310 | Vector3 cameraAtOffset = part.GetCameraAtOffset(); |
2298 | Vector3 cameraEyeOffset = part.GetCameraEyeOffset(); | 2311 | Vector3 cameraEyeOffset = part.GetCameraEyeOffset(); |
2299 | bool forceMouselook = part.GetForceMouselook(); | 2312 | bool forceMouselook = part.GetForceMouselook(); |
@@ -2526,13 +2539,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2526 | // NOTE: Velocity is not the same as m_velocity. Velocity will attempt to | 2539 | // NOTE: Velocity is not the same as m_velocity. Velocity will attempt to |
2527 | // grab the latest PhysicsActor velocity, whereas m_velocity is often | 2540 | // grab the latest PhysicsActor velocity, whereas m_velocity is often |
2528 | // storing a requested force instead of an actual traveling velocity | 2541 | // storing a requested force instead of an actual traveling velocity |
2529 | if (Appearance.AvatarSize != m_lastSize) | 2542 | if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || |
2530 | { | ||
2531 | m_lastSize = Appearance.AvatarSize; | ||
2532 | SendAvatarDataToAllAgents(); | ||
2533 | } | ||
2534 | |||
2535 | else if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || | ||
2536 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || | 2543 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || |
2537 | !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) | 2544 | !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) |
2538 | { | 2545 | { |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs index 6e9281b..7fe3109 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs | |||
@@ -173,8 +173,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
173 | d.GeomRaySetClosestHit(ray, closestHit); | 173 | d.GeomRaySetClosestHit(ray, closestHit); |
174 | 174 | ||
175 | if (req.callbackMethod is RaycastCallback) | 175 | if (req.callbackMethod is RaycastCallback) |
176 | { | ||
176 | // if we only want one get only one per Collision pair saving memory | 177 | // if we only want one get only one per Collision pair saving memory |
177 | CurrentRayFilter |= RayFilterFlags.ClosestHit; | 178 | CurrentRayFilter |= RayFilterFlags.ClosestHit; |
179 | d.GeomRaySetClosestHit(ray, 1); | ||
180 | } | ||
181 | else | ||
182 | d.GeomRaySetClosestHit(ray, closestHit); | ||
178 | } | 183 | } |
179 | 184 | ||
180 | if ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0) | 185 | if ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0) |
@@ -555,10 +560,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
555 | 560 | ||
556 | ContactResult collisionresult = new ContactResult(); | 561 | ContactResult collisionresult = new ContactResult(); |
557 | collisionresult.ConsumerID = ID; | 562 | collisionresult.ConsumerID = ID; |
558 | collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); | 563 | collisionresult.Pos.X = curcontact.pos.X; |
564 | collisionresult.Pos.Y = curcontact.pos.Y; | ||
565 | collisionresult.Pos.Z = curcontact.pos.Z; | ||
559 | collisionresult.Depth = curcontact.depth; | 566 | collisionresult.Depth = curcontact.depth; |
560 | collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, | 567 | collisionresult.Normal.X = curcontact.normal.X; |
561 | curcontact.normal.Z); | 568 | collisionresult.Normal.Y = curcontact.normal.Y; |
569 | collisionresult.Normal.Z = curcontact.normal.Z; | ||
562 | lock (m_contactResults) | 570 | lock (m_contactResults) |
563 | { | 571 | { |
564 | m_contactResults.Add(collisionresult); | 572 | m_contactResults.Add(collisionresult); |
@@ -581,10 +589,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
581 | 589 | ||
582 | if (curcontact.depth < collisionresult.Depth) | 590 | if (curcontact.depth < collisionresult.Depth) |
583 | { | 591 | { |
584 | collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); | 592 | collisionresult.Pos.X = curcontact.pos.X; |
593 | collisionresult.Pos.Y = curcontact.pos.Y; | ||
594 | collisionresult.Pos.Z = curcontact.pos.Z; | ||
585 | collisionresult.Depth = curcontact.depth; | 595 | collisionresult.Depth = curcontact.depth; |
586 | collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, | 596 | collisionresult.Normal.X = curcontact.normal.X; |
587 | curcontact.normal.Z); | 597 | collisionresult.Normal.Y = curcontact.normal.Y; |
598 | collisionresult.Normal.Z = curcontact.normal.Z; | ||
588 | } | 599 | } |
589 | } | 600 | } |
590 | 601 | ||
@@ -699,10 +710,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
699 | 710 | ||
700 | ContactResult collisionresult = new ContactResult(); | 711 | ContactResult collisionresult = new ContactResult(); |
701 | collisionresult.ConsumerID = ID; | 712 | collisionresult.ConsumerID = ID; |
702 | collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); | 713 | collisionresult.Pos.X = curcontact.pos.X; |
714 | collisionresult.Pos.Y = curcontact.pos.Y; | ||
715 | collisionresult.Pos.Z = curcontact.pos.Z; | ||
703 | collisionresult.Depth = curcontact.depth; | 716 | collisionresult.Depth = curcontact.depth; |
704 | collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, | 717 | collisionresult.Normal.X = curcontact.normal.X; |
705 | curcontact.normal.Z); | 718 | collisionresult.Normal.Y = curcontact.normal.Y; |
719 | collisionresult.Normal.Z = curcontact.normal.Z; | ||
706 | lock (m_contactResults) | 720 | lock (m_contactResults) |
707 | { | 721 | { |
708 | m_contactResults.Add(collisionresult); | 722 | m_contactResults.Add(collisionresult); |
@@ -725,10 +739,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
725 | 739 | ||
726 | if (curcontact.depth < collisionresult.Depth) | 740 | if (curcontact.depth < collisionresult.Depth) |
727 | { | 741 | { |
728 | collisionresult.Pos = new Vector3(curcontact.pos.X, curcontact.pos.Y, curcontact.pos.Z); | 742 | collisionresult.Pos.X = curcontact.pos.X; |
743 | collisionresult.Pos.Y = curcontact.pos.Y; | ||
744 | collisionresult.Pos.Z = curcontact.pos.Z; | ||
729 | collisionresult.Depth = curcontact.depth; | 745 | collisionresult.Depth = curcontact.depth; |
730 | collisionresult.Normal = new Vector3(curcontact.normal.X, curcontact.normal.Y, | 746 | collisionresult.Normal.X = curcontact.normal.X; |
731 | curcontact.normal.Z); | 747 | collisionresult.Normal.Y = curcontact.normal.Y; |
748 | collisionresult.Normal.Z = curcontact.normal.Z; | ||
732 | } | 749 | } |
733 | } | 750 | } |
734 | 751 | ||
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs index ecc732a..e9023c3 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs | |||
@@ -78,8 +78,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
78 | 78 | ||
79 | IntPtr geom = ((OdePrim)actor).prim_geom; | 79 | IntPtr geom = ((OdePrim)actor).prim_geom; |
80 | 80 | ||
81 | Vector3 geopos = d.GeomGetPositionOMV(geom); | 81 | // Vector3 geopos = d.GeomGetPositionOMV(geom); |
82 | Quaternion geomOri = d.GeomGetQuaternionOMV(geom); | 82 | // Quaternion geomOri = d.GeomGetQuaternionOMV(geom); |
83 | |||
84 | Vector3 geopos = actor.Position; | ||
85 | Quaternion geomOri = actor.Orientation; | ||
86 | |||
83 | Quaternion geomInvOri = Quaternion.Conjugate(geomOri); | 87 | Quaternion geomInvOri = Quaternion.Conjugate(geomOri); |
84 | 88 | ||
85 | Quaternion ori = Quaternion.Identity; | 89 | Quaternion ori = Quaternion.Identity; |
@@ -116,6 +120,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
116 | } | 120 | } |
117 | 121 | ||
118 | int status = 1; | 122 | int status = 1; |
123 | |||
119 | offset = rayResults[0].Pos - geopos; | 124 | offset = rayResults[0].Pos - geopos; |
120 | 125 | ||
121 | d.GeomClassID geoclass = d.GeomGetClass(geom); | 126 | d.GeomClassID geoclass = d.GeomGetClass(geom); |
@@ -191,13 +196,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
191 | if (norm.Z < 0.5f) | 196 | if (norm.Z < 0.5f) |
192 | { | 197 | { |
193 | float rayDist = 4.0f; | 198 | float rayDist = 4.0f; |
194 | float curEdgeDist = 0.0f; | ||
195 | 199 | ||
196 | for (int i = 0; i < 6; i++) | 200 | for (int i = 0; i < 6; i++) |
197 | { | 201 | { |
198 | pivot.X -= 0.005f * norm.X; | 202 | pivot.X -= 0.01f * norm.X; |
199 | pivot.Y -= 0.005f * norm.Y; | 203 | pivot.Y -= 0.01f * norm.Y; |
200 | pivot.Z -= 0.005f * norm.Z; | 204 | pivot.Z -= 0.01f * norm.Z; |
201 | 205 | ||
202 | rayDir.X = -norm.X * norm.Z; | 206 | rayDir.X = -norm.X * norm.Z; |
203 | rayDir.Y = -norm.Y * norm.Z; | 207 | rayDir.Y = -norm.Y * norm.Z; |
@@ -208,8 +212,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
208 | if (rayResults.Count == 0) | 212 | if (rayResults.Count == 0) |
209 | break; | 213 | break; |
210 | 214 | ||
211 | curEdgeDist += rayResults[0].Depth; | ||
212 | |||
213 | if (Math.Abs(rayResults[0].Normal.Z) < 0.7f) | 215 | if (Math.Abs(rayResults[0].Normal.Z) < 0.7f) |
214 | { | 216 | { |
215 | rayDist -= rayResults[0].Depth; | 217 | rayDist -= rayResults[0].Depth; |
@@ -226,7 +228,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
226 | else | 228 | else |
227 | { | 229 | { |
228 | foundEdge = true; | 230 | foundEdge = true; |
229 | edgeDist = curEdgeDist; | ||
230 | edgePos = rayResults[0].Pos; | 231 | edgePos = rayResults[0].Pos; |
231 | break; | 232 | break; |
232 | } | 233 | } |
@@ -254,7 +255,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
254 | 255 | ||
255 | for (int i = 0; i < 3; i++) | 256 | for (int i = 0; i < 3; i++) |
256 | { | 257 | { |
257 | pivot.Z -= 0.005f; | 258 | pivot.Z -= 0.01f; |
258 | rayDir.X = toCamX; | 259 | rayDir.X = toCamX; |
259 | rayDir.Y = toCamY; | 260 | rayDir.Y = toCamY; |
260 | rayDir.Z = (-toCamX * norm.X - toCamY * norm.Y) / norm.Z; | 261 | rayDir.Z = (-toCamX * norm.X - toCamY * norm.Y) / norm.Z; |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index d045b59..0d18adb 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -2586,7 +2586,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2586 | req.Normal = direction; | 2586 | req.Normal = direction; |
2587 | req.Origin = position; | 2587 | req.Origin = position; |
2588 | req.Count = 0; | 2588 | req.Count = 0; |
2589 | req.filter = RayFilterFlags.All; | 2589 | req.filter = RayFilterFlags.AllPrims; |
2590 | 2590 | ||
2591 | m_rayCastManager.QueueRequest(req); | 2591 | m_rayCastManager.QueueRequest(req); |
2592 | } | 2592 | } |
@@ -2603,7 +2603,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2603 | req.Normal = direction; | 2603 | req.Normal = direction; |
2604 | req.Origin = position; | 2604 | req.Origin = position; |
2605 | req.Count = Count; | 2605 | req.Count = Count; |
2606 | req.filter = RayFilterFlags.All; | 2606 | req.filter = RayFilterFlags.AllPrims; |
2607 | 2607 | ||
2608 | m_rayCastManager.QueueRequest(req); | 2608 | m_rayCastManager.QueueRequest(req); |
2609 | } | 2609 | } |
@@ -2631,7 +2631,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2631 | req.Normal = direction; | 2631 | req.Normal = direction; |
2632 | req.Origin = position; | 2632 | req.Origin = position; |
2633 | req.Count = Count; | 2633 | req.Count = Count; |
2634 | req.filter = RayFilterFlags.All; | 2634 | req.filter = RayFilterFlags.AllPrims; |
2635 | 2635 | ||
2636 | lock (SyncObject) | 2636 | lock (SyncObject) |
2637 | { | 2637 | { |