Describes a mesh.
Constructors and accessors
Related sample code
Other related reference items
Related help topics
bounding_volume ( self ) : stingray.BoundingVolumeReturns the bounding volume of the mesh.
|
self : | 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. |
The bounding volume of the mesh. |
bounding_volume_components ( self ) : stingray.Vector3, stingray.Vector3, numberReturns the parameters of the mesh bounding volume.
|
self : | 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. |
The bounding volume minimum of the mesh. | |
The bounding volume maximum of the mesh. | |
number |
The radius of the bounding volume of the mesh. |
box ( self ) : stingray.Matrix4x4, stingray.Vector3Returns an oriented bounding box that encloses all the vertices in the mesh.
|
self : | 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. |
The position and orientation of the center of the box. | |
The half-extents of the box along the X, Y and Z axes. |
Available only on Windows platforms, and only in development builds.
has_material ( self, slot_name ) : booleanIndicates whether or not the mesh contains a material slot with the specified name.
|
self : | 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. |
boolean |
Returns true if the mesh contains a material slot with the specified name, and false otherwise. |
Other related reference items
material ( self, slot ) : stingray.MaterialReturns the material that is assigned to the material slot you specify in the slot parameter.
|
self : | 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. |
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.
material_slot_name ( mesh, triangle_index ) : integerGets the material slot name for a specified triangle.
|
mesh : | The mesh to test. | |
triangle_index : | integer | The triangle to fetch the material for |
integer |
The material slot name for the specified triangle |
Available only on Windows platforms, and only in development builds.
num_materials ( self ) : integerReturns the number of material slots in the mesh.
|
self : | 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. |
integer |
The number of material slots in the mesh. |
Other related reference items
set_explicit_sort_value ( self, sort_value )Sets an explicit sort value for the mesh in the range [0-65535].
|
self : | 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. |
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.
set_shader_pass_flag ( self, flag, enabled )Determines whether or not the specified shader pass is enabled for the mesh.
|
self : | 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. |
This function does not return any values. |
visibility ( self ) : booleanReturns if the mesh is visible in the current render context.
|
self : | 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. |
boolean |
The visibility of the mesh. |
The functions in this group control the placement of an object of this type in the scene.
local_pose ( self ) : stingray.Matrix4x4Returns the position and orientation of the specified scene graph object in local space: i.e. relative to its parent in the scene graph.
|
self : | 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. |
The position and orientation of the object in local space. |
local_position ( self ) : stingray.Vector3Returns the position of the specified scene graph object in local space: i.e. relative to its parent in the scene graph.
|
self : | 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. |
The position of the object in local space. |
local_rotation ( self ) : stingray.QuaternionReturns the orientation of the specified scene graph object in local space: i.e. relative to its parent in the scene graph.
|
self : | 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. |
The rotation of the object in local space. |
node ( self ) : integerReturns the ID of the specified object within the scene graph.
|
self : | 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. |
integer |
The ID of the specified object in the scene graph. |
set_local_pose ( self, parent, pose )Sets the position and orientation of the specified scene graph object in local space: i.e. relative to its parent in the scene graph.
|
self : | 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 : | The parent Unit that owns this object. | |
pose : | The new position and orientation for the object in local space. |
This function does not return any values. |
set_local_position ( self, parent, position )Sets the position of the specified scene graph object in local space: i.e. relative to its parent in the scene graph.
|
self : | 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 : | The parent Unit that owns this object. | |
position : | The new position for the object in local space. |
This function does not return any values. |
set_local_rotation ( self, parent, rotation )Sets the orientation of the specified scene graph object in local space: i.e. relative to its parent in the scene graph.
|
self : | 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 : | The parent Unit that owns this object. | |
rotation : | The new rotation for the object in local space. |
This function does not return any values. |
world_pose ( self ) : stingray.Matrix4x4Returns the position and orientation of the specified scene graph object in world space.
|
self : | 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. |
The position and orientation of the object in world space. |
world_position ( self ) : stingray.Vector3Returns the position of the specified scene graph object in world space.
|
self : | 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. |
The position of the object in world space. |
world_rotation ( self ) : stingray.QuaternionReturns the rotation of the specified scene graph object in world space.
|
self : | 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. |
The rotation of the object in world space. |