Submeshes for tiled ground

In the docs for tiled ground, submeshes are pushed to the mesh.subMeshes array. This isn’t needed and causes duplicate items in array.

    for (let row = 0; row < grid.h; row++) {
        for (let col = 0; col < grid.w; col++) {
            tiledGround.subMeshes.push(new BABYLON.SubMesh(
                row % 2 ^ col % 2, 
                0, verticesCount, 
                base , 
                tileIndicesLength, 
                tiledGround));
            base += tileIndicesLength;
        }
    }

This pg creates submeshes correctly Babylon.js Playground

Good find!

Do you want to make a PR to fix the problem?

Done.

3 Likes