Class LineUtility
Mixed Reality line utility class with helpful math functions for calculation, and other convenience methods.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities
Assembly: cs.temp.dll.dll
Syntax
public static class LineUtility
Methods
GetEllipsePoint(Vector2, Single)
Calculate the ellipse point at the angle provided.
Declaration
public static Vector3 GetEllipsePoint(Vector2 radius, float angle)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | radius | The radius of the ellipse. |
Single | angle | Angle along the ellipse to find the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point at the specified angle. |
GetPointAlongConstrainedParabola(Vector3, Vector3, Vector3, Single, Single)
Gets the point along a constrained parabola.
Declaration
public static Vector3 GetPointAlongConstrainedParabola(Vector3 origin, Vector3 end, Vector3 upDirection, float height, float normalizedLength)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | origin | The point in space where the parabola starts. |
Vector3 | end | The point in space where the parabola ends. |
Vector3 | upDirection | The up direction of the arc. |
Single | height | The height of the arc. |
Single | normalizedLength | the normalized length along the line to calculate the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
GetPointAlongPhysicalParabola(Vector3, Vector3, Single, Vector3, Single)
Gets the point along a physics based parabola.
Declaration
public static Vector3 GetPointAlongPhysicalParabola(Vector3 origin, Vector3 direction, float velocity, Vector3 gravity, float time)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | origin | The point in space where the parabola starts |
Vector3 | direction | The direction the line is intended to go |
Single | velocity | |
Vector3 | gravity | |
Single | time |
Returns
Type | Description |
---|---|
Vector3 | The calculated point. |
GetPointAlongSpline(MixedRealityPose[], Single, InterpolationType)
Gets the point along the spline.
Declaration
public static Vector3 GetPointAlongSpline(MixedRealityPose[] points, float normalizedLength, InterpolationType interpolation = InterpolationType.Bezier)
Parameters
Type | Name | Description |
---|---|---|
MixedRealityPose[] | points | the points of the whole spline. |
Single | normalizedLength | the normalized length along the line to calculate the point. |
InterpolationType | interpolation | Optional Interpolation type to use when calculating the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
GetVectorCollectionBlend(Vector3[], Single, Boolean)
Returns a blended value from a collection of vectors
Declaration
public static Vector3 GetVectorCollectionBlend(Vector3[] vectorCollection, float normalizedLength, bool repeat)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | vectorCollection | The collection to use to calculate the blend. |
Single | normalizedLength | the normalized length along the line to calculate the point. |
Boolean | repeat |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
InterpolateBezierPoints(Vector3, Vector3, Vector3, Vector3, Single)
Interpolate the provided points using the standard Bezier algorithm.
Declaration
public static Vector3 InterpolateBezierPoints(Vector3 point1, Vector3 point2, Vector3 point3, Vector3 point4, float normalizedLength)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point1 | |
Vector3 | point2 | |
Vector3 | point3 | |
Vector3 | point4 | |
Single | normalizedLength | the normalized length along the line to calculate the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
InterpolateCatmullRomPoints(Vector3, Vector3, Vector3, Vector3, Single)
Interpolate the provided points using Catmull Rom algorithm.
Declaration
public static Vector3 InterpolateCatmullRomPoints(Vector3 point1, Vector3 point2, Vector3 point3, Vector3 point4, float normalizedLength)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point1 | |
Vector3 | point2 | |
Vector3 | point3 | |
Vector3 | point4 | |
Single | normalizedLength | the normalized length along the line to calculate the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
InterpolateHermitePoints(Vector3, Vector3, Vector3, Vector3, Single)
Interpolate the provided points using the Hermite algorithm.
Declaration
public static Vector3 InterpolateHermitePoints(Vector3 point1, Vector3 point2, Vector3 point3, Vector3 point4, float normalizedLength)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point1 | |
Vector3 | point2 | |
Vector3 | point3 | |
Vector3 | point4 | |
Single | normalizedLength | the normalized length along the line to calculate the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
InterpolateVectorArray(Vector3[], Single)
Interpolate a position between the provided points.
Declaration
public static Vector3 InterpolateVectorArray(Vector3[] points, float normalizedLength)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | points | The points to use in the calculation. |
Single | normalizedLength | the normalized length along the line to calculate the point. |
Returns
Type | Description |
---|---|
Vector3 | The calculated point found along the normalized length. |
Invert(Color)
Inverts the color
Declaration
public static Color Invert(this Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color |
Returns
Type | Description |
---|---|
Color |