AR + GPS Location  3.0.0
All Classes Namespaces Functions Variables Properties Events Pages
ARLocation.CatmullRomSpline Class Reference

A (open-ended) catmull-rom spline, which interpolates a set points by joining catmull-rom curves together. More...

Inheritance diagram for ARLocation.CatmullRomSpline:
ARLocation.Spline

Public Member Functions

 CatmullRomSpline (Vector3[] points, int n, float alpha)
 Creates a new Catmull-rom spline. More...
 
sealed override void CalculateSegments (int n)
 Calculate the catmull-rom segments. Also estimates the curve's length. More...
 
- Public Member Functions inherited from ARLocation.Spline
Vector3 GetPointAtArcLength (float s)
 Returns the point of the spline at a given arc-length. More...
 
CurvePointData GetPointAndTangentAtArcLength (float s)
 Returns a CurvePointData whith the point and tangent of the spline at a given arc-length. More...
 
void DrawCurveWithLineRenderer (LineRenderer renderer, System.Func< Vector3, Vector3 > func, int n=100)
 Draws the curve using a given LineRenderer, with points being processed by a given function beforehand. More...
 
Vector3[] SamplePoints (int n, System.Func< Vector3, Vector3 > func)
 Calculates a sample of (N+2) equidistant points along the spline. More...
 
Vector3[] SamplePoints (int n)
 Calculates a sample of (N+2) equidistant points along the spline. More...
 
void DrawGizmos ()
 Draw the curve and sample point using Gizmos. More...
 

Properties

float Alpha [get, set]
 The alpha/tension parameter of the spline. More...
 
- Properties inherited from ARLocation.Spline
Vector3[] Points [get, protected set]
 The points interpolated of the spline. More...
 
float Length [get, protected set]
 The full (estimated) length of the spline. More...
 

Additional Inherited Members

- Protected Attributes inherited from ARLocation.Spline
Curve[] segments
 The CatmullRom curve-segments of the spline. More...
 
int segmentCount = 0
 The number of segments that make up the spline. More...
 
float[] lengths
 

Detailed Description

A (open-ended) catmull-rom spline, which interpolates a set points by joining catmull-rom curves together.

Definition at line 10 of file CatmullRomSpline.cs.

Constructor & Destructor Documentation

◆ CatmullRomSpline()

ARLocation.CatmullRomSpline.CatmullRomSpline ( Vector3[]  points,
int  n,
float  alpha 
)

Creates a new Catmull-rom spline.

Parameters
pointsThe interpolated points.
nThe number of samples used in each segment of the spline.
alpha

Definition at line 48 of file CatmullRomSpline.cs.

Member Function Documentation

◆ CalculateSegments()

sealed override void ARLocation.CatmullRomSpline.CalculateSegments ( int  n)
virtual

Calculate the catmull-rom segments. Also estimates the curve's length.

Parameters
nThe number sample points used to estimate each segment's length.

Implements ARLocation.Spline.

Definition at line 60 of file CatmullRomSpline.cs.

Property Documentation

◆ Alpha

float ARLocation.CatmullRomSpline.Alpha
getset

The alpha/tension parameter of the spline.

Definition at line 26 of file CatmullRomSpline.cs.


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