Lysa.nodes  0.0
Lysa 3D Engine
MeshInstance Class Referenceabstract

Detailed Description

A renderable node that pairs a GPU Mesh with a scene-tree transform and per-surface material overrides.

Inherits from: Node

Lua full name: lysa.nodes.MeshInstance

Public Member Functions

MeshInstance create (mesh: lysa.Mesh)static
 Creates a new MeshInstance from the given Mesh. More...
 
MeshInstance create (mesh: lysa.Mesh, name: string)static
 Creates a named MeshInstance from the given Mesh. More...
 
lysa.Material get_surface_material (index: integer)
 Returns the effective material for the given surface (override if set, otherwise the mesh default). More...
 
nil set_surface_override_material (index: integer, material: lysa.Material|lysa.StandardMaterial|lysa.ShaderMaterial|nil)
 Sets a per-instance material override for the given surface index; pass nil to clear. More...
 
lysa.Material|nil get_surface_override_material (index: integer)
 Returns the per-instance override material for the given surface index, or nil if none is set. More...
 
nil remove_surface_override_material (index: integer)
 Removes the per-instance override material for the given surface, restoring the mesh default. More...
 

Properties

lysa.Mesh mesh
 The GPU Mesh used by this instance. (read-only)
 
lysa.AABB aabb
 World-space axis-aligned bounding box of this instance. (read-only)
 
boolean cast_shadows
 Whether this instance contributes to shadow maps.
 

Member Function Documentation

MeshInstance create ( lysa.Mesh  mesh)
static

Creates a new MeshInstance from the given Mesh.

Parameters
meshlysa.Mesh
Returns
MeshInstance
MeshInstance create ( lysa.Mesh  mesh,
string  name)
static

Creates a named MeshInstance from the given Mesh.

Parameters
meshlysa.Mesh
namestring
Returns
MeshInstance
lysa.Material get_surface_material ( integer  index)

Returns the effective material for the given surface (override if set, otherwise the mesh default).

Parameters
indexinteger
Returns
lysa.Material
nil set_surface_override_material ( integer  index,
lysa.Material|lysa.StandardMaterial|lysa.ShaderMaterial|nil  material)

Sets a per-instance material override for the given surface index; pass nil to clear.

Parameters
indexinteger
materiallysa.Material|lysa.StandardMaterial|lysa.ShaderMaterial|nil
lysa.Material|nil get_surface_override_material ( integer  index)

Returns the per-instance override material for the given surface index, or nil if none is set.

Parameters
indexinteger
Returns
lysa.Material|nil
nil remove_surface_override_material ( integer  index)

Removes the per-instance override material for the given surface, restoring the mesh default.

Parameters
indexinteger

Property Documentation

lysa.Mesh mesh

The GPU Mesh used by this instance. (read-only)

lysa.AABB aabb

World-space axis-aligned bounding box of this instance. (read-only)

boolean cast_shadows

Whether this instance contributes to shadow maps.