Example #1
0
 /// <summary>
 /// Get the vector shift which when added to camera position will do the effect of zoom to extents (zoom to fit) operation,
 /// so all the passed points will fit in the current view.
 /// </summary>
 /// <param name="boundingBox">The bounding box.</param>
 /// <returns>The zoom to fit vector</returns>
 public Vector3 GetZoomToExtentsShiftVector(ref BoundingBox boundingBox)
 {
     return(GetZoomToExtentsShiftDistance(boundingBox.GetCorners()) * pNear.Normal);
 }
Example #2
0
 /// <summary>
 /// Determines if there is an intersection between the current object and a <see cref="BoundingBox"/>.
 /// </summary>
 /// <param name="box">The box to test.</param>
 /// <returns>Whether the two objects intersected.</returns>
 public PlaneIntersectionType Intersects(ref BoundingBox box)
 {
     return(Collision.PlaneIntersectsBox(ref this, ref box));
 }
Example #3
0
 /// <summary>
 /// Get the distance which when added to camera position along the lookat direction will do the effect of zoom to extents (zoom to fit) operation,
 /// so all the passed points will fit in the current view.
 /// if the returned value is positive, the camera will move toward the lookat direction (ZoomIn).
 /// if the returned value is negative, the camera will move in the reverse direction of the lookat direction (ZoomOut).
 /// </summary>
 /// <param name="boundingBox">The bounding box.</param>
 /// <returns>The zoom to fit distance</returns>
 public float GetZoomToExtentsShiftDistance(ref BoundingBox boundingBox)
 {
     return(GetZoomToExtentsShiftDistance(boundingBox.GetCorners()));
 }
Example #4
0
 /// <summary>
 /// Checks whether the current BoundingFrustum intersects a BoundingBox.
 /// </summary>
 /// <param name="box">The box.</param>
 /// <param name="result"><c>true</c> if the current BoundingFrustum intersects a BoundingSphere.</param>
 public void Intersects(ref BoundingBox box, out bool result)
 {
     result = Contains(ref box) != ContainmentType.Disjoint;
 }
Example #5
0
 /// <summary>
 /// Checks whether the current BoundingFrustum intersects a BoundingBox.
 /// </summary>
 /// <param name="box">The box.</param>
 /// <returns><c>true</c> if the current BoundingFrustum intersects a BoundingSphere.</returns>
 public bool Intersects(ref BoundingBox box)
 {
     return(Contains(ref box) != ContainmentType.Disjoint);
 }
Example #6
0
 /// <summary>
 /// Determines the intersection relationship between the frustum and a bounding box.
 /// </summary>
 /// <param name="box">The box.</param>
 /// <param name="result">Type of the containment.</param>
 public void Contains(ref BoundingBox box, out ContainmentType result)
 {
     result = Contains(ref box);
 }
Example #7
0
 /// <summary>
 /// Determines the intersection relationship between the frustum and a bounding box.
 /// </summary>
 /// <param name="box">The box.</param>
 /// <returns>Type of the containment</returns>
 public ContainmentType Contains(BoundingBox box)
 {
     return(Contains(ref box));
 }