* Ignores VolumeDetect enabled prim in the camera raycast call. Note: The SceneRaycast call doesn't have a filter option in the interface and physics will use the lower level one for all sorts of goodies so it wouldn't be appropriate to ignore it at the physics layer yet.. though that would be better once the API has filters.

avinationmerge
teravus 2013-03-16 11:09:49 -04:00
parent f081b7e9ef
commit 455da9dd20
1 changed files with 35 additions and 10 deletions

View File

@ -1525,19 +1525,44 @@ namespace OpenSim.Region.Framework.Scenes
m_doingCamRayCast = false; m_doingCamRayCast = false;
if (hitYN && localid != LocalId) if (hitYN && localid != LocalId)
{
SceneObjectGroup group = m_scene.GetGroupByPrim(localid);
bool IsPrim = group != null;
if (IsPrim)
{
SceneObjectPart part = group.GetPart(localid);
if (part != null && !part.VolumeDetectActive)
{ {
CameraConstraintActive = true; CameraConstraintActive = true;
pNormal.X = (float)Math.Round(pNormal.X, 2); pNormal.X = (float) Math.Round(pNormal.X, 2);
pNormal.Y = (float)Math.Round(pNormal.Y, 2); pNormal.Y = (float) Math.Round(pNormal.Y, 2);
pNormal.Z = (float)Math.Round(pNormal.Z, 2); pNormal.Z = (float) Math.Round(pNormal.Z, 2);
pNormal.Normalize(); pNormal.Normalize();
collisionPoint.X = (float)Math.Round(collisionPoint.X, 1); collisionPoint.X = (float) Math.Round(collisionPoint.X, 1);
collisionPoint.Y = (float)Math.Round(collisionPoint.Y, 1); collisionPoint.Y = (float) Math.Round(collisionPoint.Y, 1);
collisionPoint.Z = (float)Math.Round(collisionPoint.Z, 1); collisionPoint.Z = (float) Math.Round(collisionPoint.Z, 1);
Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z, Vector3.Dot(collisionPoint, pNormal)); Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z,
Vector3.Dot(collisionPoint, pNormal));
UpdateCameraCollisionPlane(plane); UpdateCameraCollisionPlane(plane);
} }
}
else
{
CameraConstraintActive = true;
pNormal.X = (float) Math.Round(pNormal.X, 2);
pNormal.Y = (float) Math.Round(pNormal.Y, 2);
pNormal.Z = (float) Math.Round(pNormal.Z, 2);
pNormal.Normalize();
collisionPoint.X = (float) Math.Round(collisionPoint.X, 1);
collisionPoint.Y = (float) Math.Round(collisionPoint.Y, 1);
collisionPoint.Z = (float) Math.Round(collisionPoint.Z, 1);
Vector4 plane = new Vector4(pNormal.X, pNormal.Y, pNormal.Z,
Vector3.Dot(collisionPoint, pNormal));
UpdateCameraCollisionPlane(plane);
}
}
else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || else if (!m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE)) !Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE))
{ {