⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.

Axmol Engine 3.0.0-dff292a
Loading...
Searching...
No Matches
CatmullRomTo Class Reference

An action that moves the target with a CatmullRom curve to a destination point. More...

#include <ActionCatmullRom.h>

Inherits CardinalSplineTo.

Public Member Functions

bool initWithDuration (float dt, PointArray *points)
 Initializes the action with a duration and an array of points.
Public Member Functions inherited from CardinalSplineTo
virtual ~CardinalSplineTo ()
 @lua NA
 CardinalSplineTo ()
 @lua NA
bool initWithDuration (float duration, PointArray *points, float tension)
 Initializes the action with a duration and an array of points.
virtual void updatePosition (const Vec2 &newPos)
 It will update the target position and change the _previousPosition to newPos.
PointArraygetPoints ()
 Return a PointArray.
void setPoints (PointArray *points)
 @lua NA
void update (float time) override
Public Member Functions inherited from ActionInterval
float getElapsed ()
 How many seconds had elapsed since the actions started to run.
void setAmplitudeRate (float amp)
 Sets the amplitude rate, extension in GridAction.
float getAmplitudeRate ()
 Gets the amplitude rate, extension in GridAction.
void step (float dt) override
bool initWithDuration (float d)
 initializes the action

Static Public Member Functions

static CatmullRomTocreate (float dt, PointArray *points)
 Creates an action with a Cardinal Spline array of points and tension.
Static Public Member Functions inherited from CardinalSplineTo
static CardinalSplineTocreate (float duration, PointArray *points, float tension)
 Creates an action with a Cardinal Spline array of points and tension.

Detailed Description

An action that moves the target with a CatmullRom curve to a destination point.

A Catmull Rom is a Cardinal Spline with a tension of 0.5. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline

Member Function Documentation

◆ create()

CatmullRomTo * create ( float dt,
PointArray * points )
static

Creates an action with a Cardinal Spline array of points and tension.

Parameters
dtIn seconds.
pointsAn PointArray.
When this function bound to js or lua,the input params are changed.
In js: var create(var dt,var table).
In lua: local create(local dt, local table).
static CatmullRomTo * create(float dt, PointArray *points)
Creates an action with a Cardinal Spline array of points and tension.

◆ initWithDuration()

bool initWithDuration ( float dt,
PointArray * points )

Initializes the action with a duration and an array of points.

Parameters
dtIn seconds.
pointsAn PointArray.

The documentation for this class was generated from the following file:
  • ActionCatmullRom.h