cocos2d-x
3.3
|
Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on. More...
#include <CCMesh.h>
Public Types | |
typedef std::vector< unsigned short > | IndexArray |
Public Member Functions | |
GLuint | getVertexBuffer () const |
get vertex buffer More... | |
bool | hasVertexAttrib (int attrib) const |
has vertex attribute? More... | |
ssize_t | getMeshVertexAttribCount () const |
get mesh vertex attribute count More... | |
const MeshVertexAttrib & | getMeshVertexAttribute (int idx) |
get MeshVertexAttribute by index More... | |
int | getVertexSizeInBytes () const |
get per vertex size in bytes More... | |
void | setTexture (const std::string &texPath) |
texture getter and setter More... | |
void | setTexture (Texture2D *tex) |
Texture2D * | getTexture () const |
void | setVisible (bool visible) |
visible getter and setter More... | |
bool | isVisible () const |
MeshSkin * | getSkin () const |
skin getter More... | |
MeshIndexData * | getMeshIndexData () const |
mesh index data getter More... | |
GLProgramState * | getGLProgramState () const |
get GLProgramState More... | |
const std::string & | getName () const |
name getter More... | |
void | setBlendFunc (const BlendFunc &blendFunc) |
const BlendFunc & | getBlendFunc () const |
GLenum | getPrimitiveType () const |
get primitive type More... | |
ssize_t | getIndexCount () const |
get index count More... | |
GLenum | getIndexFormat () const |
get index format More... | |
GLuint | getIndexBuffer () const |
get index buffer More... | |
const AABB & | getAABB () const |
get AABB More... | |
virtual | ~Mesh () |
GLProgram * | getDefaultGLProgram (bool textured) |
void | setGLProgramState (GLProgramState *glProgramState) |
MeshCommand & | getMeshCommand () |
void | setSkin (MeshSkin *skin) |
skin setter More... | |
void | setMeshIndexData (MeshIndexData *indexdata) |
Mesh index data setter. More... | |
void | setName (const std::string &name) |
name setter More... | |
void | calcuateAABB () |
void | bindMeshCommand () |
![]() | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
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 Mesh * | create (const std::vector< float > &positions, const std::vector< float > &normals, const std::vector< float > &texs, const IndexArray &indices) |
create mesh from positions, normals, and so on, sigle SubMesh More... | |
static Mesh * | create (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, int numIndex, const std::vector< MeshVertexAttrib > &attribs, int attribCount) |
create mesh with vertex attributes More... | |
static Mesh * | create (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, const std::vector< MeshVertexAttrib > &attribs) |
static Mesh * | create (const std::string &name, MeshIndexData *indexData, MeshSkin *skin=nullptr) |
create mesh More... | |
Public Attributes | |
CC_CONSTRUCTOR_ACCESS | __pad0__: Mesh() |
Protected Attributes | |
Texture2D * | _texture |
MeshSkin * | _skin |
bool | _visible |
bool | _isTransparent |
std::string | _name |
MeshIndexData * | _meshIndexData |
GLProgramState * | _glProgramState |
MeshCommand | _meshCommand |
BlendFunc | _blend |
AABB | _aabb |
std::function< void()> | _visibleChanged |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
Friends | |
class | Sprite3D |
Additional Inherited Members | |
![]() | |
Ref () | |
Constructor. More... | |
Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on.
typedef std::vector<unsigned short> IndexArray |
|
virtual |
void bindMeshCommand | ( | ) |
void calcuateAABB | ( | ) |
|
static |
create mesh from positions, normals, and so on, sigle SubMesh
|
inlinestatic |
create mesh with vertex attributes
|
static |
|
static |
create mesh
const BlendFunc& getBlendFunc | ( | ) | const |
GLProgram* getDefaultGLProgram | ( | bool | textured | ) |
|
inline |
get GLProgramState
GLuint getIndexBuffer | ( | ) | const |
get index buffer
ssize_t getIndexCount | ( | ) | const |
get index count
GLenum getIndexFormat | ( | ) | const |
get index format
|
inline |
|
inline |
mesh index data getter
ssize_t getMeshVertexAttribCount | ( | ) | const |
get mesh vertex attribute count
const MeshVertexAttrib& getMeshVertexAttribute | ( | int | idx | ) |
get MeshVertexAttribute by index
|
inline |
name getter
GLenum getPrimitiveType | ( | ) | const |
get primitive type
|
inline |
skin getter
|
inline |
GLuint getVertexBuffer | ( | ) | const |
get vertex buffer
int getVertexSizeInBytes | ( | ) | const |
get per vertex size in bytes
bool hasVertexAttrib | ( | int | attrib | ) | const |
has vertex attribute?
|
inline |
void setBlendFunc | ( | const BlendFunc & | blendFunc | ) |
void setGLProgramState | ( | GLProgramState * | glProgramState | ) |
void setMeshIndexData | ( | MeshIndexData * | indexdata | ) |
Mesh index data setter.
|
inline |
name setter
void setSkin | ( | MeshSkin * | skin | ) |
skin setter
void setTexture | ( | const std::string & | texPath | ) |
texture getter and setter
void setTexture | ( | Texture2D * | tex | ) |
void setVisible | ( | bool | visible | ) |
visible getter and setter
|
friend |
CC_CONSTRUCTOR_ACCESS __pad0__ |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |