Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on. More...
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 | |
| const MeshVertexAttrib & | getMeshVertexAttribute (int idx) |
| get MeshVertexAttribute by index | |
| int | getVertexSizeInBytes () const |
| get per vertex size in bytes | |
| void | setTexture (const std::string &texPath) |
| set texture (diffuse), which is responsible for the main appearance. More... | |
| void | setTexture (Texture2D *tex) |
| set texture (diffuse), which is responsible for the main appearance. More... | |
| void | setTexture (Texture2D *tex, NTextureData::Usage usage, bool cacheFileName=true) |
| set texture More... | |
| void | setTexture (const std::string &texPath, NTextureData::Usage usage) |
| set texture More... | |
| Texture2D * | getTexture () const |
| Get texture (diffuse), which is responsible for the main appearance. More... | |
| Texture2D * | getTexture (NTextureData::Usage usage) |
| Get texture. More... | |
| void | setVisible (bool visible) |
| visible getter and setter | |
| 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 | |
| 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 | |
| void | setGLProgramState (GLProgramState *glProgramState) |
| Sets a new GLProgramState for the Mesh A new Material will be created for it. | |
| void | setMaterial (Material *material) |
| Sets a new Material to the Mesh. | |
| Material * | getMaterial () const |
| Returns the Material being used by the Mesh. | |
| MeshCommand & | getMeshCommand () |
| Get the MeshCommand. | |
| void | setSkin (MeshSkin *skin) |
| skin setter | |
| void | setMeshIndexData (MeshIndexData *indexdata) |
| Mesh index data setter. | |
| void | setName (const std::string &name) |
| name setter | |
| void | calculateAABB () |
| calculate the AABB of the mesh More... | |
| void | setForce2DQueue (bool force2D) |
| force set this Sprite3D to 2D render queue | |
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 () |
| Destructor. 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, single SubMesh | |
| static Mesh * | create (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, int, const std::vector< MeshVertexAttrib > &attribs, int) |
| create mesh with vertex attributes | |
| static Mesh * | create (const std::vector< float > &vertices, int perVertexSizeInFloat, const IndexArray &indices, const std::vector< MeshVertexAttrib > &attribs) |
| NA | |
| static Mesh * | create (const std::string &name, MeshIndexData *indexData, MeshSkin *skin=nullptr) |
| create mesh NA | |
Additional Inherited Members | |
Public Attributes inherited from Ref | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID | |
| int | _luaID |
| Lua reference id. | |
| void * | _scriptObject |
| scriptObject, support for swift | |
| bool | _rooted |
| When true, it means that the object was already rooted. | |
Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on.
| GLuint getVertexBuffer | ( | ) | const |
get vertex buffer
NA
| bool hasVertexAttrib | ( | int | attrib | ) | const |
has vertex attribute?
NA
| void setTexture | ( | const std::string & | texPath | ) |
set texture (diffuse), which is responsible for the main appearance.
It is also means main texture, you can also call setTexture(texPath, NTextureData::Usage::Diffuse)
| texPath | texture path |
| void setTexture | ( | Texture2D * | tex | ) |
set texture (diffuse), which is responsible for the main appearance.
It is also means main texture, you can also call setTexture(texPath, NTextureData::Usage::Diffuse)
| tex | texture to be set |
| 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 |
| void setTexture | ( | const std::string & | texPath, |
| NTextureData::Usage | usage | ||
| ) |
set texture
| texPath | texture path |
| usage | Usage of this texture |
| Texture2D* getTexture | ( | ) | const |
Get texture (diffuse), which is responsible for the main appearance.
It is also means main texture, you can also call getTexture(NTextureData::Usage::Diffuse)
| Texture2D* getTexture | ( | NTextureData::Usage | usage | ) |
Get texture.
| usage | Usage of returned texture |
|
inline |
skin getter
NA
|
inline |
mesh index data getter
NA
| GLProgramState* getGLProgramState | ( | ) | const |
get GLProgramState
NA
| GLenum getPrimitiveType | ( | ) | const |
get primitive type
NA
| ssize_t getIndexCount | ( | ) | const |
get index count
NA
| GLenum getIndexFormat | ( | ) | const |
get index format
NA
| GLuint getIndexBuffer | ( | ) | const |
get index buffer
NA
| void calculateAABB | ( | ) |