Class GeometryUtils
Utility methods for common geometric operations.
Inherited Members
Namespace: Unity.XR.CoreUtils
Assembly: solution.dll
Syntax
public static class GeometryUtils
Methods
Name | Description |
---|---|
ClosestPointOnLineSegment(Vector3, Vector3, Vector3) | Returns the point along a line segment closest to a given point. |
ClosestPointsOnTwoLineSegments(Vector3, Vector3, Vector3, Vector3, out Vector3, out Vector3, double) | Finds the closest points between two line segments. |
ClosestPolygonApproach(List<Vector3>, List<Vector3>, out Vector3, out Vector3, float) | Finds the closest points of the perimeters of two polygons. |
ClosestTimesOnTwoLines(Vector3, Vector3, Vector3, Vector3, out float, out float, double) | Finds the times at which two linear trajectories are the closest to each other. |
ClosestTimesOnTwoLinesXZ(Vector3, Vector3, Vector3, Vector3, out float, out float, double) | Finds the times of closest approach between two non-parallel trajectories. |
ConvexHull2D(List<Vector3>, List<Vector3>) | Finds the smallest convex polygon in the XZ plane that contains |
ConvexPolygonArea(List<Vector3>) | Finds the area of a convex polygon. |
FindClosestEdge(List<Vector3>, Vector3, out Vector3, out Vector3) | Finds the side of a polygon closest to a specified world space position. |
OrientedMinimumBoundingBox2D(List<Vector3>, Vector3[]) | Find the oriented minimum bounding box for a 2D convex hull. |
PointInPolygon(Vector3, List<Vector3>) | Determines if a point is inside of a polygon on the XZ plane. (The y value is not used.) |
PointInPolygon3D(Vector3, List<Vector3>) | Determines if a point is inside of a convex polygon and lies on the surface. |
PointOnLineSegmentXZ(Vector3, Vector3, Vector3, float) | Determines if a point lies on a line segment, ignoring the y components. |
PointOnOppositeSideOfPolygon(List<Vector3>, Vector3) | Finds the point on a polygon perimeter farthest from a specified point in space. |
PointOnPolygonBoundsXZ(Vector3, List<Vector3>, float) | Determines if a point lies on the bounds of a polygon, ignoring the y components. |
PolygonCentroid2D(List<Vector3>) | Given a list of vertices of a 2d convex polygon, find the centroid of the polygon. This implementation operates only on the X and Z axes. |
PolygonInPolygon(List<Vector3>, List<Vector3>) | Determines if one polygon lies completely inside another coplanar polygon. |
PolygonUVPoseFromPlanePose(Pose) | Gets a corrected polygon uv pose from a given plane pose. |
PolygonVertexToUV(Vector3, Pose, Pose) | Takes a polygon UV coordinate, and produces a pose-corrected UV coordinate. |
PolygonsWithinRange(List<Vector3>, List<Vector3>, float) | Determines if two convex coplanar polygons are within a certain distance from each other. This includes the polygon perimeters as well as their interiors. |
PolygonsWithinSqRange(List<Vector3>, List<Vector3>, float) | Determines if two convex coplanar polygons are within a specified distance from each other. |
ProjectPointOnPlane(Vector3, Vector3, Vector3) | Returns the point on a plane closest to a specified point. |
RotationForBox(Vector3[]) | Given a 2D bounding box's vertices, find the rotation of the box. |
TriangulatePolygon(List<int>, int, bool) | Generates a standard triangle buffer with a given number of indices and adds it to the specified list. |