Cocos2d-x  v3.10
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Grid3D Class Reference

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

Inherits GridBase.

Public Member Functions

 Grid3D ()
 Constructor.
 
 ~Grid3D (void)
 Destructor.
 
Vec3 getVertex (const Vec2 &pos) const
 Returns the vertex at a given position.
 
Vec3 vertex (const Vec2 &pos) const
Vec3 getOriginalVertex (const Vec2 &pos) const
 Returns the original (non-transformed) vertex at a given position.
 
Vec3 originalVertex (const Vec2 &pos) const
void setVertex (const Vec2 &pos, const Vec3 &vertex)
 Sets a new vertex at a given position.
 
virtual void beforeBlit () override
 Implementations for interfaces in base calss.
 
virtual void afterBlit () override
 Interface for custom action when after blit.
 
virtual void blit () override
 Used to blit the texture with grid to screen.
 
virtual void reuse () override
 Reuse the grid vertices.
 
virtual void calculateVertexPoints () override
 Calculate the vertices used for the blit.
 
void setNeedDepthTestForBlit (bool neededDepthTest)
 Set the depth test state when blit.
 
bool getNeedDepthTestForBlit () const
 Get the depth test state when blit. More...
 
- Public Member Functions inherited from GridBase
virtual ~GridBase (void)
 Destructor.
 
bool initWithSize (const Size &gridSize)
 Init the Grid base. More...
 
bool isActive (void) const
 Get the active state of grid. More...
 
void setActive (bool active)
 Set the active state of grid. More...
 
int getReuseGrid (void) 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 SizegetGridSize (void) const
 Get the size of the grid.
 
void setGridSize (const Size &gridSize)
 Set the size of the grid.
 
const Vec2getStep (void) const
 Pixels between the grids.
 
void setStep (const Vec2 &step)
 Get the pixels between the grids.
 
bool isTextureFlipped (void) const
 is texture flipped.
 
void setTextureFlipped (bool flipped)
 Set the texture flipped or not.
 
void beforeDraw (void)
 Init and reset the Grid status before draw.
 
void afterDraw (Node *target)
 Init and reset the Grid status before draw. More...
 
void set2DProjection (void)
 Change projection to 2D for grabbing.
 
void setGridRect (const Rect &rect)
 Set the effect grid rect. More...
 
const RectgetGridRect () const
 Get the effect grid rect. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static Grid3Dcreate (const Size &gridSize)
 create one Grid The grid size The texture pointer. More...
 
- Static Public Member Functions inherited from GridBase
static GridBasecreate (const Size &gridSize, Texture2D *texture, bool flipped)
 create one Grid The grid size The texture pointer. More...
 
static GridBasecreate (const Size &gridSize)
 create one Grid The gride size. More...
 

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.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

Grid3D is a 3D grid implementation.

Each vertex has 3 dimensions: x,y,z

Member Function Documentation

static Grid3D* create ( const Size gridSize)
static

create one Grid The grid size The texture pointer.

Whether texture flipped or not. A Grid3D instance.

Vec3 vertex ( const Vec2 pos) const
inline
Vec3 originalVertex ( const Vec2 pos) const
inline
bool getNeedDepthTestForBlit ( ) const
inline

Get the depth test state when blit.

Return true if depth test is enabled, false otherwise.


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