• Generates tangent information from the specified positions, normals, texture coordinates and triangle indices. See createMesh.

    Parameters

    • positions: number[]

      An array of 3-dimensional vertex positions.

    • normals: number[]

      An array of 3-dimensional vertex normals.

    • uvs: number[]

      An array of 2-dimensional vertex texture coordinates.

    • indices: number[]

      An array of triangle indices.

    Returns number[]

    An array of 3-dimensional vertex tangents.

    Example

    const tangents = pc.calculateTangents(positions, normals, uvs, indices);
    const mesh = pc.createMesh(graphicsDevice, positions, {
    normals: normals,
    tangents: tangents,
    uvs: uvs,
    indices: indices
    });