CUGL 3.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
cugl::scene2::RotateBy Class Reference

#include <CUTransformAction2.h>

Public Member Functions

 RotateBy ()
 
 ~RotateBy ()
 
void dispose ()
 
bool init ()
 
bool init (float delta)
 
float getDelta () const
 
void setDelta (float delta)
 
ActionFunction attach (const std::shared_ptr< scene2::SceneNode > &node)
 

Static Public Member Functions

static std::shared_ptr< RotateByalloc ()
 
static std::shared_ptr< RotateByalloc (float delta)
 

Detailed Description

This factory creates an action rotating by a given angle amount.

The angle is measured in radians, counter-clockwise from the x-axis.

This class is actually a factory for creating movement actions. To create an action, call attach with the appropriate SceneNode. Note that this class contains no duration information. That is supplied when the action is added to ActionTimeline.

Constructor & Destructor Documentation

◆ RotateBy()

cugl::scene2::RotateBy::RotateBy ( )
inline

Creates an uninitialized rotation animation.

NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an object on the heap, use one of the static constructors instead.

◆ ~RotateBy()

cugl::scene2::RotateBy::~RotateBy ( )
inline

Deletes this animation, disposing all resources

Member Function Documentation

◆ alloc() [1/2]

static std::shared_ptr< RotateBy > cugl::scene2::RotateBy::alloc ( )
inlinestatic

Returns a newly allocated, degenerate rotation animation.

The rotation amount is set to 0.0, meaning no rotation takes place.

Returns
a newly allocated, degenerate rotation animation.

◆ alloc() [2/2]

static std::shared_ptr< RotateBy > cugl::scene2::RotateBy::alloc ( float  delta)
inlinestatic

Returns a newly allocated rotation animation of the given angle.

When animated, this action will rotate its target by the given delta. The angle is measured in radians, counter-clockwise from the x-axis.

Parameters
deltaThe amount to rotate the target node
Returns
a newly allocated rotation animation of the given angle.

◆ attach()

ActionFunction cugl::scene2::RotateBy::attach ( const std::shared_ptr< scene2::SceneNode > &  node)

Returns an action attaching this animation to the given scene node

This action will reference this object during the animation. Any changes to this object during that time may alter the animation.

Note that the action has no associated duration. That should be set when it is added to ActionTimeline.

Parameters
nodeThe node to attach
Returns
an action attaching this animation to the given scene node

◆ dispose()

void cugl::scene2::RotateBy::dispose ( )
inline

Disposes all of the resources used by this animation.

A disposed animation can be safely reinitialized.

◆ getDelta()

float cugl::scene2::RotateBy::getDelta ( ) const
inline

Returns the rotation delta for this action.

Changing this value for an actively animating action can have undefined side effects.

Returns
the rotation delta for this action.

◆ init() [1/2]

bool cugl::scene2::RotateBy::init ( )
inline

Initializes a degenerate rotation animation.

The rotation amount is set to 0.0, meaning no rotation takes place.

Returns
true if initialization was successful.

◆ init() [2/2]

bool cugl::scene2::RotateBy::init ( float  delta)

Initializes a rotation animation of the given angle.

When animated, this action will rotate its target by the given delta. The angle is measured in radians, counter-clockwise from the x-axis.

Parameters
deltaThe amount to rotate the target node
Returns
true if initialization was successful.

◆ setDelta()

void cugl::scene2::RotateBy::setDelta ( float  delta)
inline

Sets the rotation delta for this action.

Changing this value for an actively animating action can have undefined side effects.

Parameters
deltathe rotation delta for this action.

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