Exemplo n.º 1
0
        /// <summary>
        /// Checks for an intersection between a ray and an OrientatedBoundingBox.
        /// </summary>
        /// <param name="b">BoundingBox to check.</param>
        /// <returns>True if an intersection exists.</returns>
        public bool Intersects(OrientatedBoundingBox b)
        {
            Matrix4 inverse = b.Matrix.Inverse();
            Ray     ray     = new Ray(this.Origin * inverse, this.Direction * inverse);

            return(ray.Intersects(new AxisAlignedBoundingBox(b.Min, b.Max)));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Checks for an intersection between a ray and an OrientatedBoundingBox
 /// </summary>
 /// <param name="b">BoundingBox to check</param>
 /// <returns>True if an intersection exists</returns>
 public bool Intersects(OrientatedBoundingBox b)
 {
     Matrix4 inverse = b.Matrix.Inverse();
     Ray ray = new Ray(this.Origin * inverse, this.Direction * inverse);
     return ray.Intersects(new AxisAlignedBoundingBox(b.Min, b.Max));
 }