TrackFlow Pro Documentation 1
Generate roller coasters, railroads, conveyors and more with a physics aware spline and meshing system.
Loading...
Searching...
No Matches
TrackFlowPro.Runtime.Helpers Class Reference

Some math helpers. This also has some conversions between native system types and Unity types. More...

Static Public Member Functions

static float SmoothStep01 (float t)
static Quaternion QFromTNB (double[,] R)
 Quaternion representing an orthonormal T/N/B frame (cols 0/1/2).
static void SetTNB (double[,] R, in Quaternion q)
 Write T/N/B columns from a quaternion (x→T, y→N, z→B).
static Vector3 ToV3 (double[] p)
static Vector3 ProjPlane (Vector3 v, Vector3 n)
static float SignedAngleAroundAxis (Vector3 from, Vector3 to, Vector3 axis)
static void RotateNBAboutT (double[,] R, float theta)
static float[] SmoothData (float[] data, int windowLength, bool isClosed, out float minSmoothedValue, out float maxSmoothedValue)
 Perform moving average smoothing on data.
static Bounds CalculateBounds (GameObject ObjectToInstantiate)
 Calculate the bounds of a GameObject in local space. Checks for colliders or mesh bounds.

Static Private Member Functions

static int GetIndex (int idx, int n, bool isClosed)

Detailed Description

Some math helpers. This also has some conversions between native system types and Unity types.

Member Function Documentation

◆ CalculateBounds()

Bounds TrackFlowPro.Runtime.Helpers.CalculateBounds ( GameObject ObjectToInstantiate)
static

Calculate the bounds of a GameObject in local space. Checks for colliders or mesh bounds.

Parameters
ObjectToInstantiate
Returns

◆ GetIndex()

int TrackFlowPro.Runtime.Helpers.GetIndex ( int idx,
int n,
bool isClosed )
staticprivate

◆ ProjPlane()

Vector3 TrackFlowPro.Runtime.Helpers.ProjPlane ( Vector3 v,
Vector3 n )
static

◆ QFromTNB()

Quaternion TrackFlowPro.Runtime.Helpers.QFromTNB ( double R[,])
static

Quaternion representing an orthonormal T/N/B frame (cols 0/1/2).

TODO: This is redundant with ArcFrameBridge methods, choose one, the other shall perish.

◆ RotateNBAboutT()

void TrackFlowPro.Runtime.Helpers.RotateNBAboutT ( double R[,],
float theta )
static

◆ SetTNB()

void TrackFlowPro.Runtime.Helpers.SetTNB ( double R[,],
in Quaternion q )
static

Write T/N/B columns from a quaternion (x→T, y→N, z→B).

◆ SignedAngleAroundAxis()

float TrackFlowPro.Runtime.Helpers.SignedAngleAroundAxis ( Vector3 from,
Vector3 to,
Vector3 axis )
static

◆ SmoothData()

float[] TrackFlowPro.Runtime.Helpers.SmoothData ( float[] data,
int windowLength,
bool isClosed,
out float minSmoothedValue,
out float maxSmoothedValue )
static

Perform moving average smoothing on data.

Parameters
data
windowLength
isClosed
Returns

◆ SmoothStep01()

float TrackFlowPro.Runtime.Helpers.SmoothStep01 ( float t)
static

◆ ToV3()

Vector3 TrackFlowPro.Runtime.Helpers.ToV3 ( double[] p)
static

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