Type IMesh

IMesh object, holds static mesh data.

Methods

buildFromTriangles( triangles ) Builds the mesh from the given table of triangles.
destroy() Destroys the given mesh.
draw() Draws the given mesh.
getBounds() Gets the min and max bounding box positions of the mesh (local to the mesh).
isValid() Indicates whether this mesh can still be used.


Methods

IMesh:buildFromTriangles( triangles )
Builds the mesh from the given table of triangles.

Environment:

Client

Parameters:

  • triangles: Table of triangle vertices (see the MeshVertex structure).

Usage:

    local OurMesh = Mesh() 
    local Triangles = { 
    	{ pos = Vector( 0,  0,  0 ), u = 0, v = 0 }, 
    	{ pos = Vector( 10, 0,  0 ), u = 1, v = 0 }, 
    	{ pos = Vector( 10, 10, 0 ), u = 1, v = 1 } 
    } 
    OurMesh:buildFromTriangles( Triangles )
IMesh:destroy()
Destroys the given mesh. Do not attempt to use it again.

Environment:

Client
IMesh:draw()
Draws the given mesh.

Environment:

Client
IMesh:getBounds()
Gets the min and max bounding box positions of the mesh (local to the mesh).

Environment:

Client

Return values:

  1. (Vector) The bounding box minimum.
  2. (Vector) The bounding box maximum.
IMesh:isValid()
Indicates whether this mesh can still be used.

Environment:

Client

Return value:

    (boolean) True if the mesh has not yet been destroyed

Valid XHTML 1.0!