MeshD constructor

MeshD({
  1. WasmStructPointer<MeshD>? originalPointer,
  2. int vertexCount = 0,
  3. int triangleCount = 0,
  4. int boneCount = 0,
  5. List<double>? vertices,
  6. List<double>? texcoords,
  7. List<double>? texcoords2,
  8. List<double>? normals,
  9. List<double>? tangents,
  10. List<int>? colors,
  11. List<int>? indices,
  12. List<double>? animVertices,
  13. List<double>? animNormals,
  14. List<int>? boneIds,
  15. List<double>? boneWeights,
  16. List<MatrixD>? boneMatrices,
  17. int vaoId = 0,
  18. List<int>? vboId,
})

Implementation

MeshD({
  super.originalPointer,
  int vertexCount = 0,
  int triangleCount = 0,
  int boneCount = 0,
  List<double>? vertices,
  List<double>? texcoords,
  List<double>? texcoords2,
  List<double>? normals,
  List<double>? tangents,
  List<int>? colors,
  List<int>? indices,
  List<double>? animVertices,
  List<double>? animNormals,
  List<int>? boneIds,
  List<double>? boneWeights,
  List<MatrixD>? boneMatrices,
  int vaoId = 0,
  List<int>? vboId,
}) :
  _vertexCount = vertexCount,
  _triangleCount = triangleCount,
  _boneCount = boneCount,
  _vaoId = vaoId
{
  _vertices = .new(
    vertices ?? .filled(verticesCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.vertices]).pointer())
  );

  _texcoords = .new(
    texcoords ?? .filled(texcoordsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.texcoords]).pointer())
  );

  _texcoords2 = .new(
    texcoords2 ?? .filled(texcoords2Count, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.texcoords2]).pointer())
  );

  _normals = .new(
    normals ?? .filled(normalsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.normals]).pointer())
  );

  _tangents = .new(
    tangents ?? .filled(tangentsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.tangents]).pointer())
  );

  _colors = .new(
    colors ?? .filled(colorsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.colors]).pointer())
  );

  _indices = .new(
    indices ?? .filled(indicesCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.indices]).pointer())
  );

  _animVertices = .new(
    animVertices ?? .filled(animVerticesCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.animVertices]).pointer())
  );

  _animNormals = .new(
    animNormals ?? .filled(animNormalsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.animNormals]).pointer())
  );

  _boneIds = .new(
    boneIds ?? .filled(boneIdsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.boneIds]).pointer())
  );

  _boneWeights = .new(
    boneWeights ?? .filled(boneWeightsCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.boneWeights]).pointer())
  );

  _boneMatrices = .new(
    boneMatrices ?? [],
    originalPointer == null ? null : MatrixD.wasmPointer(wasmReader(_o[.boneMatrices]).pointer())
  );

  _vboId = .new(
    vboId ?? .filled(vboIdCount, 0),
    originalPointer == null ? null : .new(wasmReader(_o[.vboId]).pointer())
  );
}