Class ProximityExtensions
public static class ProximityExtensions
- Inheritance
-
ProximityExtensions
- Inherited Members
Methods
AttachTo(IProximity, Transform)
Attach a proximity to an attachmentRoot so it follows all transformations made to it.
public static IAttachedProximity AttachTo(this IProximity proximity, Transform attachmentRoot)
Parameters
proximityIProximityattachmentRootTransform
Returns
CreateMesh(IPolygonProximity, int, Vector3?, out Vector3)
public static Mesh CreateMesh(this IPolygonProximity proximity, int triCount, Vector3? originOverride, out Vector3 origin)
Parameters
proximityIPolygonProximitytriCountintoriginOverrideVector3?originVector3
Returns
- Mesh
GetNearestPointOnBorder(IAABBProximity, in Vector3)
Get the nearest point on the surface of an axis-aligned bounding box to fromLocation.
public static Vector3 GetNearestPointOnBorder(IAABBProximity proximity, in Vector3 fromLocation)
Parameters
proximityIAABBProximityfromLocationVector3
Returns
- Vector3
GetNearestPointOnBorder(IAACylinderProximity, in Vector3)
Get the nearest point on the surface of an axis-aligned cylinder to fromLocation.
public static Vector3 GetNearestPointOnBorder(IAACylinderProximity proximity, in Vector3 fromLocation)
Parameters
proximityIAACylinderProximityfromLocationVector3
Returns
- Vector3
Exceptions
- ArgumentException
Axis is not X, Y, or Z in
proximity.
GetNearestPointOnBorder(IPolygonProximity, in Vector3)
Get the nearest point on the surface of a 2D polygon to fromLocation.
public static Vector3 GetNearestPointOnBorder(IPolygonProximity proximity, in Vector3 fromLocation)
Parameters
proximityIPolygonProximityfromLocationVector3
Returns
- Vector3
GetNearestPointOnBorder(IProximity, in Vector3)
Get the nearest point on a proximity's border. Some proximities may throw NotSupportedException.
public static Vector3 GetNearestPointOnBorder(this IProximity proximity, in Vector3 fromLocation)
Parameters
proximityIProximityfromLocationVector3
Returns
- Vector3
Exceptions
- NotSupportedException
Can not caluclate the nearest point for
proximity.
GetNearestPointOnBorder(ISphereProximity, in Vector3)
Get the nearest point on the surface of a sphere to fromLocation.
public static Vector3 GetNearestPointOnBorder(ISphereProximity proximity, in Vector3 fromLocation)
Parameters
proximityISphereProximityfromLocationVector3
Returns
- Vector3