Mesh

From GiderosMobile
Revision as of 09:12, 23 August 2018 by Hgy29 (talk | contribs)

Supported platforms: android, ios, mac, pc
Available since: Gideros 2012.09

Description


Mesh class is used to create and display custom constructed set of triangles (triangle meshes). It basically consists of
4 arrays: vertex, index, color (optional), textureCoordinate (optional) and a texture (optional) and it provides more than
one way to set/modify these arrays.

Mesh can be 2D or 3D, the latter expects an additionnal Z coordinate in its vertices. Additionnally, 3D meshes and their children are rendered with depth testing enabled, which prevents far objects to be drawn above nearest ones, irrespective of actual drawing order.


  • `Note 1:` Mesh class doesn't do bounds check. If an element at index array points to an non-existent vertex, the application may crash.



{|- | style="width: 50%;"|

Methods

Mesh.new -
Mesh:clearColorArray -
Mesh:clearIndexArray -
Mesh:clearTexture -
Mesh:clearTextureCoordinateArray -
Mesh:clearVertexArray -
Mesh:getColor - Returns color and alpha of the i-th element from color array
Mesh:getColorArraySize - Get size of the Color array
Mesh:getIndex - Returns the i-th element from index array
Mesh:getIndexArraySize - Get size of the Index array
Mesh:getTextureCoordinate - Returns u and v coordinate of the i-th element from texture coordinate array
Mesh:getTextureCoordinateArraySize - Get size of the Texture Coordinate array
Mesh:getVertex - Returns x and y coordinate of the i-th element from vertex array
Mesh:getVertexArraySize - Get size of the Vertices array
Mesh:resizeColorArray -
Mesh:resizeIndexArray -
Mesh:resizeTextureCoordinateArray -
Mesh:resizeVertexArray -
Mesh:setColor -
Mesh:setColorArray -
Mesh:setColors -
Mesh:setGenericArray -
Mesh:setIndex -
Mesh:setIndexArray -
Mesh:setIndices -
Mesh:setTexture -
Mesh:setTextureCoordinate -
Mesh:setTextureCoordinateArray -
Mesh:setTextureCoordinates -
Mesh:setVertex -
Mesh:setVertexArray -
Mesh:setVertices -
| style="width: 50%;"|

Events

Constants

|}