Table of Contents

Class FixedGeometryUnityExtensions

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

rect Rect

Returns

FixedBoundArea

ToFixedPlane(Plane)

Converts a Unity Plane to a FixedPlane by copying its normal and distance.

public static FixedPlane ToFixedPlane(this Plane plane)

Parameters

plane Plane

Returns

FixedPlane

ToFixedRay(Ray)

Converts a Unity Ray to a FixedRay, normalizing any nonzero direction.

public static FixedRay ToFixedRay(this Ray ray)

Parameters

ray Ray

Returns

FixedRay

ToFixedRay2d(Ray2D)

Converts a Unity Ray2D to a FixedRay2d, normalizing any nonzero direction.

public static FixedRay2d ToFixedRay2d(this Ray2D ray)

Parameters

ray Ray2D

Returns

FixedRay2d

ToPlane(FixedPlane)

Converts a FixedPlane to a Unity Plane by copying its normal and distance.

public static Plane ToPlane(this FixedPlane fixedPlane)

Parameters

fixedPlane FixedPlane

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

fixedRay FixedRay

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

fixedRay FixedRay2d

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

area FixedBoundArea

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

fixedRay FixedRay

The ray to convert.

ray Ray

The converted ray, or the default value when conversion fails.

Returns

bool

true when the direction is zero or normalized; otherwise, false.

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

fixedRay FixedRay2d

The ray to convert.

ray Ray2D

The converted ray, or the default value when conversion fails.

Returns

bool

true when the direction is zero or normalized; otherwise, false.