Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
LinearCurve Class Reference

#include <LinearCurve.h>

Classes

class  Point
 A point on the curve. More...
 

Public Types

using Points = Array< Point >
 The points on the curve, should be sorted ascending by x. More...
 

Public Member Functions

void Clear ()
 Remove all points. More...
 
void Reserve (uint inNumPoints)
 Reserve memory for inNumPoints points. More...
 
void AddPoint (float inX, float inY)
 
void Sort ()
 Sort the points on X ascending. More...
 
float GetMinX () const
 Get the lowest X value. More...
 
float GetMaxX () const
 Get the highest X value. More...
 
float GetValue (float inX) const
 
void SaveBinaryState (StreamOut &inStream) const
 Saves the state of this object in binary form to inStream. More...
 
void RestoreBinaryState (StreamIn &inStream)
 Restore the state of this object from inStream. More...
 

Public Attributes

Points mPoints
 

Member Typedef Documentation

◆ Points

The points on the curve, should be sorted ascending by x.

Member Function Documentation

◆ AddPoint()

void LinearCurve::AddPoint ( float  inX,
float  inY 
)
inline

Add a point to the curve. Points must be inserted in ascending X or Sort() needs to be called when all points have been added.

Parameters
inXX value
inYY value

◆ Clear()

void LinearCurve::Clear ( )
inline

Remove all points.

◆ GetMaxX()

float LinearCurve::GetMaxX ( ) const
inline

Get the highest X value.

◆ GetMinX()

float LinearCurve::GetMinX ( ) const
inline

Get the lowest X value.

◆ GetValue()

float LinearCurve::GetValue ( float  inX) const

Sample value on the curve

Parameters
inXX value to sample at
Returns
Interpolated Y value

◆ Reserve()

void LinearCurve::Reserve ( uint  inNumPoints)
inline

Reserve memory for inNumPoints points.

◆ RestoreBinaryState()

void LinearCurve::RestoreBinaryState ( StreamIn inStream)

Restore the state of this object from inStream.

◆ SaveBinaryState()

void LinearCurve::SaveBinaryState ( StreamOut inStream) const

Saves the state of this object in binary form to inStream.

◆ Sort()

void LinearCurve::Sort ( )
inline

Sort the points on X ascending.

Member Data Documentation

◆ mPoints

Points LinearCurve::mPoints

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