AutoMovie API
    Preparing search index...

    Function meshOf

    • Wrap a procedural builder's positions and indices as a rigid mesh whose vertex normals are computed from its own triangles.

      Each vertex normal is the normalized sum of its incident triangles' unnormalized face normals, so larger faces weigh more and the winding decides the side. normalGroups lists vertices that duplicate one smooth point at a texture seam; their sums are pooled before normalizing so the seam carries one normal while its positions and UVs stay separate. A vertex no triangle uses keeps the zero vector. The arrays passed in become the mesh's own and must not be reused by the caller; indices are trusted, since every caller generates them.

      Parameters

      • positions: number[]

        Packed XYZ positions in metres, adopted by the mesh.

      • indices: number[]

        Triangle corner indices, adopted by the mesh.

      • uvs: number[] | null = null

        Packed UVs adopted by the mesh, or null for none.

      • normalGroups: readonly (readonly number[])[] = []

        Vertex sets that share one smooth normal.

      Returns IAutoMovieMesh

      A mesh with computed normals and no skin.