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

stingray.Mesh object reference

Description

Describes a mesh.

Functions

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.BoundingVolume

The bounding volume of the mesh.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The bounding volume minimum of the mesh.

stingray.Vector3

The bounding volume maximum of the mesh.

number

The radius of the bounding volume of the mesh.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Matrix4x4

The position and orientation of the center of the box.

stingray.Vector3

The half-extents of the box along the X, Y and Z axes.

Available only on Windows platforms, and only in development builds.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

slot_name :

string

The name of the material slot to look for.

Returns

boolean

Returns true if the mesh contains a material slot with the specified name, and false otherwise.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

slot :

any(integer, string)

The name of the material slot whose material you want to retrieve, or the numeric index of the material slot you want to retrieve within the list of all material slots in the mesh.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
Returns

stingray.Material

The material assigned to the specified slot.

Note: Only call this function if you are sure that the slot name or numeric index that you specify is actually used in this mesh. If you are providing a slot name, you can use Mesh.has_material() first to verify that your slot name exists. If you are providing a numeric index, you can use Mesh.num_materials() first to get the total number of material slots in the mesh; your index must be less than this upper bound.

Parameters

mesh :

stingray.Mesh

The mesh to test.

triangle_index :

integer

The triangle to fetch the material for

Returns

integer

The material slot name for the specified triangle

Available only on Windows platforms, and only in development builds.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

The number of material slots in the mesh.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

sort_value :

integer

An explicit sort value.

Returns
This function does not return any values.

Call this function only when all materials of the mesh are rendering into layers using the EXPLICIT sort mode.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

flag :

string

The name of the shader pass flag to set.

enabled :

boolean

Returns true to enable the shader pass for the mesh, or false otherwise.

Returns
This function does not return any values.
Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

The visibility of the mesh.

Scene placement

The functions in this group control the placement of an object of this type in the scene.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Matrix4x4

The position and orientation of the object in local space.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The position of the object in local space.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Quaternion

The rotation of the object in local space.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

integer

The ID of the specified object in the scene graph.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

parent :

stingray.Unit

The parent Unit that owns this object.

pose :

stingray.Matrix4x4

The new position and orientation for the object in local space.

Returns
This function does not return any values.
Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

parent :

stingray.Unit

The parent Unit that owns this object.

position :

stingray.Vector3

The new position for the object in local space.

Returns
This function does not return any values.
Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

parent :

stingray.Unit

The parent Unit that owns this object.

rotation :

stingray.Quaternion

The new rotation for the object in local space.

Returns
This function does not return any values.
Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Matrix4x4

The position and orientation of the object in world space.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Vector3

The position of the object in world space.

Parameters

self :

stingray.Mesh

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

stingray.Quaternion

The rotation of the object in world space.