/// <summary>Should we try to optimize by not drawing objects occluded behind other objects</summary>
public static bool OcclusionCullingEnabled = true;
/// <summary>Should we try to make sure that large prims that are > our draw distance are in view when we are standing on them</summary>
- public static bool HeavierDistanceChecking = false;
+ public static bool HeavierDistanceChecking = true;
}
}
/// <returns></returns>\r
private float FindClosestDistanceSquared(Vector3 calcPos, SceneObject p)\r
{\r
- if (!RenderSettings.HeavierDistanceChecking)\r
+ if (p.BoundingVolume == null || p.BoundingVolume.R < 5f || !RenderSettings.HeavierDistanceChecking)\r
return Vector3.DistanceSquared(calcPos, p.RenderPosition);\r
\r
Vector3 posToCheckFrom = Vector3.Zero;\r
//Get the bounding boxes for this prim\r
- Vector3 boundingBoxMin = p.RenderPosition - (p.BasePrim.Scale / 2);\r
- Vector3 boundingBoxMax = p.RenderPosition + (p.BasePrim.Scale / 2);\r
+ Vector3 boundingBoxMin = p.RenderPosition - p.BoundingVolume.Min * p.BasePrim.Scale;\r
+ Vector3 boundingBoxMax = p.RenderPosition + p.BoundingVolume.Max * p.BasePrim.Scale;\r
if (calcPos.X > boundingBoxMin.X &&\r
calcPos.X < boundingBoxMax.X)\r
{\r
private void cbMisc_CheckedChanged(object sender, EventArgs e)\r
{\r
miscEnabled = cbMisc.Checked;\r
- RenderSettings.OcclusionCullingEnabled = miscEnabled;\r
+ RenderSettings.HeavierDistanceChecking = miscEnabled;\r
}\r
\r
#endregion\r