Class GorgonIntersections
Contains static methods to help in determining intersections, containment, etc.
Inherited Members
Namespace: Gorgon.Renderers
Assembly: Gorgon.Core.dll
Syntax
public static class GorgonIntersections
Methods
| Edit this page View SourceBoxContainsBox(in GorgonBoundingBox, in GorgonBoundingBox)
Determines whether a GorgonBoundingBox contains a GorgonBoundingBox.
Declaration
public static Containment BoxContainsBox(in GorgonBoundingBox box1, in GorgonBoundingBox box2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box1 | The first box to test. |
GorgonBoundingBox | box2 | The second box to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
BoxContainsPoint(in GorgonBoundingBox, in Vector3)
Determines whether a GorgonBoundingBox contains a point.
Declaration
public static Containment BoxContainsPoint(in GorgonBoundingBox box, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box | The box to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
BoxContainsSphere(in GorgonBoundingBox, in GorgonBoundingSphere)
Determines whether a GorgonBoundingBox contains a GorgonBoundingSphere.
Declaration
public static Containment BoxContainsSphere(in GorgonBoundingBox box, in GorgonBoundingSphere sphere)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box | The box to test. |
GorgonBoundingSphere | sphere | The sphere to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
BoxIntersectsBox(ref GorgonBoundingBox, ref GorgonBoundingBox)
Determines whether there is an intersection between a GorgonBoundingBox and a GorgonBoundingBox.
Declaration
public static bool BoxIntersectsBox(ref GorgonBoundingBox box1, ref GorgonBoundingBox box2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box1 | The first box to test. |
GorgonBoundingBox | box2 | The second box to test. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
BoxIntersectsSphere(in GorgonBoundingBox, in GorgonBoundingSphere)
Determines whether there is an intersection between a GorgonBoundingBox and a GorgonBoundingSphere.
Declaration
public static bool BoxIntersectsSphere(in GorgonBoundingBox box, in GorgonBoundingSphere sphere)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box | The box to test. |
GorgonBoundingSphere | sphere | The sphere to test. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
ClosestPointBoxPoint(in GorgonBoundingBox, in Vector3, out Vector3)
Determines the closest point between a GorgonBoundingBox and a point.
Declaration
public static void ClosestPointBoxPoint(in GorgonBoundingBox box, in Vector3 point, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box | The box to test. |
Vector3 | point | The point to test. |
Vector3 | result | When the method completes, contains the closest point between the two objects. |
ClosestPointPlanePoint(in Plane, in Vector3, out Vector3)
Determines the closest point between a Plane and a point.
Declaration
public static void ClosestPointPlanePoint(in Plane plane, in Vector3 point, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane to test. |
Vector3 | point | The point to test. |
Vector3 | result | When the method completes, contains the closest point between the two objects. |
ClosestPointPointTriangle(in Vector3, in Vector3, in Vector3, in Vector3, out Vector3)
Determines the closest point between a point and a triangle.
Declaration
public static void ClosestPointPointTriangle(in Vector3 point, in Vector3 vertex1, in Vector3 vertex2, in Vector3 vertex3, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The point to test. |
Vector3 | vertex1 | The first vertex to test. |
Vector3 | vertex2 | The second vertex to test. |
Vector3 | vertex3 | The third vertex to test. |
Vector3 | result | When the method completes, contains the closest point between the two objects. |
ClosestPointSpherePoint(in GorgonBoundingSphere, in Vector3, out Vector3)
Determines the closest point between a GorgonBoundingSphere and a point.
Declaration
public static void ClosestPointSpherePoint(in GorgonBoundingSphere sphere, in Vector3 point, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | |
Vector3 | point | The point to test. |
Vector3 | result | When the method completes, contains the closest point between the two objects; or, if the point is directly in the center of the sphere, contains Zero. |
ClosestPointSphereSphere(ref GorgonBoundingSphere, ref GorgonBoundingSphere, out Vector3)
Determines the closest point between a GorgonBoundingSphere and a GorgonBoundingSphere.
Declaration
public static void ClosestPointSphereSphere(ref GorgonBoundingSphere sphere1, ref GorgonBoundingSphere sphere2, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere1 | The first sphere to test. |
GorgonBoundingSphere | sphere2 | The second sphere to test. |
Vector3 | result | When the method completes, contains the closest point between the two objects; or, if the point is directly in the center of the sphere, contains Zero. |
Remarks
If the two spheres are overlapping, but not directly on top of each other, the closest point is the 'closest' point of intersection. This can also be considered is the deepest point of intersection.
DistanceBoxBox(in GorgonBoundingBox, in GorgonBoundingBox)
Determines the distance between a GorgonBoundingBox and a GorgonBoundingBox.
Declaration
public static float DistanceBoxBox(in GorgonBoundingBox box1, in GorgonBoundingBox box2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box1 | The first box to test. |
GorgonBoundingBox | box2 | The second box to test. |
Returns
Type | Description |
---|---|
float | The distance between the two objects. |
DistanceBoxPoint(in GorgonBoundingBox, in Vector3)
Determines the distance between a GorgonBoundingBox and a point.
Declaration
public static float DistanceBoxPoint(in GorgonBoundingBox box, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | box | The box to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
float | The distance between the two objects. |
DistancePlanePoint(in Plane, in Vector3)
Determines the distance between a Plane and a point.
Declaration
public static float DistancePlanePoint(in Plane plane, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
float | The distance between the two objects. |
DistanceSpherePoint(in GorgonBoundingSphere, in Vector3)
Determines the distance between a GorgonBoundingSphere and a point.
Declaration
public static float DistanceSpherePoint(in GorgonBoundingSphere sphere, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | The sphere to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
float | The distance between the two objects. |
DistanceSphereSphere(in GorgonBoundingSphere, in GorgonBoundingSphere)
Determines the distance between a GorgonBoundingSphere and a GorgonBoundingSphere.
Declaration
public static float DistanceSphereSphere(in GorgonBoundingSphere sphere1, in GorgonBoundingSphere sphere2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere1 | The first sphere to test. |
GorgonBoundingSphere | sphere2 | The second sphere to test. |
Returns
Type | Description |
---|---|
float | The distance between the two objects. |
FrustumContainsBox(GorgonBoundingFrustum, in GorgonBoundingBox)
Determines the intersection relationship between the frustum and a bounding box.
Declaration
public static Containment FrustumContainsBox(GorgonBoundingFrustum frustum, in GorgonBoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evalate. |
GorgonBoundingBox | box | The bounding box to evaluate. |
Returns
Type | Description |
---|---|
Containment | Type of the containment |
FrustumContainsPoint(GorgonBoundingFrustum, in Vector3)
Checks whether a point lay inside, intersects or lay outside the frustum.
Declaration
public static Containment FrustumContainsPoint(GorgonBoundingFrustum frustum, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evaluate. |
Vector3 | point | The point to evaluate. |
Returns
Type | Description |
---|---|
Containment | Type of the containment. |
FrustumContainsSphere(GorgonBoundingFrustum, in GorgonBoundingSphere)
Determines the intersection relationship between the frustum and a bounding sphere.
Declaration
public static Containment FrustumContainsSphere(GorgonBoundingFrustum frustum, in GorgonBoundingSphere sphere)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evaluate. |
GorgonBoundingSphere | sphere | The sphere to evaluate. |
Returns
Type | Description |
---|---|
Containment | Type of the containment |
FrustumIntersectsBox(GorgonBoundingFrustum, in GorgonBoundingBox)
Checks whether the current frustum intersects a bounding box.
Declaration
public static bool FrustumIntersectsBox(GorgonBoundingFrustum frustum, in GorgonBoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evaluate. |
GorgonBoundingBox | box | The bounding box to evaluate. |
Returns
Type | Description |
---|---|
bool |
FrustumIntersectsPlane(GorgonBoundingFrustum, in Plane)
Checks whether the current BoundingFrustum intersects the specified Plane.
Declaration
public static bool FrustumIntersectsPlane(GorgonBoundingFrustum frustum, in Plane plane)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evaluate. |
Plane | plane | The plane. |
Returns
Type | Description |
---|---|
bool | true if the frustum and plane intersect, false if not. |
FrustumIntersectsPlane(GorgonBoundingFrustum, in Plane, out PlaneIntersection)
Checks whether the current BoundingFrustum intersects the specified Plane.
Declaration
public static void FrustumIntersectsPlane(GorgonBoundingFrustum frustum, in Plane plane, out PlaneIntersection result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evaluate. |
Plane | plane | The plane. |
PlaneIntersection | result | Plane intersection type. |
FrustumIntersectsRay(GorgonBoundingFrustum, in GorgonRay, out float?, out float?)
Checks whether the current BoundingFrustum intersects the specified Ray.
Declaration
public static bool FrustumIntersectsRay(GorgonBoundingFrustum frustum, in GorgonRay ray, out float? inDistance, out float? outDistance)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingFrustum | frustum | The frustum to evaluate. |
GorgonRay | ray | The Ray to check for intersection with. |
float? | inDistance | The distance at which the ray enters the frustum if there is an intersection and the ray starts outside the frustum. |
float? | outDistance | The distance at which the ray exits the frustum if there is an intersection. |
Returns
Type | Description |
---|---|
bool |
|
PlaneIntersectsBox(in Plane, in GorgonBoundingBox)
Determines whether there is an intersection between a Plane and a GorgonBoundingBox.
Declaration
public static PlaneIntersection PlaneIntersectsBox(in Plane plane, in GorgonBoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane to test. |
GorgonBoundingBox | box | The box to test. |
Returns
Type | Description |
---|---|
PlaneIntersection | Whether the two objects intersected. |
PlaneIntersectsPlane(in Plane, in Plane)
Declaration
public static bool PlaneIntersectsPlane(in Plane plane1, in Plane plane2)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane1 | The first plane to test. |
Plane | plane2 | The second plane to test. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
PlaneIntersectsPlane(in Plane, in Plane, out GorgonRay)
Declaration
public static bool PlaneIntersectsPlane(in Plane plane1, in Plane plane2, out GorgonRay line)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane1 | The first plane to test. |
Plane | plane2 | The second plane to test. |
GorgonRay | line | When the method completes, contains the line of intersection as a GorgonRay, or a zero ray if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
Remarks
Although a ray is set to have an origin, the ray returned by this method is really a line in three dimensions which has no real origin. The ray is considered valid when both the positive direction is used and when the negative direction is used.
PlaneIntersectsPoint(in Plane, in Vector3)
Determines whether there is an intersection between a Plane and a point.
Declaration
public static PlaneIntersection PlaneIntersectsPoint(in Plane plane, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
PlaneIntersection | Whether the two objects intersected. |
PlaneIntersectsSphere(in Plane, in GorgonBoundingSphere)
Determines whether there is an intersection between a Plane and a GorgonBoundingSphere.
Declaration
public static PlaneIntersection PlaneIntersectsSphere(in Plane plane, in GorgonBoundingSphere sphere)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane to test. |
GorgonBoundingSphere | sphere | The sphere to test. |
Returns
Type | Description |
---|---|
PlaneIntersection | Whether the two objects intersected. |
PlaneIntersectsTriangle(in Plane, in Vector3, in Vector3, in Vector3)
Determines whether there is an intersection between a Plane and a triangle.
Declaration
public static PlaneIntersection PlaneIntersectsTriangle(in Plane plane, in Vector3 vertex1, in Vector3 vertex2, in Vector3 vertex3)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane to test. |
Vector3 | vertex1 | The first vertex of the triangle to test. |
Vector3 | vertex2 | The second vertex of the triangle to test. |
Vector3 | vertex3 | The third vertex of the triangle to test. |
Returns
Type | Description |
---|---|
PlaneIntersection | Whether the two objects intersected. |
RayIntersectsBox(in GorgonRay, in GorgonBoundingBox, out Vector3)
Declaration
public static bool RayIntersectsBox(in GorgonRay ray, in GorgonBoundingBox box, out Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
GorgonBoundingBox | box | The box to test. |
Vector3 | point | When the method completes, contains the point of intersection, or Zero if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
RayIntersectsBox(in GorgonRay, in GorgonBoundingBox, out float)
Determines whether there is an intersection between a GorgonRay and a GorgonBoundingBox.
Declaration
public static bool RayIntersectsBox(in GorgonRay ray, in GorgonBoundingBox box, out float distance)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
GorgonBoundingBox | box | The box to test. |
float | distance | When the method completes, contains the distance of the intersection, or 0 if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
RayIntersectsPlane(in GorgonRay, in Plane, out Vector3)
Declaration
public static bool RayIntersectsPlane(in GorgonRay ray, in Plane plane, out Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
Plane | plane | The plane to test |
Vector3 | point | When the method completes, contains the point of intersection, or Zero if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
RayIntersectsPlane(in GorgonRay, in Plane, out float)
Declaration
public static bool RayIntersectsPlane(in GorgonRay ray, in Plane plane, out float distance)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
Plane | plane | The plane to test. |
float | distance | When the method completes, contains the distance of the intersection, or 0 if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersect. |
RayIntersectsPoint(in GorgonRay, in Vector3)
Determines whether there is an intersection between a GorgonRay and a point.
Declaration
public static bool RayIntersectsPoint(in GorgonRay ray, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersect. |
RayIntersectsRay(in GorgonRay, in GorgonRay, out Vector3)
Declaration
public static bool RayIntersectsRay(in GorgonRay ray1, in GorgonRay ray2, out Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray1 | The first ray to test. |
GorgonRay | ray2 | The second ray to test. |
Vector3 | point | When the method completes, contains the point of intersection, or Zero if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersect. |
Remarks
This method performs a ray vs ray intersection test based on the following formula from Goldman.
s = det([o_2 - o_1, d_2, d_1 x d_2]) / ||d_1 x d_2||^2
t = det([o_2 - o_1, d_1, d_1 x d_2]) / ||d_1 x d_2||^2
Where o_1 is the position of the first ray, o_2 is the position of the second ray, d_1 is the normalized direction of the first ray, d_2 is the normalized direction of the second ray, det denotes the determinant of a matrix, x denotes the cross product, [ ] denotes a matrix, and || || denotes the length or magnitude of a vector.
RayIntersectsSphere(in GorgonRay, ref GorgonBoundingSphere, out Vector3)
Determines whether there is an intersection between a GorgonRay and a GorgonBoundingSphere.
Declaration
public static bool RayIntersectsSphere(in GorgonRay ray, ref GorgonBoundingSphere sphere, out Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
GorgonBoundingSphere | sphere | The sphere to test. |
Vector3 | point | When the method completes, contains the point of intersection, or Zero if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
RayIntersectsSphere(in GorgonRay, in GorgonBoundingSphere, out float)
Determines whether there is an intersection between a GorgonRay and a GorgonBoundingSphere.
Declaration
public static bool RayIntersectsSphere(in GorgonRay ray, in GorgonBoundingSphere sphere, out float distance)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
GorgonBoundingSphere | sphere | The sphere to test. |
float | distance | When the method completes, contains the distance of the intersection, or 0 if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
RayIntersectsTriangle(in GorgonRay, in Vector3, in Vector3, in Vector3, out Vector3)
Determines whether there is an intersection between a GorgonRay and a triangle.
Declaration
public static bool RayIntersectsTriangle(in GorgonRay ray, in Vector3 vertex1, in Vector3 vertex2, in Vector3 vertex3, out Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
Vector3 | vertex1 | The first vertex of the triangle to test. |
Vector3 | vertex2 | The second vertex of the triangle to test. |
Vector3 | vertex3 | The third vertex of the triangle to test. |
Vector3 | point | When the method completes, contains the point of intersection, or Zero if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
RayIntersectsTriangle(in GorgonRay, in Vector3, in Vector3, in Vector3, out float)
Determines whether there is an intersection between a GorgonRay and a triangle.
Declaration
public static bool RayIntersectsTriangle(in GorgonRay ray, in Vector3 vertex1, in Vector3 vertex2, in Vector3 vertex3, out float distance)
Parameters
Type | Name | Description |
---|---|---|
GorgonRay | ray | The ray to test. |
Vector3 | vertex1 | The first vertex of the triangle to test. |
Vector3 | vertex2 | The second vertex of the triangle to test. |
Vector3 | vertex3 | The third vertex of the triangle to test. |
float | distance | When the method completes, contains the distance of the intersection, or 0 if there was no intersection. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
Remarks
This method tests if the ray intersects either the front or back of the triangle. If the ray is parallel to the triangle's plane, no intersection is assumed to have happened. If the intersection of the ray and the triangle is behind the origin of the ray, no intersection is assumed to have happened. In both cases of assumptions, this method returns false.
SphereContainsBox(in GorgonBoundingSphere, in GorgonBoundingBox)
Determines whether a GorgonBoundingSphere contains a GorgonBoundingBox.
Declaration
public static Containment SphereContainsBox(in GorgonBoundingSphere sphere, in GorgonBoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | The sphere to test. |
GorgonBoundingBox | box | The box to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
SphereContainsPoint(in GorgonBoundingSphere, in Vector3)
Determines whether a GorgonBoundingSphere contains a point.
Declaration
public static Containment SphereContainsPoint(in GorgonBoundingSphere sphere, in Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | The sphere to test. |
Vector3 | point | The point to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
SphereContainsSphere(in GorgonBoundingSphere, in GorgonBoundingSphere)
Determines whether a GorgonBoundingSphere contains a GorgonBoundingSphere.
Declaration
public static Containment SphereContainsSphere(in GorgonBoundingSphere sphere1, in GorgonBoundingSphere sphere2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere1 | The first sphere to test. |
GorgonBoundingSphere | sphere2 | The second sphere to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
SphereContainsTriangle(in GorgonBoundingSphere, in Vector3, in Vector3, in Vector3)
Determines whether a GorgonBoundingSphere contains a triangle.
Declaration
public static Containment SphereContainsTriangle(in GorgonBoundingSphere sphere, in Vector3 vertex1, in Vector3 vertex2, in Vector3 vertex3)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | The sphere to test. |
Vector3 | vertex1 | The first vertex of the triangle to test. |
Vector3 | vertex2 | The second vertex of the triangle to test. |
Vector3 | vertex3 | The third vertex of the triangle to test. |
Returns
Type | Description |
---|---|
Containment | The type of containment the two objects have. |
SphereIntersectsSphere(in GorgonBoundingSphere, in GorgonBoundingSphere)
Determines whether there is an intersection between a GorgonBoundingSphere and a GorgonBoundingSphere.
Declaration
public static bool SphereIntersectsSphere(in GorgonBoundingSphere sphere1, in GorgonBoundingSphere sphere2)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere1 | First sphere to test. |
GorgonBoundingSphere | sphere2 | Second sphere to test. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |
SphereIntersectsTriangle(in GorgonBoundingSphere, in Vector3, in Vector3, in Vector3)
Determines whether there is an intersection between a GorgonBoundingSphere and a triangle.
Declaration
public static bool SphereIntersectsTriangle(in GorgonBoundingSphere sphere, in Vector3 vertex1, in Vector3 vertex2, in Vector3 vertex3)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | The sphere to test. |
Vector3 | vertex1 | The first vertex of the triangle to test. |
Vector3 | vertex2 | The second vertex of the triangle to test. |
Vector3 | vertex3 | The third vertex of the triangle to test. |
Returns
Type | Description |
---|---|
bool | Whether the two objects intersected. |