Class FixedGeometryUnityExtensions
- Namespace
- FixedMathSharp.Geometry
Provides explicit conversions between Unity and FixedMathSharp geometry primitives.
public static class FixedGeometryUnityExtensions
- Inheritance
-
FixedGeometryUnityExtensions
- Inherited Members
Methods
ToFixedBoundArea(Rect)
Converts a Unity Rect to a FixedMathSharp bound area using its minimum and maximum endpoints.
public static FixedBoundArea ToFixedBoundArea(this Rect rect)
Parameters
rectRect
Returns
ToFixedPlane(Plane)
Converts a Unity Plane to a FixedPlane by copying its normal and distance.
public static FixedPlane ToFixedPlane(this Plane plane)
Parameters
planePlane
Returns
ToFixedRay(Ray)
Converts a Unity Ray to a FixedRay, normalizing any nonzero direction.
public static FixedRay ToFixedRay(this Ray ray)
Parameters
rayRay
Returns
ToFixedRay2d(Ray2D)
Converts a Unity Ray2D to a FixedRay2d, normalizing any nonzero direction.
public static FixedRay2d ToFixedRay2d(this Ray2D ray)
Parameters
rayRay2D
Returns
ToPlane(FixedPlane)
Converts a FixedPlane to a Unity Plane by copying its normal and distance.
public static Plane ToPlane(this FixedPlane fixedPlane)
Parameters
fixedPlaneFixedPlane
Returns
- Plane
ToRay(FixedRay)
Converts a FixedRay with a zero or normalized direction to a Unity Ray.
public static Ray ToRay(this FixedRay fixedRay)
Parameters
fixedRayFixedRay
Returns
- Ray
Exceptions
- InvalidOperationException
The direction is nonzero and not normalized.
ToRay2D(FixedRay2d)
Converts a FixedRay2d with a zero or normalized direction to a Unity Ray2D.
public static Ray2D ToRay2D(this FixedRay2d fixedRay)
Parameters
fixedRayFixedRay2d
Returns
- Ray2D
Exceptions
- InvalidOperationException
The direction is nonzero and not normalized.
ToRect(FixedBoundArea)
Converts a FixedMathSharp bound area to a Unity Rect using its minimum and maximum endpoints.
public static Rect ToRect(this FixedBoundArea area)
Parameters
areaFixedBoundArea
Returns
- Rect
TryToRay(FixedRay, out Ray)
Tries to convert a FixedRay whose direction is zero or normalized to a Unity Ray.
public static bool TryToRay(this FixedRay fixedRay, out Ray ray)
Parameters
fixedRayFixedRayThe ray to convert.
rayRayThe converted ray, or the default value when conversion fails.
Returns
TryToRay2D(FixedRay2d, out Ray2D)
Tries to convert a FixedRay2d whose direction is zero or normalized to a Unity Ray2D.
public static bool TryToRay2D(this FixedRay2d fixedRay, out Ray2D ray)
Parameters
fixedRayFixedRay2dThe ray to convert.
rayRay2DThe converted ray, or the default value when conversion fails.