AR + GPS Location  3.0.0
All Classes Namespaces Functions Variables Properties Events Pages
ARLocation.Spline Class Referenceabstract
Inheritance diagram for ARLocation.Spline:
ARLocation.CatmullRomSpline ARLocation.LinearSpline

Public Member Functions

abstract void CalculateSegments (int n)
 Calculate the catmull-rom segments. Also estimates the curve's length. More...
 
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...
 

Protected Attributes

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
 

Properties

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...
 

Detailed Description

Definition at line 12 of file Spline.cs.

Member Function Documentation

◆ CalculateSegments()

abstract void ARLocation.Spline.CalculateSegments ( int  n)
pure virtual

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

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

Implemented in ARLocation.LinearSpline, and ARLocation.CatmullRomSpline.

◆ DrawCurveWithLineRenderer()

void ARLocation.Spline.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.

Parameters
renderer
func
n

Definition at line 91 of file Spline.cs.

◆ DrawGizmos()

void ARLocation.Spline.DrawGizmos ( )

Draw the curve and sample point using Gizmos.

Definition at line 142 of file Spline.cs.

◆ GetPointAndTangentAtArcLength()

CurvePointData ARLocation.Spline.GetPointAndTangentAtArcLength ( float  s)

Returns a CurvePointData whith the point and tangent of the spline at a given arc-length.

Parameters
sThe arc-length.
Returns

Definition at line 69 of file Spline.cs.

◆ GetPointAtArcLength()

Vector3 ARLocation.Spline.GetPointAtArcLength ( float  s)

Returns the point of the spline at a given arc-length.

Parameters
sThe arc-length.
Returns

Definition at line 48 of file Spline.cs.

◆ SamplePoints() [1/2]

Vector3 [] ARLocation.Spline.SamplePoints ( int  n)

Calculates a sample of (N+2) equidistant points along the spline.

Parameters
nThe number of points in the sample will be (N+2).
Returns

Definition at line 134 of file Spline.cs.

◆ SamplePoints() [2/2]

Vector3 [] ARLocation.Spline.SamplePoints ( int  n,
System.Func< Vector3, Vector3 >  func 
)

Calculates a sample of (N+2) equidistant points along the spline.

Parameters
nThe number of points in the sample will be (N+2).
funcA function that can be used to transform the sampled poins.
Returns

Definition at line 114 of file Spline.cs.

Member Data Documentation

◆ segmentCount

int ARLocation.Spline.segmentCount = 0
protected

The number of segments that make up the spline.

Definition at line 28 of file Spline.cs.

◆ segments

Curve [] ARLocation.Spline.segments
protected

The CatmullRom curve-segments of the spline.

Definition at line 23 of file Spline.cs.

Property Documentation

◆ Length

float ARLocation.Spline.Length
getprotected set

The full (estimated) length of the spline.

Definition at line 33 of file Spline.cs.

◆ Points

Vector3 [] ARLocation.Spline.Points
getprotected set

The points interpolated of the spline.

Definition at line 18 of file Spline.cs.


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