Skip to content

@modoki/engine / index / getEntityMaterials

Function: getEntityMaterials() ​

getEntityMaterials(world, id): Material[]

All live materials for id across every surface of world (a mesh with a material array contributes each element). De-duplicated: the SAME material instance is often shared across both surfaces (materials come from a shared cache; only geometry is per-renderer), so returning it once is correct.

Parameters ​

world ​

World

id ​

number

Returns ​

Material[]

Built with Modoki.