+++ /dev/null
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#pragma once\r
-\r
-#include "../design/BoundingBoxConverter.h"\r
-\r
-#include "Enums.h"\r
-#include "Vector3.h"\r
-\r
-using System::Runtime::InteropServices::OutAttribute;\r
-\r
-namespace SlimDX\r
-{\r
- value class BoundingSphere;\r
- value class Plane;\r
- value class Ray;\r
-\r
- ref class DataStream;\r
-\r
- /// <summary>\r
- /// An axis aligned bounding box, specified by minimum and maximum vectors.\r
- /// </summary>\r
- /// <unmanaged>None</unmanaged>\r
- [System::Serializable]\r
- [System::Runtime::InteropServices::StructLayout( System::Runtime::InteropServices::LayoutKind::Sequential )]\r
- [System::ComponentModel::TypeConverter( SlimDX::Design::BoundingBoxConverter::typeid )]\r
- public value class BoundingBox : System::IEquatable<BoundingBox>\r
- {\r
- public:\r
- /// <summary>\r
- /// The highest corner of the box.\r
- /// </summary>\r
- Vector3 Maximum;\r
-\r
- /// <summary>\r
- /// The lowest corner of the box.\r
- /// </summary>\r
- Vector3 Minimum;\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="BoundingBox"/> structure.\r
- /// </summary>\r
- /// <param name="minimum">The lowest corner of the box.</param>\r
- /// <param name="maximum">The highest corner of the box.</param>\r
- BoundingBox( Vector3 minimum, Vector3 maximum );\r
-\r
- /// <summary>\r
- /// Retrieves the eight corners of the bounding box.\r
- /// </summary>\r
- /// <returns>An array of points representing the eight corners of the bounding box.</returns>\r
- array<Vector3>^ GetCorners();\r
-\r
- /// <summary>\r
- /// Determines whether the box contains the specified box.\r
- /// </summary>\r
- /// <param name="box1">The first box that will be checked for containment.</param>\r
- /// <param name="box2">The second box that will be checked for containment.</param>\r
- /// <returns>A member of the <see cref="ContainmentType"/> enumeration indicating whether the two objects intersect, are contained, or don't meet at all.</returns>\r
- static ContainmentType Contains( BoundingBox box1, BoundingBox box2 );\r
-\r
- /// <summary>\r
- /// Determines whether the box contains the specified sphere.\r
- /// </summary>\r
- /// <param name="box">The box that will be checked for containment.</param>\r
- /// <param name="sphere">The sphere that will be checked for containment.</param>\r
- /// <returns>A member of the <see cref="ContainmentType"/> enumeration indicating whether the two objects intersect, are contained, or don't meet at all.</returns>\r
- static ContainmentType Contains( BoundingBox box, BoundingSphere sphere );\r
-\r
- /// <summary>\r
- /// Determines whether the box contains the specified point.\r
- /// </summary>\r
- /// <param name="box">The box that will be checked for containment.</param>\r
- /// <param name="vector">The point that will be checked for containment.</param>\r
- /// <returns>A member of the <see cref="ContainmentType"/> enumeration indicating whether the two objects intersect, are contained, or don't meet at all.</returns>\r
- static ContainmentType Contains( BoundingBox box, Vector3 vector );\r
-\r
- /// <summary>\r
- /// Constructs a <see cref="BoundingBox"/> that fully contains the given points.\r
- /// </summary>\r
- /// <param name="points">The points that will be contained by the box.</param>\r
- /// <returns>The newly constructed bounding box.</returns>\r
- static BoundingBox FromPoints( array<Vector3>^ points );\r
-\r
- /// <summary>\r
- /// Constructs a <see cref="BoundingBox"/> that fully contains the given points.\r
- /// </summary>\r
- /// <param name="points">The points that will be contained by the box.</param>\r
- /// <param name="count">The number of vertices in the stream.</param>\r
- /// <param name="stride">The number of bytes between vertices.</param>\r
- /// <returns>The newly constructed bounding box.</returns>\r
- static BoundingBox FromPoints( DataStream^ points, int count, int stride );\r
-\r
- /// <summary>\r
- /// Constructs a <see cref="BoundingBox"/> from a given sphere.\r
- /// </summary>\r
- /// <param name="sphere">The sphere that will designate the extents of the box.</param>\r
- /// <returns>The newly constructed bounding box.</returns>\r
- static BoundingBox FromSphere( BoundingSphere sphere );\r
-\r
- /// <summary>\r
- /// Constructs a <see cref="BoundingBox"/> that is the as large as the total combined area of the two specified boxes.\r
- /// </summary>\r
- /// <param name="box1">The first box to merge.</param>\r
- /// <param name="box2">The second box to merge.</param>\r
- /// <returns>The newly constructed bounding box.</returns>\r
- static BoundingBox Merge( BoundingBox box1, BoundingBox box2 );\r
-\r
- /// <summary>\r
- /// Determines whether a box intersects the specified object.\r
- /// </summary>\r
- /// <param name="box1">The first box which will be tested for intersection.</param>\r
- /// <param name="box2">The second box that will be tested for intersection.</param>\r
- /// <returns><c>true</c> if the two objects are intersecting; otherwise, <c>false</c>.</returns>\r
- static bool Intersects( BoundingBox box1, BoundingBox box2 );\r
-\r
- /// <summary>\r
- /// Determines whether a box intersects the specified object.\r
- /// </summary>\r
- /// <param name="box">The box which will be tested for intersection.</param>\r
- /// <param name="sphere">The sphere that will be tested for intersection.</param>\r
- /// <returns><c>true</c> if the two objects are intersecting; otherwise, <c>false</c>.</returns>\r
- static bool Intersects( BoundingBox box, BoundingSphere sphere );\r
-\r
- /// <summary>\r
- /// Determines whether a box intersects the specified object.\r
- /// </summary>\r
- /// <param name="box">The box which will be tested for intersection.</param>\r
- /// <param name="ray">The ray that will be tested for intersection.</param>\r
- /// <param name="distance">When the method completes, contains the distance from the ray's origin in which the intersection with the box occured.</param>\r
- /// <returns><c>true</c> if the two objects are intersecting; otherwise, <c>false</c>.</returns>\r
- static bool Intersects( BoundingBox box, Ray ray, [Out] float% distance );\r
-\r
- /// <summary>\r
- /// Finds the intersection between a plane and a box.\r
- /// </summary>\r
- /// <param name="box">The box to check for intersection.</param>\r
- /// <param name="plane">The source plane.</param>\r
- /// <returns>A value from the <see cref="PlaneIntersectionType"/> enumeration describing the result of the intersection test.</returns>\r
- static PlaneIntersectionType Intersects( BoundingBox box, Plane plane );\r
-\r
- /// <summary>\r
- /// Tests for equality between two objects.\r
- /// </summary>\r
- /// <param name="left">The first value to compare.</param>\r
- /// <param name="right">The second value to compare.</param>\r
- /// <returns><c>true</c> if <paramref name="left"/> has the same value as <paramref name="right"/>; otherwise, <c>false</c>.</returns>\r
- static bool operator == ( BoundingBox left, BoundingBox right );\r
-\r
- /// <summary>\r
- /// Tests for inequality between two objects.\r
- /// </summary>\r
- /// <param name="left">The first value to compare.</param>\r
- /// <param name="right">The second value to compare.</param>\r
- /// <returns><c>true</c> if <paramref name="left"/> has a different value than <paramref name="right"/>; otherwise, <c>false</c>.</returns>\r
- static bool operator != ( BoundingBox left, BoundingBox right );\r
-\r
- /// <summary>\r
- /// Converts the value of the object to its equivalent string representation.\r
- /// </summary>\r
- /// <returns>The string representation of the value of this instance.</returns>\r
- virtual System::String^ ToString() override;\r
-\r
- /// <summary>\r
- /// Returns the hash code for this instance.\r
- /// </summary>\r
- /// <returns>A 32-bit signed integer hash code.</returns>\r
- virtual int GetHashCode() override;\r
-\r
- /// <summary>\r
- /// Returns a value that indicates whether the current instance is equal to a specified object. \r
- /// </summary>\r
- /// <param name="obj">Object to make the comparison with.</param>\r
- /// <returns><c>true</c> if the current instance is equal to the specified object; <c>false</c> otherwise.</returns>\r
- virtual bool Equals( System::Object^ obj ) override;\r
-\r
- /// <summary>\r
- /// Returns a value that indicates whether the current instance is equal to the specified object. \r
- /// </summary>\r
- /// <param name="other">Object to make the comparison with.</param>\r
- /// <returns><c>true</c> if the current instance is equal to the specified object; <c>false</c> otherwise.</returns>\r
- virtual bool Equals( BoundingBox other );\r
-\r
- /// <summary>\r
- /// Determines whether the specified object instances are considered equal. \r
- /// </summary>\r
- /// <param name="value1"></param>\r
- /// <param name="value2"></param>\r
- /// <returns><c>true</c> if <paramref name="value1"/> is the same instance as <paramref name="value2"/> or \r
- /// if both are <c>null</c> references or if <c>value1.Equals(value2)</c> returns <c>true</c>; otherwise, <c>false</c>.</returns>\r
- static bool Equals( BoundingBox% value1, BoundingBox% value2 );\r
- };\r
-}
\ No newline at end of file