Curvy  8.3.0
CurvyUtility Class Reference

Detailed Description

Curvy Utility class

Static Public Member Functions

static bool Approximately (this float x, float y)
 Does the same things as Mathf.Approximately, but with different handling of case where one of the two values is 0 Considering inputs of 0 and 1E-7, Mathf.Approximately will return false, while this method will return true. More...
 
static float ClampDistance (float distance, CurvyClamping clamping, float length)
 Clamps absolute position More...
 
static float ClampDistance (float distance, CurvyClamping clamping, float length, float min, float max)
 Clamps absolute position More...
 
static float ClampDistance (float distance, ref int dir, CurvyClamping clamping, float length)
 Clamps absolute position and sets new direction More...
 
static float ClampDistance (float distance, ref int dir, CurvyClamping clamping, float length, float min, float max)
 Clamps absolute position and sets new direction More...
 
static float ClampTF (float tf, CurvyClamping clamping)
 Clamps relative position More...
 
static float ClampTF (float tf, ref int dir, CurvyClamping clamping)
 Clamps relative position and sets new direction More...
 
static float ClampValue (float tf, CurvyClamping clamping, float minTF, float maxTF)
 Clamps a float to a range More...
 
static Material GetDefaultMaterial ()
 Gets the default material, i.e. Curvy/Resources/CurvyDefaultMaterial More...
 
static void GetNearestPointIndex (Vector3 point, Vector3[] points, int pointsCount, out int index, out float fragement)
 Given an input point, gets the index of the point in the array that is closest to the input point. More...
 
static int InterpolationSearch (float[] array, float x)
 Finds the index of x in an array of sorted values (ascendant order). If x not found, the closest smaller value's index is returned if any, -1 otherwise More...
 
static int InterpolationSearch (float[] array, int elementsCount, float x)
 Finds the index of x in an array of sorted values (ascendant order). If x not found, the closest smaller value's index is returned if any, -1 otherwise More...
 
static Mesh SplineToMesh (this CurvySpline spline)
 Returns a mesh which boundaries are the input spline, similarly to what the Spline To Mesh window does, but simpler and less configurable. More...
 

Member Function Documentation

static bool Approximately ( this float  x,
float  y 
)
static

Does the same things as Mathf.Approximately, but with different handling of case where one of the two values is 0 Considering inputs of 0 and 1E-7, Mathf.Approximately will return false, while this method will return true.

static float ClampDistance ( float  distance,
CurvyClamping  clamping,
float  length 
)
static

Clamps absolute position

static float ClampDistance ( float  distance,
CurvyClamping  clamping,
float  length,
float  min,
float  max 
)
static

Clamps absolute position

static float ClampDistance ( float  distance,
ref int  dir,
CurvyClamping  clamping,
float  length 
)
static

Clamps absolute position and sets new direction

static float ClampDistance ( float  distance,
ref int  dir,
CurvyClamping  clamping,
float  length,
float  min,
float  max 
)
static

Clamps absolute position and sets new direction

static float ClampTF ( float  tf,
CurvyClamping  clamping 
)
static

Clamps relative position

static float ClampTF ( float  tf,
ref int  dir,
CurvyClamping  clamping 
)
static

Clamps relative position and sets new direction

static float ClampValue ( float  tf,
CurvyClamping  clamping,
float  minTF,
float  maxTF 
)
static

Clamps a float to a range

static Material GetDefaultMaterial ( )
static

Gets the default material, i.e. Curvy/Resources/CurvyDefaultMaterial

static void GetNearestPointIndex ( Vector3  point,
Vector3[]  points,
int  pointsCount,
out int  index,
out float  fragement 
)
static

Given an input point, gets the index of the point in the array that is closest to the input point.

Parameters
pointthe input point
pointsA list of points to test against
pointsCountThe number of points to test against
indexthe index of the closest point
fragementa value between 0 and 1 indicating how close the input point is close to the point of index: index + 1
static int InterpolationSearch ( float[]  array,
float  x 
)
static

Finds the index of x in an array of sorted values (ascendant order). If x not found, the closest smaller value's index is returned if any, -1 otherwise

Parameters
arrayThe array to search into
xThe element to search for
static int InterpolationSearch ( float[]  array,
int  elementsCount,
float  x 
)
static

Finds the index of x in an array of sorted values (ascendant order). If x not found, the closest smaller value's index is returned if any, -1 otherwise

Parameters
arrayThe array to search into
elementsCountThe number of elements of the array to search into
xThe element to search for
static Mesh SplineToMesh ( this CurvySpline  spline)
static

Returns a mesh which boundaries are the input spline, similarly to what the Spline To Mesh window does, but simpler and less configurable.


The documentation for this class was generated from the following file: