(vertices: number[], indices: number[])
| 646 | } |
| 647 | |
| 648 | export function createMesh(vertices: number[], indices: number[]): Model { |
| 649 | // vertices: flat array of [x,y,z, nx,ny,nz, r,g,b,a, u,v] per vertex (12 floats each) |
| 650 | // NOTE: `vertices.length` and `indices.length` here only return the |
| 651 | // correct value for arrays built via literals or `new Array(N)` + |
| 652 | // index assignment. Arrays built via `.push()` reflect the LITERAL |
| 653 | // initialization size as `.length`, not the post-push size (a |
| 654 | // Perry codegen bug). For `.push`-built data, use createMeshExplicit |
| 655 | // and pass the counts manually. |
| 656 | const handle = bloom_create_mesh(vertices as any, vertices.length / 12, indices as any, indices.length); |
| 657 | return makeModel(handle, 1, 1); |
| 658 | } |
| 659 | |
| 660 | /// Explicit-count variant of createMesh — pass `vertexCount` (number |
| 661 | /// of complete 12-float vertex records) and `indexCount` directly. |
no test coverage detected