Lysa  0.0
Lysa 3D Engine
MeshInstance Class Referenceabstract

Detailed Description

A scene object pairing a Mesh with a world-space transform and per-instance material overrides.

Lua full name: lysa.MeshInstance

Public Member Functions

Material|nil get_surface_material (surfaceIndex: integer)
 Returns the effective material for a surface (per-instance override if set, otherwise the mesh default). More...
 
nil set_surface_override_material (surfaceIndex: integer, id: integer)
 Sets a per-instance material override for the given surface; does not affect other instances. More...
 
nil remove_surface_override_material (surfaceIndex: integer)
 Removes the per-instance material override for the given surface, restoring the mesh default. More...
 

Properties

integer id
 Unique mesh instance identifier.
 
Mesh mesh
 The source mesh shared by this instance. (read-only)
 
boolean visible
 Whether this instance is included in rendering.
 
boolean cast_shadows
 Whether this instance contributes to shadow maps.
 
AABB aabb
 World-space axis-aligned bounding box of this instance.
 
float4x4 transform
 World-space transform matrix applied to the mesh.
 

Member Function Documentation

Material|nil get_surface_material ( integer  surfaceIndex)

Returns the effective material for a surface (per-instance override if set, otherwise the mesh default).

Parameters
surfaceIndexinteger
Returns
Material|nil
nil set_surface_override_material ( integer  surfaceIndex,
integer  id)

Sets a per-instance material override for the given surface; does not affect other instances.

Parameters
surfaceIndexinteger
idinteger
nil remove_surface_override_material ( integer  surfaceIndex)

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

Parameters
surfaceIndexinteger

Property Documentation

integer id

Unique mesh instance identifier.

Mesh mesh

The source mesh shared by this instance. (read-only)

boolean visible

Whether this instance is included in rendering.

boolean cast_shadows

Whether this instance contributes to shadow maps.

AABB aabb

World-space axis-aligned bounding box of this instance.

float4x4 transform

World-space transform matrix applied to the mesh.