Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
RotateTo Class Reference

Rotates a Node object to a certain angle by modifying it's rotation attribute. More...

#include <ActionInterval.h>

Inherits ActionInterval.

Public Member Functions

virtual void update (float time) override
 
bool initWithDuration (float duration, float dstAngleX, float dstAngleY)
 initializes the action
 
bool initWithDuration (float duration, const Vec3 &dstAngle3D)
 initializes the action
 
void calculateAngles (float &startAngle, float &diffAngle, float dstAngle)
 calculates the start and diff angles
 
- 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.
 
virtual void step (float dt) override
 
bool initWithDuration (float d)
 initializes the action
 

Static Public Member Functions

static RotateTocreate (float duration, float dstAngleX, float dstAngleY)
 Creates the action with separate rotation angles.
 
static RotateTocreate (float duration, float dstAngle)
 Creates the action.
 
static RotateTocreate (float duration, const Vec3 &dstAngle3D)
 Creates the action with 3D rotation angles.
 

Detailed Description

Rotates a Node object to a certain angle by modifying it's rotation attribute.

The direction will be decided by the shortest angle.

Member Function Documentation

◆ create() [1/3]

static RotateTo * create ( float duration,
float dstAngleX,
float dstAngleY )
static

Creates the action with separate rotation angles.

Parameters
durationDuration time, in seconds.
dstAngleXIn degreesCW.
dstAngleYIn degreesCW.
Returns
An autoreleased RotateTo object.

◆ create() [2/3]

static RotateTo * create ( float duration,
float dstAngle )
static

Creates the action.

Parameters
durationDuration time, in seconds.
dstAngleIn degreesCW.
Returns
An autoreleased RotateTo object.

◆ create() [3/3]

static RotateTo * create ( float duration,
const Vec3 & dstAngle3D )
static

Creates the action with 3D rotation angles.

Parameters
durationDuration time, in seconds.
dstAngle3DA Vec3 angle.
Returns
An autoreleased RotateTo object.

◆ update()

virtual void update ( float time)
overridevirtual
Parameters
timeIn seconds.

◆ initWithDuration() [1/2]

bool initWithDuration ( float duration,
float dstAngleX,
float dstAngleY )

initializes the action

Parameters
durationin seconds
dstAngleXin degreesCW
dstAngleYin degreesCW

◆ initWithDuration() [2/2]

bool initWithDuration ( float duration,
const Vec3 & dstAngle3D )

initializes the action

Parameters
durationin seconds

◆ calculateAngles()

void calculateAngles ( float & startAngle,
float & diffAngle,
float dstAngle )

calculates the start and diff angles

Parameters
dstAnglein degreesCW

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