ProceduralMesh - stingray.ProceduralMesh object reference - Stingray Lua API Reference

stingray.ProceduralMesh object reference

Description

API for manipulating procedurally generated meshes.

Constants

MO_ALL_CONTEXTS : integer

Visibility context for both regular rendering and shadow casting.

Note: might significantly impact performance.

MO_LINE_LIST : integer

Line list primitive
Visibility context for shadow casting.
Visibility context for regular rendering.

Functions

Parameters

handle :

integer

A handle to the mesh that we are adding resources to.

resource_handle :

integer

Handle to the resource (buffer or description from RenderBuffer) that we are adding.

Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh that we are clearing.

Returns
This function does not return any values.
Parameters

unit :

stingray.Unit

The unit that should own the new mesh.

node :

string

The name of the node in the unit that the mesh should be attached to.

mesh_name :

string

The name of the newly created mesh (for debugging purposes).

flags :

integer

A MO_*_FLAG value for the mesh.

Returns

integer

A handle to the newly created mesh.

Parameters

handle :

integer

A handle to the mesh to be destroyed.

Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh.

Returns

integer

The MO_*_FLAG flags for the mesh.

Parameters

handle :

integer

A handle to the mesh that we are removing resources from.

resource_handle :

integer

Handle to the resource (buffer or description from RenderBuffer) that we are removing.

Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh who's batches we are describing.

batches :

table

Describes the rendering bathces for the mesh.

Returns
This function does not return any values.

batches should be a table of tables, with each subtable describing one batch. The subtables should have the following fields:

  • primitive_type: Type of primitives (MO_TRIANGLE_LIST, MO_LINE_LIST).
  • material_index: Index into set_materials() array for this batch.
  • vertex_offset: Offset into vertex data for batch.
  • primitives: Number of primitives for batch.
  • index_offset: Offset into index data for batch (only valid when indexed).
  • vertices: Number of vertices in batch (only valid when non-indexed).
  • instances: Number of instances to draw (1 equals no instancing).
Parameters

handle :

integer

A handle to the mesh.

min :

stingray.Vector3

Minimum corner of the AABB.

max :

stingray.Vector3

Maximum corner of the AABB.

Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh.

flags :

integer

The flags to set.

Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh who's materials we should set.

materials :

string[]

A list of materials for the mesh.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh.

context :

integer

The MO_*_CONTEXT we are setting the visiblity for.

visible :

boolean

True if the mesh should be visible.

Returns
This function does not return any values.
Parameters

handle :

integer

A handle to the mesh.

context :

integer

The MO_*_CONTEXT we are checking the visiblity for.

Returns

boolean

The visiblity in the context.