/// <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); }
/// <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 poistive, the camera will move toward the lookat direction (ZoomIn). /// if the returned value is negative, the camera will move in the revers 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())); }
/// <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; }
/// <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); }
/// <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); }
/// <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)); }