Class TriangleTest
Triangle test functions.
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.Collision
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public static class TriangleTest
Methods
| Edit this page View SourceContainedBy(XMVector, XMVector, XMVector, XMVector, XMVector, XMVector, XMVector, XMVector, XMVector)
Tests whether a triangle is contained within six planes (typically a frustum).
Declaration
public static ContainmentType ContainedBy(XMVector v0, XMVector v1, XMVector v2, XMVector plane0, XMVector plane1, XMVector plane2, XMVector plane3, XMVector plane4, XMVector plane5)
Parameters
Type | Name | Description |
---|---|---|
XMVector | v0 | The first vector defining the triangle. |
XMVector | v1 | The second vector defining the triangle. |
XMVector | v2 | The third vector defining the triangle. |
XMVector | plane0 | A vector defining the first plane. |
XMVector | plane1 | A vector defining the second plane. |
XMVector | plane2 | A vector defining the third plane. |
XMVector | plane3 | A vector defining the fourth plane. |
XMVector | plane4 | A vector defining the fifth plane. |
XMVector | plane5 | A vector defining the sixth plane. |
Returns
Type | Description |
---|---|
ContainmentType | A ContainmentType value indicating whether the triangle is contained within the planes. |
Intersects(XMVector, XMVector, XMVector, XMVector)
Tests whether a triangle and a plane intersect.
Declaration
public static PlaneIntersectionType Intersects(XMVector v0, XMVector v1, XMVector v2, XMVector plane)
Parameters
Type | Name | Description |
---|---|---|
XMVector | v0 | The first vector defining a triangle. |
XMVector | v1 | The second vector defining a triangle. |
XMVector | v2 | The third vector defining a triangle. |
XMVector | plane | A vector defining a plane. |
Returns
Type | Description |
---|---|
PlaneIntersectionType | A PlaneIntersectionType value indicating whether the triangle intersects the plane. |
Intersects(XMVector, XMVector, XMVector, XMVector, XMVector)
Test whether a triangle intersects with a ray.
Declaration
public static bool Intersects(XMVector origin, XMVector direction, XMVector v0, XMVector v1, XMVector v2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | origin | The origin of the ray. |
XMVector | direction | The direction of the ray. |
XMVector | v0 | The first vector defining the triangle. |
XMVector | v1 | The second vector defining the triangle. |
XMVector | v2 | The third vector defining the triangle. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the triangle intersects with the ray. |
Intersects(XMVector, XMVector, XMVector, XMVector, XMVector, XMVector)
Test whether two triangles intersect.
Declaration
public static bool Intersects(XMVector a0, XMVector a1, XMVector a2, XMVector b0, XMVector b1, XMVector b2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | a0 | The first vector defining triangle A. |
XMVector | a1 | The second vector defining triangle A. |
XMVector | a2 | The third vector defining triangle A. |
XMVector | b0 | The first vector defining triangle B. |
XMVector | b1 | The second vector defining triangle B. |
XMVector | b2 | The third vector defining triangle B. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the triangles intersect. |
Intersects(XMVector, XMVector, XMVector, XMVector, XMVector, out float)
Test whether a triangle intersects with a ray.
Declaration
public static bool Intersects(XMVector origin, XMVector direction, XMVector v0, XMVector v1, XMVector v2, out float distance)
Parameters
Type | Name | Description |
---|---|---|
XMVector | origin | The origin of the ray. |
XMVector | direction | The direction of the ray. |
XMVector | v0 | The first vector defining the triangle. |
XMVector | v1 | The second vector defining the triangle. |
XMVector | v2 | The third vector defining the triangle. |
float | distance | The distance along the ray where the intersection occurs. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the triangle intersects with the ray. |
Intersects(XMVector, XMVector, XMVector, XMVector, XMVector, out float, out float, out float)
Test whether a triangle intersects with a ray.
Declaration
public static bool Intersects(XMVector origin, XMVector direction, XMVector v0, XMVector v1, XMVector v2, out float coordinateU, out float coordinateV, out float distance)
Parameters
Type | Name | Description |
---|---|---|
XMVector | origin | The origin of the ray. |
XMVector | direction | The direction of the ray. |
XMVector | v0 | The first vector defining the triangle. |
XMVector | v1 | The second vector defining the triangle. |
XMVector | v2 | The third vector defining the triangle. |
float | coordinateU | The first barycentric hit coordinate. |
float | coordinateV | The second barycentric hit coordinate. |
float | distance | The distance along the ray where the intersection occurs. |
Returns
Type | Description |
---|---|
bool | A boolean value indicating whether the triangle intersects with the ray. |