cocos2d-x  3.5
 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 ()
 Constructor. More...
 
 ctor ()
 Constructor. More...
 
 Grid3D ()
 Constructor. More...
 
 ~Grid3D (void)
 Destructor. More...
 
Vec3 getVertex (const Vec2 &pos) const
 Returns the vertex at a given position. More...
 
Vec3 vertex (const Vec2 &pos) const
Vec3 getOriginalVertex (const Vec2 &pos) const
 Returns the original (non-transformed) vertex at a given position. More...
 
Vec3 originalVertex (const Vec2 &pos) const
void setVertex (const Vec2 &pos, const Vec3 &vertex)
 Sets a new vertex at a given position. More...
 
virtual void beforeBlit () override
var beforeBlit ()
local beforeBlit ()
virtual void afterBlit () override
var afterBlit ()
local afterBlit ()
virtual void blit () override
 Interface used to blit the texture with grid to screen. More...
 
var blit ()
 Interface used to blit the texture with grid to screen. More...
 
local blit ()
 Interface used to blit the texture with grid to screen. More...
 
virtual void reuse () override
 Interface, Reuse the grid vertices. More...
 
var reuse ()
 Interface, Reuse the grid vertices. More...
 
local reuse ()
 Interface, Reuse the grid vertices. More...
 
virtual void calculateVertexPoints () override
 Interface, Calculate the vertices used for the blit. More...
 
local calculateVertexPoints ()
 Interface, Calculate the vertices used for the blit. More...
 
void setNeedDepthTestForBlit (bool neededDepthTest)
var setNeedDepthTestForBlit ( var neededDepthTest)
local setNeedDepthTestForBlit ( local neededDepthTest)
bool getNeedDepthTestForBlit () const
- Public Member Functions inherited from GridBase
virtual ~GridBase (void)
 Destructor. More...
 
int getReuseGrid (void) const
 Get number of times that the grid will be reused. More...
 
var getReuseGrid ()
 Get number of times that the grid will be reused. More...
 
local getReuseGrid ()
 Get number of times that the grid will be reused. More...
 
void setReuseGrid (int reuseGrid)
 Set number of times that the grid will be reused. More...
 
var setReuseGrid ( var reuseGrid)
 Set number of times that the grid will be reused. More...
 
local setReuseGrid ( local reuseGrid)
 Set number of times that the grid will be reused. More...
 
const SizegetGridSize (void) const
 Size of the grid. More...
 
var getGridSize ()
 Size of the grid. More...
 
local getGridSize ()
 Size of the grid. More...
 
void setGridSize (const Size &gridSize)
 Set the size of the grid. More...
 
var setGridSize ( var gridSize)
 Set the size of the grid. More...
 
local setGridSize ( local gridSize)
 Set the size of the grid. More...
 
const Vec2getStep (void) const
 Pixels between the grids. More...
 
local getStep ()
 Pixels between the grids. More...
 
void setStep (const Vec2 &step)
 Get the pixels between the grids. More...
 
var setStep ( var step)
 Get the pixels between the grids. More...
 
local setStep ( local step)
 Get the pixels between the grids. More...
 
bool isTextureFlipped (void) const
 is texture flipped. More...
 
var isTextureFlipped ()
 is texture flipped. More...
 
local isTextureFlipped ()
 is texture flipped. More...
 
void setTextureFlipped (bool flipped)
 Set the texture flipped or not. More...
 
var setTextureFlipped ( var flipped)
 Set the texture flipped or not. More...
 
local setTextureFlipped ( local flipped)
 Set the texture flipped or not. More...
 
void set2DProjection (void)
 Change projection to 2D for grabbing. More...
 
bool initWithSize (const Size &gridSize, Texture2D *texture, bool flipped)
local initWithSize ( local gridSize, local texture, local flipped)
bool initWithSize (const Size &gridSize)
bool isActive (void) const
var isActive ()
local isActive ()
void setActive (bool active)
var setActive ( var active)
local setActive ( local active)
void beforeDraw (void)
void afterDraw (Node *target)
- 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. 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...
 
var create ( var gridSize, var texture, var flipped)
 create one Grid More...
 
local create ( local gridSize, local texture, local flipped)
 create one Grid More...
 
static GridBasecreate (const Size &gridSize)
 create one Grid More...
 
local create ( local gridSize)
 create one Grid More...
 

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

Grid3D is a 3D grid implementation.

Each vertex has 3 dimensions: x,y,z

Constructor & Destructor Documentation

Grid3D ( )

Constructor.

var ctor ( )

Constructor.

local Grid3D ( )

Constructor.

~Grid3D ( void  )

Destructor.

Member Function Documentation

virtual void afterBlit ( )
overridevirtual

Reimplemented from GridBase.

var afterBlit ( )
overridevirtual

Reimplemented from GridBase.

local afterBlit ( )
overridevirtual

Reimplemented from GridBase.

virtual void beforeBlit ( )
overridevirtual

Implementations for interfaces in base calss.

Reimplemented from GridBase.

var beforeBlit ( )
overridevirtual

Implementations for interfaces in base calss.

Reimplemented from GridBase.

local beforeBlit ( )
overridevirtual

Implementations for interfaces in base calss.

Reimplemented from GridBase.

virtual void blit ( )
overridevirtual

Interface used to blit the texture with grid to screen.

Reimplemented from GridBase.

var blit ( )
overridevirtual

Interface used to blit the texture with grid to screen.

Reimplemented from GridBase.

local blit ( )
overridevirtual

Interface used to blit the texture with grid to screen.

Reimplemented from GridBase.

virtual void calculateVertexPoints ( )
overridevirtual

Interface, Calculate the vertices used for the blit.

Reimplemented from GridBase.

var calculateVertexPoints ( )
overridevirtual

Interface, Calculate the vertices used for the blit.

Reimplemented from GridBase.

local calculateVertexPoints ( )
overridevirtual

Interface, Calculate the vertices used for the blit.

Reimplemented from GridBase.

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

create one Grid.

var create ( var  gridSize,
var  texture,
var  flipped 
)
static

create one Grid.

local create ( local  gridSize,
local  texture,
local  flipped 
)
static

create one Grid.

static Grid3D* create ( const Size gridSize)
static

create one Grid.

var create ( var  gridSize)
static

create one Grid.

local create ( local  gridSize)
static

create one Grid.

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

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

Vec3 getVertex ( const Vec2 pos) const

Returns the vertex at a given position.

Vec3 originalVertex ( const Vec2 pos) const
inline
virtual void reuse ( )
overridevirtual

Interface, Reuse the grid vertices.

Reimplemented from GridBase.

var reuse ( )
overridevirtual

Interface, Reuse the grid vertices.

Reimplemented from GridBase.

local reuse ( )
overridevirtual

Interface, Reuse the grid vertices.

Reimplemented from GridBase.

void setNeedDepthTestForBlit ( bool  neededDepthTest)
inline

Getter and Setter for depth test state when blit.

var setNeedDepthTestForBlit ( var  neededDepthTest)
inline

Getter and Setter for depth test state when blit.

local setNeedDepthTestForBlit ( local  neededDepthTest)
inline

Getter and Setter for depth test state when blit.

void setVertex ( const Vec2 pos,
const Vec3 vertex 
)

Sets a new vertex at a given position.

Vec3 vertex ( const Vec2 pos) const
inline

Member Data Documentation

GLushort* _indices
protected
var _indices
protected
local _indices
protected
bool _needDepthTestForBlit
protected
var _needDepthTestForBlit
protected
local _needDepthTestForBlit
protected
bool _oldDepthTestValue
protected
var _oldDepthTestValue
protected
local _oldDepthTestValue
protected
bool _oldDepthWriteValue
protected
var _oldDepthWriteValue
protected
local _oldDepthWriteValue
protected
GLvoid* _originalVertices
protected
var _originalVertices
protected
local _originalVertices
protected
GLvoid* _texCoordinates
protected
var _texCoordinates
protected
local _texCoordinates
protected
GLvoid* _vertices
protected
var _vertices
protected
local _vertices
protected

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