Skip to content

@modoki/engine / index / createPrimitiveMesh

Function: createPrimitiveMesh() ​

createPrimitiveMesh(meshName, size, color, skipDefaultMaterial?): Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap> | null

Create a Three.js mesh for a primitive. If skipDefaultMaterial is true, the mesh is returned with a throwaway material reference that the caller is expected to replace immediately — useful when an override material is already known so we avoid alloc+dispose churn.

Parameters ​

meshName ​

string

size ​

number

color ​

number

skipDefaultMaterial? ​

boolean = false

Returns ​

Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap> | null

Built with Modoki.