Cocos2d-x  4.0.0
Public Member Functions | Static Public Member Functions | List of all members
Grid3D Class Reference

Grid3D is a 3D grid implementation. More...

Inherits GridBase.

Public Member Functions

 Grid3D ()
 Constructor.
 
 ~Grid3D ()
 Destructor.
 
Vec3 getVertex (const Vec2 &pos) const
 Returns the vertex at a given position.
 
Vec3 getOriginalVertex (const Vec2 &pos) const
 Returns the original (non-transformed) vertex at a given position.
 
void setVertex (const Vec2 &pos, const Vec3 &vertex)
 Sets a new vertex at a given position.
 
virtual void beforeBlit () override
 
virtual void blit () override
 Interface used to blit the texture with grid to screen.
 
virtual void reuse () override
 Interface, Reuse the grid vertices.
 
virtual void calculateVertexPoints () override
 Interface, Calculate the vertices used for the blit.
 
void setNeedDepthTestForBlit (bool neededDepthTest)
 
- Public Member Functions inherited from GridBase
virtual ~GridBase ()
 Destructor.
 
int getReuseGrid () const
 Get number of times that the grid will be reused.
 
void setReuseGrid (int reuseGrid)
 Set number of times that the grid will be reused.
 
const Size & getGridSize () const
 Size of the grid.
 
void setGridSize (const Size &gridSize)
 Set the size of the grid.
 
const Vec2getStep () const
 Pixels between the grids.
 
void setStep (const Vec2 &step)
 Get the pixels between the grids.
 
bool isTextureFlipped () const
 is texture flipped.
 
void setTextureFlipped (bool flipped)
 Set the texture flipped or not.
 
void set2DProjection ()
 Change projection to 2D for grabbing.
 
void setGridRect (const Rect &rect)
 Set the effect grid rect.
 
const RectgetGridRect () const
 Get the effect grid rect.
 
bool initWithSize (const Size &gridSize)
 
bool isActive () const
 
void beforeDraw ()
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership.
 
void release ()
 Releases the ownership immediately.
 
Refautorelease ()
 Releases the ownership sometime soon automatically.
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count.
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static Grid3Dcreate (const Size &gridSize)
 create one Grid.
 
static Grid3Dcreate (const Size &gridSize, const Rect &rect)
 create one Grid.
 
static Grid3Dcreate (const Size &gridSize, Texture2D *texture, bool flipped)
 create one Grid.
 
static Grid3Dcreate (const Size &gridSize, Texture2D *texture, bool flipped, const Rect &rect)
 create one Grid.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Grid3D is a 3D grid implementation.

Each vertex has 3 dimensions: x,y,z

Constructor & Destructor Documentation

Grid3D ( )

Constructor.

ctor

~Grid3D ( )

Destructor.

NA NA

Member Function Documentation

static Grid3D* create ( const Size &  gridSize)
static

create one Grid.

static Grid3D* create ( const Size &  gridSize,
const Rect rect 
)
static

create one Grid.

static Grid3D* create ( const Size &  gridSize,
Texture2D texture,
bool  flipped 
)
static

create one Grid.

static Grid3D* create ( const Size &  gridSize,
Texture2D texture,
bool  flipped,
const Rect rect 
)
static

create one Grid.

Vec3 getVertex ( const Vec2 pos) const

Returns the vertex at a given position.

NA NA

Vec3 getOriginalVertex ( const Vec2 pos) const

Returns the original (non-transformed) vertex at a given position.

NA NA

void setVertex ( const Vec2 pos,
const Vec3 vertex 
)

Sets a new vertex at a given position.

NA

virtual void beforeBlit ( )
overridevirtual

Implementations for interfaces in base class.

Reimplemented from GridBase.

virtual void blit ( )
overridevirtual

Interface used to blit the texture with grid to screen.

Implements GridBase.

virtual void reuse ( )
overridevirtual

Interface, Reuse the grid vertices.

Implements GridBase.

virtual void calculateVertexPoints ( )
overridevirtual

Interface, Calculate the vertices used for the blit.

Implements GridBase.

void setNeedDepthTestForBlit ( bool  neededDepthTest)
inline

Getter and Setter for depth test state when blit. NA


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