Exemple #1
0
 /// <summary>
 /// Returns the width of the camera's frustum at the specified distance from the camera.
 /// </summary>
 /// <param name="distance">Distance along the axis the camera is looking at, in world units.</param>
 /// <returns>Frustum width, in world units. To find frustum height divide this by camera's aspect ratio. </returns>
 public float GetFrustumWidth(float distance)
 {
     if (ProjectionType == ProjectionType.Perspective)
     {
         return(distance * 2.0f * MathEx.Tan(FieldOfView * 0.5f));
     }
     else
     {
         return(distance * 0.5f);
     }
 }