aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs47
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs2
2 files changed, 37 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3e3b3af..d041d8b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1561,17 +1561,42 @@ namespace OpenSim.Region.Framework.Scenes
1561 m_doingCamRayCast = false; 1561 m_doingCamRayCast = false;
1562 if (hitYN && localid != LocalId) 1562 if (hitYN && localid != LocalId)
1563 { 1563 {
1564 CameraConstraintActive = true; 1564 SceneObjectGroup group = m_scene.GetGroupByPrim(localid);
1565 pNormal.X = (float)Math.Round(pNormal.X, 2); 1565 bool IsPrim = group != null;
1566 pNormal.Y = (float)Math.Round(pNormal.Y, 2); 1566 if (IsPrim)
1567 pNormal.Z = (float)Math.Round(pNormal.Z, 2); 1567 {
1568 pNormal.Normalize(); 1568 SceneObjectPart part = group.GetPart(localid);
1569 collisionPoint.X = (float)Math.Round(collisionPoint.X, 1); 1569 if (part != null && !part.VolumeDetectActive)
1570 collisionPoint.Y = (float)Math.Round(collisionPoint.Y, 1); 1570 {
1571 collisionPoint.Z = (float)Math.Round(collisionPoint.Z, 1); 1571 CameraConstraintActive = true;
1572 1572 pNormal.X = (float) Math.Round(pNormal.X, 2);
1573 Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z, Vector3.Dot(collisionPoint, pNormal)); 1573 pNormal.Y = (float) Math.Round(pNormal.Y, 2);
1574 UpdateCameraCollisionPlane(plane); 1574 pNormal.Z = (float) Math.Round(pNormal.Z, 2);
1575 pNormal.Normalize();
1576 collisionPoint.X = (float) Math.Round(collisionPoint.X, 1);
1577 collisionPoint.Y = (float) Math.Round(collisionPoint.Y, 1);
1578 collisionPoint.Z = (float) Math.Round(collisionPoint.Z, 1);
1579
1580 Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z,
1581 Vector3.Dot(collisionPoint, pNormal));
1582 UpdateCameraCollisionPlane(plane);
1583 }
1584 }
1585 else
1586 {
1587 CameraConstraintActive = true;
1588 pNormal.X = (float) Math.Round(pNormal.X, 2);
1589 pNormal.Y = (float) Math.Round(pNormal.Y, 2);
1590 pNormal.Z = (float) Math.Round(pNormal.Z, 2);
1591 pNormal.Normalize();
1592 collisionPoint.X = (float) Math.Round(collisionPoint.X, 1);
1593 collisionPoint.Y = (float) Math.Round(collisionPoint.Y, 1);
1594 collisionPoint.Z = (float) Math.Round(collisionPoint.Z, 1);
1595
1596 Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z,
1597 Vector3.Dot(collisionPoint, pNormal));
1598 UpdateCameraCollisionPlane(plane);
1599 }
1575 } 1600 }
1576 else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || 1601 else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
1577 !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)) 1602 !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE))
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 2e61fb8..b524a18 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -512,7 +512,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
512 else if (o is LSL_Types.LSLFloat) 512 else if (o is LSL_Types.LSLFloat)
513 size += 8; 513 size += 8;
514 else if (o is LSL_Types.LSLString) 514 else if (o is LSL_Types.LSLString)
515 size += ((LSL_Types.LSLString)o).m_string.Length; 515 size += ((LSL_Types.LSLString)o).m_string == null ? 0 : ((LSL_Types.LSLString)o).m_string.Length;
516 else if (o is LSL_Types.key) 516 else if (o is LSL_Types.key)
517 size += ((LSL_Types.key)o).value.Length; 517 size += ((LSL_Types.key)o).value.Length;
518 else if (o is LSL_Types.Vector3) 518 else if (o is LSL_Types.Vector3)