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

Lens3D action. More...

#include <ActionGrid3D.h>

Inherits Grid3DAction.

Public Member Functions

float getLensEffect () const
 Get the value of lens effect.
 
void setLensEffect (float lensEffect)
 Set the value of lens effect.
 
void setConcave (bool concave)
 Set whether lens is concave.
 
const Vec2getPosition () const
 Get the center position of lens effect.
 
void setPosition (const Vec2 &position)
 Set the center position of lens effect.
 
bool initWithDuration (float duration, const Vec2 &gridSize, const Vec2 &position, float radius)
 Initializes the action with center position, radius, grid size and duration.
 
- Public Member Functions inherited from Grid3DAction
virtual GridBasegetGrid () override
 Get the pointer of GridBase.
 
Vec3 getVertex (const Vec2 &position) const
 Get the vertex that belongs to certain position in the grid.
 
Vec3 getOriginalVertex (const Vec2 &position) const
 Get the non-transformed vertex that belongs to certain position in the grid.
 
void setVertex (const Vec2 &position, const Vec3 &vertex)
 Set a new vertex to a certain position of the grid.
 
Rect getGridRect () const
 Get the effect grid rect.
 
- Public Member Functions inherited from GridAction
bool initWithDuration (float duration, const Vec2 &gridSize)
 Initializes the action with size and duration.
 
- 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 Lens3Dcreate (float duration, const Vec2 &gridSize, const Vec2 &position, float radius)
 Create the action with center position, radius, a grid size and duration.
 

Detailed Description

Lens3D action.

This action is used for take effect on the target node as lens. You can create the action by these parameters: duration, grid size, center position of lens, radius of lens. Also you can change the lens effect value & whether effect is concave by the setter methods.

Member Function Documentation

◆ create()

static Lens3D * create ( float duration,
const Vec2 & gridSize,
const Vec2 & position,
float radius )
static

Create the action with center position, radius, a grid size and duration.

Parameters
durationSpecify the duration of the Lens3D action. It's a value in seconds.
gridSizeSpecify the size of the grid.
positionSpecify the center position of the lens.
radiusSpecify the radius of the lens.
Returns
If the creation success, return a pointer of Lens3D action; otherwise, return nil.

◆ getLensEffect()

float getLensEffect ( ) const
inline

Get the value of lens effect.

Default value is 0.7.

Returns
The value of lens effect.

◆ setLensEffect()

void setLensEffect ( float lensEffect)
inline

Set the value of lens effect.

Parameters
lensEffectThe value of lens effect will be set.

◆ setConcave()

void setConcave ( bool concave)
inline

Set whether lens is concave.

Parameters
concaveWhether lens is concave.

◆ getPosition()

const Vec2 & getPosition ( ) const
inline

Get the center position of lens effect.

Returns
The center position of lens effect.

◆ setPosition()

void setPosition ( const Vec2 & position)

Set the center position of lens effect.

Parameters
positionThe center position will be set.

◆ initWithDuration()

bool initWithDuration ( float duration,
const Vec2 & gridSize,
const Vec2 & position,
float radius )

Initializes the action with center position, radius, grid size and duration.

Parameters
durationSpecify the duration of the Lens3D action. It's a value in seconds.
gridSizeSpecify the size of the grid.
positionSpecify the center position of the lens effect.
radiusSpecify the radius of the lens effect.
Returns
If the initialization success, return true; otherwise, return false.

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