aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs47
1 files changed, 36 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 91f9c0b..230cb23 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1526,17 +1526,42 @@ namespace OpenSim.Region.Framework.Scenes
1526 m_doingCamRayCast = false; 1526 m_doingCamRayCast = false;
1527 if (hitYN && localid != LocalId) 1527 if (hitYN && localid != LocalId)
1528 { 1528 {
1529 CameraConstraintActive = true; 1529 SceneObjectGroup group = m_scene.GetGroupByPrim(localid);
1530 pNormal.X = (float)Math.Round(pNormal.X, 2); 1530 bool IsPrim = group != null;
1531 pNormal.Y = (float)Math.Round(pNormal.Y, 2); 1531 if (IsPrim)
1532 pNormal.Z = (float)Math.Round(pNormal.Z, 2); 1532 {
1533 pNormal.Normalize(); 1533 SceneObjectPart part = group.GetPart(localid);
1534 collisionPoint.X = (float)Math.Round(collisionPoint.X, 1); 1534 if (part != null && !part.VolumeDetectActive)
1535 collisionPoint.Y = (float)Math.Round(collisionPoint.Y, 1); 1535 {
1536 collisionPoint.Z = (float)Math.Round(collisionPoint.Z, 1); 1536 CameraConstraintActive = true;
1537 1537 pNormal.X = (float) Math.Round(pNormal.X, 2);
1538 Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z, Vector3.Dot(collisionPoint, pNormal)); 1538 pNormal.Y = (float) Math.Round(pNormal.Y, 2);
1539 UpdateCameraCollisionPlane(plane); 1539 pNormal.Z = (float) Math.Round(pNormal.Z, 2);
1540 pNormal.Normalize();
1541 collisionPoint.X = (float) Math.Round(collisionPoint.X, 1);
1542 collisionPoint.Y = (float) Math.Round(collisionPoint.Y, 1);
1543 collisionPoint.Z = (float) Math.Round(collisionPoint.Z, 1);
1544
1545 Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z,
1546 Vector3.Dot(collisionPoint, pNormal));
1547 UpdateCameraCollisionPlane(plane);
1548 }
1549 }
1550 else
1551 {
1552 CameraConstraintActive = true;
1553 pNormal.X = (float) Math.Round(pNormal.X, 2);
1554 pNormal.Y = (float) Math.Round(pNormal.Y, 2);
1555 pNormal.Z = (float) Math.Round(pNormal.Z, 2);
1556 pNormal.Normalize();
1557 collisionPoint.X = (float) Math.Round(collisionPoint.X, 1);
1558 collisionPoint.Y = (float) Math.Round(collisionPoint.Y, 1);
1559 collisionPoint.Z = (float) Math.Round(collisionPoint.Z, 1);
1560
1561 Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z,
1562 Vector3.Dot(collisionPoint, pNormal));
1563 UpdateCameraCollisionPlane(plane);
1564 }
1540 } 1565 }
1541 else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || 1566 else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
1542 !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)) 1567 !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE))