Mesh: Geometry with a collection of vertex. More...
#include <CCMesh.h>
Public Types | |
| enum | IndexFormat { INDEX8 = GL_UNSIGNED_BYTE, INDEX16 = GL_UNSIGNED_SHORT } |
| Defines supported index formats. More... | |
| enum | PrimitiveType { TRIANGLES = GL_TRIANGLES, TRIANGLE_STRIP = GL_TRIANGLE_STRIP, LINES = GL_LINES, LINE_STRIP = GL_LINE_STRIP, POINTS = GL_POINTS } |
| Defines supported primitive types. More... | |
Public Member Functions | |
| GLuint | getVertexBuffer () const |
| get vertex buffer More... | |
| ssize_t | getMeshVertexAttribCount () const |
| get mesh vertex attribute count More... | |
| const MeshVertexAttrib & | getMeshVertexAttribute (int idx) const |
| get MeshVertexAttribute by index More... | |
| bool | hasVertexAttrib (int attrib) |
| has vertex attribute? More... | |
| int | getVertexSizeInBytes () const |
| get per vertex size in bytes More... | |
| PrimitiveType | getPrimitiveType () const |
| get primitive type More... | |
| ssize_t | getIndexCount () const |
| get index count More... | |
| IndexFormat | getIndexFormat () const |
| get index format More... | |
| GLuint | getIndexBuffer () const |
| get index buffer More... | |
| void | restore () |
| build vertex buffer from renderdata More... | |
| virtual | ~Mesh () |
| bool | init (const std::vector< float > &positions, const std::vector< float > &normals, const std::vector< float > &texs, const std::vector< unsigned short > &indices) |
| init mesh More... | |
| bool | init (const std::vector< float > &vertices, int vertexSizeInFloat, const std::vector< unsigned short > &indices, const std::vector< MeshVertexAttrib > &attribs) |
| init mesh More... | |
| void | buildBuffer () |
| build buffer More... | |
| void | cleanAndFreeBuffers () |
| free buffer More... | |
Public Member Functions inherited from Ref | |
| 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 () |
Static Public Member Functions | |
| static Mesh * | create (const std::vector< float > &positions, const std::vector< float > &normals, const std::vector< float > &texs, const std::vector< unsigned short > &indices) |
| create mesh from positions, normals, and so on More... | |
| static Mesh * | create (const std::vector< float > &vertices, int vertexSizeInFloat, const std::vector< unsigned short > &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 vertexSizeInFloat, const std::vector< unsigned short > &indices, const std::vector< MeshVertexAttrib > &attribs) |
| create mesh with vertex attributes More... | |
Public Attributes | |
| CC_CONSTRUCTOR_ACCESS | __pad0__: Mesh() |
Protected Attributes | |
| PrimitiveType | _primitiveType |
| IndexFormat | _indexFormat |
| GLuint | _vertexBuffer |
| GLuint | _indexBuffer |
| ssize_t | _indexCount |
| RenderMeshData | _renderdata |
Protected Attributes inherited from Ref | |
| unsigned int | _referenceCount |
| count of references More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Ref | |
| Ref () | |
| Constructor. More... | |
Mesh: Geometry with a collection of vertex.
Supporting various vertex formats.
|
strong |
|
strong |
|
virtual |
| void buildBuffer | ( | ) |
build buffer
| void cleanAndFreeBuffers | ( | ) |
free buffer
|
static |
create mesh from positions, normals, and so on
|
inlinestatic |
create mesh with vertex attributes
|
static |
create mesh with vertex attributes
|
inline |
get index buffer
|
inline |
get index count
|
inline |
get index format
|
inline |
get mesh vertex attribute count
|
inline |
get MeshVertexAttribute by index
|
inline |
get primitive type
|
inline |
get vertex buffer
|
inline |
get per vertex size in bytes
|
inline |
has vertex attribute?
| bool init | ( | const std::vector< float > & | positions, |
| const std::vector< float > & | normals, | ||
| const std::vector< float > & | texs, | ||
| const std::vector< unsigned short > & | indices | ||
| ) |
init mesh
| bool init | ( | const std::vector< float > & | vertices, |
| int | vertexSizeInFloat, | ||
| const std::vector< unsigned short > & | indices, | ||
| const std::vector< MeshVertexAttrib > & | attribs | ||
| ) |
init mesh
| void restore | ( | ) |
build vertex buffer from renderdata
| CC_CONSTRUCTOR_ACCESS __pad0__ |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |