Lysa  0.0
Lysa 3D Engine
MeshManager Class Referenceabstract

Detailed Description

Factory and registry for Mesh objects.

Lua full name: lysa.MeshManager

Public Member Functions

Mesh create (vertices: any, indices: any, surfaces: any)
 Creates a mesh from vertex, index, and surface tables. More...
 
Mesh create (vertices: any, indices: any, surfaces: any, name: string)
 Creates a named mesh from vertex, index, and surface tables. More...
 
Mesh create_quad (width: number, height: number, material_id: integer)
 Creates a centered flat quad mesh in the XY plane. More...
 
Mesh create_quad (width: number, height: number, material_id: integer, alignment: MeshAlignment)
 Creates a flat quad mesh with the given horizontal alignment. More...
 
Mesh create_quad (width: number, height: number, material_id: integer, alignment: MeshAlignment, name: string)
 Creates a named flat quad mesh with the given alignment. More...
 
Mesh create_quad (width: number, height: number, material_id: integer, alignment: MeshAlignment, y_offset: number)
 Creates a quad with alignment and a vertical offset. More...
 
Mesh create_quad (width: number, height: number, material_id: integer, alignment: MeshAlignment, y_offset: number, name: string)
 Creates a named quad with alignment and vertical offset. More...
 
Mesh create_quad (width: number, height: number, material_id: integer, alignment: MeshAlignment, y_offset: number, x_offset: number)
 Creates a quad with alignment, vertical and horizontal offsets. More...
 
Mesh create_quad (width: number, height: number, material_id: integer, alignment: MeshAlignment, y_offset: number, x_offset: number, name: string)
 Creates a named quad with alignment, vertical and horizontal offsets. More...
 
Mesh create_triangle (width: number, height: number, material_id: integer)
 Creates a flat triangle mesh in the XY plane centered at the origin. More...
 
Mesh create_triangle (width: number, height: number, material_id: integer, name: string)
 Creates a named flat triangle mesh in the XY plane centered at the origin. More...
 
Mesh create_triangle (width: number, height: number, material_id: integer, alignment: MeshAlignment)
 Creates a flat triangle mesh with the given alignment. More...
 
Mesh create_triangle (width: number, height: number, material_id: integer, alignment: MeshAlignment, name: string)
 Creates a named flat triangle mesh with the given alignment. More...
 
Mesh create_triangle (width: number, height: number, material_id: integer, alignment: MeshAlignment, x_offset: number, y_offset: number)
 Creates a triangle with alignment, horizontal and vertical offsets. More...
 
Mesh create_triangle (width: number, height: number, material_id: integer, alignment: MeshAlignment, x_offset: number, y_offset: number, name: string)
 Creates a named triangle with alignment and offsets. More...
 
Mesh get (id: integer)
 Returns the mesh with the given id. More...
 
nil destroy (id: integer)
 Destroys the mesh with the given id and releases its GPU memory. More...
 
nil destroy (mesh: Mesh)
 Destroys the given mesh and releases its GPU memory. More...
 
nil destroy (ids: integer[])
 Destroys all meshes in the list and releases their GPU memory. More...
 

Member Function Documentation

Mesh create ( any  vertices,
any  indices,
any  surfaces)

Creates a mesh from vertex, index, and surface tables.

Parameters
verticesany
indicesany
surfacesany
Returns
Mesh
Mesh create ( any  vertices,
any  indices,
any  surfaces,
string  name)

Creates a named mesh from vertex, index, and surface tables.

Parameters
verticesany
indicesany
surfacesany
namestring
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id)

Creates a centered flat quad mesh in the XY plane.

Parameters
widthnumber
heightnumber
material_idinteger
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment)

Creates a flat quad mesh with the given horizontal alignment.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
string  name)

Creates a named flat quad mesh with the given alignment.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
namestring
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
number  y_offset)

Creates a quad with alignment and a vertical offset.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
y_offsetnumber
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
number  y_offset,
string  name)

Creates a named quad with alignment and vertical offset.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
y_offsetnumber
namestring
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
number  y_offset,
number  x_offset)

Creates a quad with alignment, vertical and horizontal offsets.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
y_offsetnumber
x_offsetnumber
Returns
Mesh
Mesh create_quad ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
number  y_offset,
number  x_offset,
string  name)

Creates a named quad with alignment, vertical and horizontal offsets.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
y_offsetnumber
x_offsetnumber
namestring
Returns
Mesh
Mesh create_triangle ( number  width,
number  height,
integer  material_id)

Creates a flat triangle mesh in the XY plane centered at the origin.

Parameters
widthnumber
heightnumber
material_idinteger
Returns
Mesh
Mesh create_triangle ( number  width,
number  height,
integer  material_id,
string  name)

Creates a named flat triangle mesh in the XY plane centered at the origin.

Parameters
widthnumber
heightnumber
material_idinteger
namestring
Returns
Mesh
Mesh create_triangle ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment)

Creates a flat triangle mesh with the given alignment.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
Returns
Mesh
Mesh create_triangle ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
string  name)

Creates a named flat triangle mesh with the given alignment.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
namestring
Returns
Mesh
Mesh create_triangle ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
number  x_offset,
number  y_offset)

Creates a triangle with alignment, horizontal and vertical offsets.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
x_offsetnumber
y_offsetnumber
Returns
Mesh
Mesh create_triangle ( number  width,
number  height,
integer  material_id,
MeshAlignment  alignment,
number  x_offset,
number  y_offset,
string  name)

Creates a named triangle with alignment and offsets.

Parameters
widthnumber
heightnumber
material_idinteger
alignmentMeshAlignment
x_offsetnumber
y_offsetnumber
namestring
Returns
Mesh
Mesh get ( integer  id)

Returns the mesh with the given id.

Parameters
idinteger
Returns
Mesh
nil destroy ( integer  id)

Destroys the mesh with the given id and releases its GPU memory.

Parameters
idinteger
nil destroy ( Mesh  mesh)

Destroys the given mesh and releases its GPU memory.

Parameters
meshMesh
nil destroy ( integer[]  ids)

Destroys all meshes in the list and releases their GPU memory.

Parameters
idsinteger[]