Documentation / @sw-file-lib/three / createSwMesh
Function: createSwMesh()
ts
function createSwMesh(mesh: MeshData, options?: CreateSwMeshOptions): Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap>[]>;Defined in: mesh.ts:25
Create a renderable Three.js mesh from parsed Stormworks mesh data.
The returned mesh owns its geometry. It uses material groups mapped from the file's group shader ids: opaque, glass, and additive.
Parameters
| Parameter | Type |
|---|---|
mesh | MeshData |
options | CreateSwMeshOptions |
Returns
Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material<MaterialEventMap>[]>