cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Grid3D Class Reference

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

#include <CCGrid.h>

Inheritance diagram for Grid3D:
GridBase Ref

Public Member Functions

 Grid3D ()
 ctor More...
 
 ~Grid3D (void)
 NA NA More...
 
Vec3 getVertex (const Vec2 &pos) const
 returns the vertex at a given position NA NA More...
 
Vec3 vertex (const Vec2 &pos) const
 
Vec3 getOriginalVertex (const Vec2 &pos) const
 returns the original (non-transformed) vertex at a given position NA NA More...
 
Vec3 originalVertex (const Vec2 &pos) const
 
void setVertex (const Vec2 &pos, const Vec3 &vertex)
 sets a new vertex at a given position NA NA More...
 
virtual void beforeBlit () override
 
virtual void afterBlit () override
 
virtual void blit () override
 
virtual void reuse () override
 
virtual void calculateVertexPoints () override
 
void setNeedDepthTestForBlit (bool neededDepthTest)
 
bool getNeedDepthTestForBlit () const
 
- Public Member Functions inherited from GridBase
virtual ~GridBase (void)
 NA NA More...
 
bool initWithSize (const Size &gridSize, Texture2D *texture, bool flipped)
 
bool initWithSize (const Size &gridSize)
 
bool isActive (void) const
 whether or not the grid is active More...
 
void setActive (bool active)
 
int getReuseGrid (void) const
 number of times that the grid will be reused More...
 
void setReuseGrid (int reuseGrid)
 
const SizegetGridSize (void) const
 size of the grid More...
 
void setGridSize (const Size &gridSize)
 
const Vec2getStep (void) const
 pixels between the grids More...
 
void setStep (const Vec2 &step)
 
bool isTextureFlipped (void) const
 is texture flipped More...
 
void setTextureFlipped (bool flipped)
 
void beforeDraw (void)
 
void afterDraw (Node *target)
 
void set2DProjection (void)
 
- 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 ()
 NA NA More...
 

Static Public Member Functions

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

Protected Attributes

GLvoid * _texCoordinates
 
GLvoid * _vertices
 
GLvoid * _originalVertices
 
GLushort * _indices
 
bool _needDepthTestForBlit
 
bool _oldDepthTestValue
 
- Protected Attributes inherited from GridBase
bool _active
 
int _reuseGrid
 
Size _gridSize
 
Texture2D_texture
 
Vec2 _step
 
Grabber_grabber
 
bool _isTextureFlipped
 
GLProgram_shaderProgram
 
Director::Projection _directorProjection
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Detailed Description

Grid3D is a 3D grid implementation.

Each vertex has 3 dimensions: x,y,z

Constructor & Destructor Documentation

Grid3D ( )

ctor

~Grid3D ( void  )

NA NA

Member Function Documentation

virtual void afterBlit ( )
overridevirtual

Reimplemented from GridBase.

virtual void beforeBlit ( )
overridevirtual

Reimplemented from GridBase.

virtual void blit ( )
overridevirtual

Reimplemented from GridBase.

virtual void calculateVertexPoints ( )
overridevirtual

Reimplemented from GridBase.

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

create one Grid

static Grid3D* create ( const Size gridSize)
static

create one Grid

bool getNeedDepthTestForBlit ( ) const
inline
Vec3 getOriginalVertex ( const Vec2 pos) const

returns the original (non-transformed) vertex at a given position NA NA

Vec3 getVertex ( const Vec2 pos) const

returns the vertex at a given position NA NA

Vec3 originalVertex ( const Vec2 pos) const
inline
Deprecated:
Use getOriginalVertex() instead NA NA
virtual void reuse ( )
overridevirtual

Reimplemented from GridBase.

void setNeedDepthTestForBlit ( bool  neededDepthTest)
inline
void setVertex ( const Vec2 pos,
const Vec3 vertex 
)

sets a new vertex at a given position NA NA

Vec3 vertex ( const Vec2 pos) const
inline
Deprecated:
Use getVertex() instead NA NA

Member Data Documentation

GLushort* _indices
protected
bool _needDepthTestForBlit
protected
bool _oldDepthTestValue
protected
GLvoid* _originalVertices
protected
GLvoid* _texCoordinates
protected
GLvoid* _vertices
protected

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