RavEngine
Loading...
Searching...
No Matches
physx::vehicle2::PxVehicleFixedSizeLookupTable< T, NB_ELEMENTS > Class Template Reference

Express a function as a sequence of points {(x, y)} that form a piecewise polynomial. More...

#include <PxVehicleParams.h>

Public Member Functions

 PxVehicleFixedSizeLookupTable (const PxVehicleFixedSizeLookupTable &src)
 
PxVehicleFixedSizeLookupTable & operator= (const PxVehicleFixedSizeLookupTable &src)
 
PX_FORCE_INLINE bool addPair (const PxReal x, const T y)
 Add one more point to create one more polynomial segment of a piecewise polynomial.
 
PX_FORCE_INLINE T interpolate (const PxReal x) const
 Identify the segment of the piecewise polynomial that includes x and compute the corresponding y value by linearly interpolating the gradient of the segment.
 
void clear ()
 
PX_FORCE_INLINE bool isValid () const
 

Public Attributes

PxReal xVals [NB_ELEMENTS]
 
T yVals [NB_ELEMENTS]
 
PxU32 nbDataPairs
 

Detailed Description

template<class T, unsigned int NB_ELEMENTS>
class physx::vehicle2::PxVehicleFixedSizeLookupTable< T, NB_ELEMENTS >

Express a function as a sequence of points {(x, y)} that form a piecewise polynomial.

Member Function Documentation

◆ interpolate()

template<class T , unsigned int NB_ELEMENTS>
PX_FORCE_INLINE T physx::vehicle2::PxVehicleFixedSizeLookupTable< T, NB_ELEMENTS >::interpolate ( const PxReal  x) const
inline

Identify the segment of the piecewise polynomial that includes x and compute the corresponding y value by linearly interpolating the gradient of the segment.

Parameters
[in]xis the value on the x-axis of the piecewise polynomial.
Returns
Returns the y value that corresponds to the input x.

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