+++ /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/PlaneConverter.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 BoundingBox;\r
- value class BoundingSphere;\r
- value class Quaternion;\r
-\r
- /// <summary>\r
- /// Defines a plane in three dimensions.\r
- /// </summary>\r
- /// <unmanaged>D3DXPLANE</unmanaged>\r
- [System::Serializable]\r
- [System::Runtime::InteropServices::StructLayout( System::Runtime::InteropServices::LayoutKind::Sequential )]\r
- [System::ComponentModel::TypeConverter( SlimDX::Design::PlaneConverter::typeid )]\r
- public value class Plane : System::IEquatable<Plane>\r
- {\r
- public:\r
- /// <summary>\r
- /// The normal vector of the plane.\r
- /// </summary>\r
- Vector3 Normal;\r
-\r
- /// <summary>\r
- /// The distance of the plane along its normal from the origin.\r
- /// </summary>\r
- float D;\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="SlimDX::Plane"/> class.\r
- /// </summary>\r
- /// <param name="a">X component of the normal defining the plane.</param>\r
- /// <param name="b">Y component of the normal defining the plane.</param>\r
- /// <param name="c">Z component of the normal defining the plane.</param>\r
- /// <param name="d">Distance of the plane along its normal from the origin.</param>\r
- Plane( float a, float b, float c, float d );\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="SlimDX::Plane"/> class.\r
- /// </summary>\r
- /// <param name="normal">The normal vector to the plane.</param>\r
- /// <param name="d">Distance of the plane along its normal from the origin.</param>\r
- Plane( Vector3 normal, float d );\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="SlimDX::Plane"/> class.\r
- /// </summary>\r
- /// <param name="point">Any point that lies along the plane.</param>\r
- /// <param name="normal">The normal vector to the plane.</param>\r
- Plane( Vector3 point, Vector3 normal );\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="SlimDX::Plane"/> class.\r
- /// </summary>\r
- /// <param name="point1">First point of a triangle defining the plane.</param>\r
- /// <param name="point2">Second point of a triangle defining the plane.</param>\r
- /// <param name="point3">Third point of a triangle defining the plane.</param>\r
- Plane( Vector3 point1, Vector3 point2, Vector3 point3 );\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="SlimDX::Plane"/> class.\r
- /// </summary>\r
- /// <param name="value">\r
- /// A vector with the X, Y, and Z components defining the normal to the plane.\r
- /// The W component defines the distance of the plane along its normal from the origin.\r
- /// </param>\r
- Plane( Vector4 value );\r
-\r
- /// <summary>\r
- /// Calculates the dot product of the specified vector and plane.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="point">The source vector.</param>\r
- /// <returns>The dot product of the specified vector and plane.</returns>\r
- static float Dot( Plane plane, Vector4 point );\r
-\r
- /// <summary>\r
- /// Calculates the dot product of a specified vector and the normal of the plane plus the distance value of the plane.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="point">The source vector.</param>\r
- /// <returns>The dot product of a specified vector and the normal of the Plane plus the distance value of the plane.</returns>\r
- static float DotCoordinate( Plane plane, Vector3 point );\r
-\r
- /// <summary>\r
- /// Calculates the dot product of the specified vector and the normal of the plane.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="point">The source vector.</param>\r
- /// <returns>The dot product of the specified vector and the normal of the plane.</returns>\r
- static float DotNormal( Plane plane, Vector3 point );\r
-\r
- /// <summary>\r
- /// Changes the coefficients of the normal vector of the plane to make it of unit length.\r
- /// </summary>\r
- void Normalize();\r
- \r
- /// <summary>\r
- /// Changes the coefficients of the normal vector of the plane to make it of unit length.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <returns>The normalized plane.</returns>\r
- static Plane Normalize( Plane plane );\r
- \r
- /// <summary>\r
- /// Changes the coefficients of the normal vector of the plane to make it of unit length.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="result">When the method completes, contains the normalized plane.</param>\r
- static void Normalize( Plane% plane, [Out] Plane% result );\r
-\r
- /// <summary>\r
- /// Transforms a normalized plane by a matrix.\r
- /// </summary>\r
- /// <param name="plane">The normalized source plane.</param>\r
- /// <param name="transformation">The transformation matrix.</param>\r
- /// <returns>The transformed plane.</returns>\r
- static Plane Transform( Plane plane, Matrix transformation );\r
-\r
- /// <summary>\r
- /// Transforms a normalized plane by a matrix.\r
- /// </summary>\r
- /// <param name="plane">The normalized source plane.</param>\r
- /// <param name="transformation">The transformation matrix.</param>\r
- /// <param name="result">When the method completes, contains the transformed plane.</param>\r
- static void Transform( Plane% plane, Matrix% transformation, [Out] Plane% result );\r
-\r
- /// <summary>\r
- /// Transforms an array of normalized planes by a matrix.\r
- /// </summary>\r
- /// <param name="planes">The normalized source planes.</param>\r
- /// <param name="transformation">The transformation matrix.</param>\r
- /// <returns>The transformed planes.</returns>\r
- static array<Plane>^ Transform( array<Plane>^ planes, Matrix% transformation );\r
-\r
- /// <summary>\r
- /// Transforms a normalized plane by a quaternion rotation.\r
- /// </summary>\r
- /// <param name="plane">The normalized source plane.</param>\r
- /// <param name="rotation">The quaternion rotation.</param>\r
- /// <returns>The transformed plane.</returns>\r
- static Plane Transform( Plane plane, Quaternion rotation );\r
-\r
- /// <summary>\r
- /// Transforms a normalized plane by a quaternion rotation.\r
- /// </summary>\r
- /// <param name="plane">The normalized source plane.</param>\r
- /// <param name="rotation">The quaternion rotation.</param>\r
- /// <param name="result">When the method completes, contains the transformed plane.</param>\r
- static void Transform( Plane% plane, Quaternion% rotation, [Out] Plane% result );\r
-\r
- /// <summary>\r
- /// Transforms an array of normalized planes by a quaternion rotation.\r
- /// </summary>\r
- /// <param name="planes">The normalized source planes.</param>\r
- /// <param name="rotation">The quaternion rotation.</param>\r
- /// <returns>The transformed planes.</returns>\r
- static array<Plane>^ Transform( array<Plane>^ planes, Quaternion% rotation );\r
-\r
- /// <summary>\r
- /// Finds the intersection between a plane and a line.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="start">The start point of the line.</param>\r
- /// <param name="end">The end point of the line.</param>\r
- /// <param name="intersectPoint">If an intersection is found, contains the intersection point between the line and the plane.</param>\r
- /// <returns><c>true</c> if an intersection is found; <c>false</c> otherwise.</returns>\r
- static bool Intersects( Plane plane, Vector3 start, Vector3 end, [Out] Vector3% intersectPoint );\r
-\r
- /// <summary>\r
- /// Finds the intersection between a plane and a box.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="box">The box to check for intersection.</param>\r
- /// <returns>A value from the <see cref="PlaneIntersectionType"/> enumeration describing the result of the intersection test.</returns>\r
- static PlaneIntersectionType Intersects( Plane plane, BoundingBox box );\r
- \r
- /// <summary>\r
- /// Finds the intersection between a plane and a sphere.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="sphere">The sphere to check for intersection.</param>\r
- /// <returns>A value from the <see cref="PlaneIntersectionType"/> enumeration describing the result of the intersection test.</returns>\r
- static PlaneIntersectionType Intersects( Plane plane, BoundingSphere sphere );\r
-\r
- /// <summary>\r
- /// Scales the plane by the given scaling factor.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="scale">The scaling factor.</param>\r
- /// <returns>The scaled plane.</returns>\r
- static Plane Multiply( Plane plane, float scale );\r
-\r
- /// <summary>\r
- /// Scales the plane by the given scaling factor.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="scale">The scaling factor.</param>\r
- /// <param name="result">When the method completes, contains the scaled plane.</param>\r
- static void Multiply( Plane% plane, float scale, [Out] Plane% result );\r
-\r
- /// <summary>\r
- /// Scales the plane by the given scaling factor.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="scale">The scaling factor.</param>\r
- /// <returns>The scaled plane.</returns>\r
- static Plane operator * ( Plane plane, float scale );\r
-\r
- /// <summary>\r
- /// Scales the plane by the given scaling factor.\r
- /// </summary>\r
- /// <param name="plane">The source plane.</param>\r
- /// <param name="scale">The scaling factor.</param>\r
- /// <returns>The scaled plane.</returns>\r
- static Plane operator * ( float scale, 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 == ( Plane left, Plane 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 != ( Plane left, Plane 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( Plane 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( Plane% value1, Plane% value2 );\r
- };\r
-}\r