Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on. More...
Inherits Ref.
Public Types | |
|
typedef std::vector< unsigned short > | IndexArray |
| The indices array. | |
Public Member Functions | |
| GLuint | getVertexBuffer () const |
| Get the vertex buffer. More... | |
| bool | hasVertexAttrib (int attrib) const |
| Check if the mesh have specified vertex attribute or not The attribute type ID. More... | |
| var | hasVertexAttrib ( var attrib) |
| Check if the mesh have specified vertex attribute or not The attribute type ID. More... | |
| ssize_t | getMeshVertexAttribCount () const |
| Get the mesh vertex attribute count. More... | |
| local | getMeshVertexAttribCount () |
| Get the mesh vertex attribute count. More... | |
| const MeshVertexAttrib & | getMeshVertexAttribute (int idx) |
| Get MeshVertexAttribute by index The index. More... | |
| var | getMeshVertexAttribute ( var idx) |
| Get MeshVertexAttribute by index The index. More... | |
| local | getMeshVertexAttribute ( local idx) |
| Get MeshVertexAttribute by index The index. More... | |
| int | getVertexSizeInBytes () const |
| Get per vertex size in bytes. More... | |
| var | getVertexSizeInBytes () |
| Get per vertex size in bytes. More... | |
| local | getVertexSizeInBytes () |
| Get per vertex size in bytes. More... | |
| void | setTexture (const std::string &texPath) |
| Texture setter. More... | |
| var | setTexture ( var texPath) |
| Texture setter. More... | |
| local | setTexture ( local texPath) |
| Texture setter. More... | |
| void | setTexture (Texture2D *tex) |
| Texture setter. More... | |
| var | setTexture ( var tex) |
| Texture setter. More... | |
| local | setTexture ( local tex) |
| Texture setter. More... | |
| void | setTexture (Texture2D *tex, NTextureData::Usage usage, bool cacheFileName=true) |
| set texture More... | |
| var | setTexture ( var tex, var usage, var true) |
| set texture More... | |
| local | setTexture ( local tex, local usage, local true) |
| set texture More... | |
| void | setTexture (const std::string &texPath, NTextureData::Usage usage) |
| set texture More... | |
| Texture2D * | getTexture () const |
| Texture getter. More... | |
| Texture2D * | getTexture (NTextureData::Usage usage) |
| Visible setter The visiblity. More... | |
| bool | isVisible () const |
| Visible getter. | |
| var | isVisible () |
| Visible getter. | |
| local | isVisible () |
| Visible getter. | |
| MeshSkin * | getSkin () const |
| The skin getter. More... | |
| MeshIndexData * | getMeshIndexData () const |
| Mesh index data getter. More... | |
| GLProgramState * | getGLProgramState () const |
| Get GLProgramState. More... | |
| const std::string & | getName () const |
| Get the mesh's name. More... | |
| void | setBlendFunc (const BlendFunc &blendFunc) |
| Set the blending function. More... | |
| var | setBlendFunc ( var blendFunc) |
| Set the blending function. More... | |
| local | setBlendFunc ( local blendFunc) |
| Set the blending function. More... | |
| const BlendFunc & | getBlendFunc () const |
| Get the mesh's blending function. | |
| local | getBlendFunc () |
| Get the mesh's blending function. | |
| GLenum | getPrimitiveType () const |
| Get primitive type. More... | |
| var | getPrimitiveType () |
| Get primitive type. More... | |
| ssize_t | getIndexCount () const |
| Get index count The index count of the mesh. | |
| var | getIndexCount () |
| Get index count The index count of the mesh. | |
| GLenum | getIndexFormat () const |
| Get the mesh's index data format. More... | |
| var | getIndexFormat () |
| Get the mesh's index data format. More... | |
| GLuint | getIndexBuffer () const |
| Get the mesh's index buffer object(IBO) handle. More... | |
| var | getIndexBuffer () |
| Get the mesh's index buffer object(IBO) handle. More... | |
| const AABB & | getAABB () const |
| Get the mesh's AABB in local space. More... | |
| local | getAABB () |
| Get the mesh's AABB in local space. More... | |
| void | setGLProgramState (GLProgramState *glProgramState) |
| Sets a new GLProgramState for the Mesh The new GLProgramState object. More... | |
| void | setMaterial (Material *material) |
| Sets a new Material to the Mesh The new Material object. | |
| Material * | getMaterial () const |
| Get the Material which being used by the Mesh The material object. | |
| MeshCommand & | getMeshCommand () |
| Get the MeshCommand. More... | |
| void | setSkin (MeshSkin *skin) |
| Set a specified skin to mesh. More... | |
| var | setSkin ( var skin) |
| Set a specified skin to mesh. More... | |
| local | setSkin ( local skin) |
| Set a specified skin to mesh. More... | |
| void | setMeshIndexData (MeshIndexData *indexdata) |
| Set the mesh index data. More... | |
| var | setMeshIndexData ( var indexdata) |
| Set the mesh index data. More... | |
| local | setMeshIndexData ( local indexdata) |
| Set the mesh index data. More... | |
| void | setName (const std::string &name) |
| Set the mesh's name. More... | |
| var | setName ( var name) |
| Set the mesh's name. More... | |
| local | setName ( local name) |
| Set the mesh's name. More... | |
| void | calculateAABB () |
| Calculate the AABB of the mesh. More... | |
| var | calculateAABB () |
| Calculate the AABB of the mesh. More... | |
| local | calculateAABB () |
| Calculate the AABB of the mesh. More... | |
| void | setForce2DQueue (bool force2D) |
| force set this Sprite3D to 2D render queue | |
| var | setForce2DQueue ( var force2D) |
| force set this Sprite3D to 2D render queue | |
| local | setForce2DQueue ( local force2D) |
| force set this Sprite3D to 2D render queue | |
| std::string | getTextureFileName () |
| Return texture file name. | |
| var | getTextureFileName () |
| Return texture file name. | |
| local | getTextureFileName () |
| Return texture file name. | |
Public Member Functions inherited from Ref | |
| void | retain () |
| Retains the ownership. More... | |
| local | 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... | |
| local | getReferenceCount () |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
| Destructor. | |
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, single SubMesh The positions list. More... | |
| local | create ( local positions, local normals, local texs, local indices) |
| Create mesh from positions, normals, and so on, single SubMesh The positions list. 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 | |
| var | create ( var vertices, var perVertexSizeInFloat, var indices, var numIndex, var attribs, var attribCount) |
| create mesh with vertex attributes | |
| local | create ( local vertices, local perVertexSizeInFloat, local indices, local numIndex, local attribs, local attribCount) |
| create mesh with vertex attributes | |
| static Mesh * | create (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, const std::vector< MeshVertexAttrib > &attribs) |
| Create mesh from vertices, indices and attribs the vertices list. More... | |
| static Mesh * | create (const std::string &name, MeshIndexData *indexData, MeshSkin *skin=nullptr) |
| Create mesh from name, mesh index data and skin The name. More... | |
Additional Inherited Members | |
Public Attributes inherited from Ref | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID | |
| local | _ID |
| object id, ScriptSupport need public _ID | |
| int | _luaID |
| Lua reference id. | |
| local | _luaID |
| Lua reference id. | |
| void * | _scriptObject |
| scriptObject, support for swift | |
| local | _scriptObject |
| scriptObject, support for swift | |
| bool | _rooted |
| When true, it means that the object was already rooted. | |
| local | _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... | |
| local | _scriptOwned |
| The life of the object is scrolled by the scripting engine. More... | |
Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on.
|
static |
Create mesh from positions, normals, and so on, single SubMesh The positions list.
The normals list. The texture UV corodinates list. The indices list The Mesh object.
|
static |
Create mesh from positions, normals, and so on, single SubMesh The positions list.
The normals list. The texture UV corodinates list. The indices list The Mesh object.
|
static |
Create mesh from positions, normals, and so on, single SubMesh The positions list.
The normals list. The texture UV corodinates list. The indices list The Mesh object.
|
static |
Create mesh from vertices, indices and attribs the vertices list.
Each vertex element's size. The indices list. The mesh vertices attributes list. The Mesh object.
|
static |
Create mesh from vertices, indices and attribs the vertices list.
Each vertex element's size. The indices list. The mesh vertices attributes list. The Mesh object.
|
static |
|
static |
| GLuint getVertexBuffer | ( | ) | const |
Get the vertex buffer.
The VBO ID.
| var getVertexBuffer | ( | ) |
Get the vertex buffer.
The VBO ID.
| bool hasVertexAttrib | ( | int | attrib | ) | const |
Check if the mesh have specified vertex attribute or not The attribute type ID.
Return true if the mesh have specified attribute, otherwise return false.
| var hasVertexAttrib | ( | var | attrib | ) |
Check if the mesh have specified vertex attribute or not The attribute type ID.
Return true if the mesh have specified attribute, otherwise return false.
| ssize_t getMeshVertexAttribCount | ( | ) | const |
Get the mesh vertex attribute count.
The vertex attribute count.
| var getMeshVertexAttribCount | ( | ) |
Get the mesh vertex attribute count.
The vertex attribute count.
| local getMeshVertexAttribCount | ( | ) |
Get the mesh vertex attribute count.
The vertex attribute count.
| const MeshVertexAttrib& getMeshVertexAttribute |
( | int | idx | ) |
Get MeshVertexAttribute by index The index.
The MeshVertexAttribute object.
| var getMeshVertexAttribute | ( | var | idx | ) |
Get MeshVertexAttribute by index The index.
The MeshVertexAttribute object.
| local getMeshVertexAttribute | ( | local | idx | ) |
Get MeshVertexAttribute by index The index.
The MeshVertexAttribute object.
| int getVertexSizeInBytes | ( | ) | const |
Get per vertex size in bytes.
The per vertex size in bytes.
| var getVertexSizeInBytes | ( | ) |
Get per vertex size in bytes.
The per vertex size in bytes.
| local getVertexSizeInBytes | ( | ) |
Get per vertex size in bytes.
The per vertex size in bytes.
| void setTexture | ( | const std::string & | texPath | ) |
Texture setter.
The texture file path.
| var setTexture | ( | var | texPath | ) |
Texture setter.
The texture file path.
| local setTexture | ( | local | texPath | ) |
Texture setter.
The texture file path.
| var setTexture | ( | var | tex | ) |
Texture setter.
The Texture2D object.
| local setTexture | ( | local | tex | ) |
Texture setter.
The Texture2D object.
| void setTexture | ( | Texture2D * | tex, |
| NTextureData::Usage | usage, | ||
| bool | cacheFileName = true |
||
| ) |
set texture
| tex | texture to be set |
| usage | Usage of this texture |
| whether | refresh the cache file name |
| var setTexture | ( | var | tex, |
| var | usage, | ||
| var | cacheFileName = true |
||
| ) |
set texture
| tex | texture to be set |
| usage | Usage of this texture |
| whether | refresh the cache file name |
| local setTexture | ( | local | tex, |
| local | usage, | ||
| local | cacheFileName = true |
||
| ) |
set texture
| tex | texture to be set |
| usage | Usage of this texture |
| whether | refresh the cache file name |
| void setTexture | ( | const std::string & | texPath, |
| NTextureData::Usage | usage | ||
| ) |
set texture
| texPath | texture path |
| usage | Usage of this texture |
| var setTexture | ( | var | texPath, |
| var | usage | ||
| ) |
set texture
| texPath | texture path |
| usage | Usage of this texture |
| local setTexture | ( | local | texPath, |
| local | usage | ||
| ) |
set texture
| texPath | texture path |
| usage | Usage of this texture |
| var getTexture | ( | ) |
Texture getter.
The Texture2D object.
| local getTexture | ( | ) |
Texture getter.
The Texture2D object.
| Texture2D* getTexture | ( | NTextureData::Usage | usage | ) |
Visible setter The visiblity.
Get texture
| usage | Usage of returned texture |
| var getTexture | ( | var | usage | ) |
Visible setter The visiblity.
Get texture
| usage | Usage of returned texture |
| local getTexture | ( | local | usage | ) |
Visible setter The visiblity.
Get texture
| usage | Usage of returned texture |
|
inline |
The skin getter.
The MeshSkin Object.
|
inline |
Mesh index data getter.
The MeshIndexData object.
|
inline |
Mesh index data getter.
The MeshIndexData object.
| GLProgramState* getGLProgramState | ( | ) | const |
Get GLProgramState.
The GLProgramState object.
| var getGLProgramState | ( | ) |
Get GLProgramState.
The GLProgramState object.
|
inline |
Get the mesh's name.
The mesh's name.
|
inline |
Get the mesh's name.
The mesh's name.
|
inline |
Get the mesh's name.
The mesh's name.
| void setBlendFunc | ( | const BlendFunc & | blendFunc | ) |
Set the blending function.
The specified blending function.
| var setBlendFunc | ( | var | blendFunc | ) |
Set the blending function.
The specified blending function.
| local setBlendFunc | ( | local | blendFunc | ) |
Set the blending function.
The specified blending function.
| GLenum getPrimitiveType | ( | ) | const |
Get primitive type.
The primitive type.
| var getPrimitiveType | ( | ) |
Get primitive type.
The primitive type.
| GLenum getIndexFormat | ( | ) | const |
Get the mesh's index data format.
The index data format, should be GL_UNSIGNED_SHORT.
| var getIndexFormat | ( | ) |
Get the mesh's index data format.
The index data format, should be GL_UNSIGNED_SHORT.
| GLuint getIndexBuffer | ( | ) | const |
Get the mesh's index buffer object(IBO) handle.
The IBO handle.
| var getIndexBuffer | ( | ) |
Get the mesh's index buffer object(IBO) handle.
The IBO handle.
| void setGLProgramState | ( | GLProgramState * | glProgramState | ) |
Sets a new GLProgramState for the Mesh The new GLProgramState object.
A new Material will be created for it
| var setGLProgramState | ( | var | glProgramState | ) |
Sets a new GLProgramState for the Mesh The new GLProgramState object.
A new Material will be created for it
| local setGLProgramState | ( | local | glProgramState | ) |
Sets a new GLProgramState for the Mesh The new GLProgramState object.
A new Material will be created for it
|
inline |
Get the MeshCommand.
The MeshCommand object
|
inline |
Get the MeshCommand.
The MeshCommand object
|
inline |
Get the MeshCommand.
The MeshCommand object
| void setSkin | ( | MeshSkin * | skin | ) |
Set a specified skin to mesh.
The specified skin object.
| var setSkin | ( | var | skin | ) |
Set a specified skin to mesh.
The specified skin object.
| local setSkin | ( | local | skin | ) |
Set a specified skin to mesh.
The specified skin object.
| void setMeshIndexData | ( | MeshIndexData * | indexdata | ) |
Set the mesh index data.
The specified MeshIndexData.
| var setMeshIndexData | ( | var | indexdata | ) |
Set the mesh index data.
The specified MeshIndexData.
| local setMeshIndexData | ( | local | indexdata | ) |
Set the mesh index data.
The specified MeshIndexData.
|
inline |
Set the mesh's name.
The mesh's new name.
|
inline |
Set the mesh's name.
The mesh's new name.
|
inline |
Set the mesh's name.
The mesh's new name.
| void calculateAABB | ( | ) |
| var calculateAABB | ( | ) |
| local calculateAABB | ( | ) |