writeInto method

  1. @override
void writeInto(
  1. MeshC p
)
override

Writes all fields directly into the native struct reference p. For nested structs, use writeInto as well.

Implementation

@override
void writeInto(MeshC p) {
  p.vertexCount = vertexCount;
  p.triangleCount = triangleCount;
  p.triangleCount = triangleCount;
  p.boneCount = boneCount;
  p.vaoId = vaoId;

  onOriginalPointer((o) {
    p.vertexCount = o.ref.vertexCount;
    p.triangleCount = o.ref.triangleCount;
    p.triangleCount = o.ref.triangleCount;
    p.boneCount = o.ref.boneCount;
    p.vaoId = o.ref.vaoId;

    p.vertices = o.ref.vertices;
    p.texcoords = o.ref.texcoords;
    p.texcoords2 = o.ref.texcoords2;
    p.normals = o.ref.normals;
    p.tangents = o.ref.tangents;
    p.colors = o.ref.colors;
    p.indices = o.ref.indices;
    p.animVertices = o.ref.animVertices;
    p.animNormals = o.ref.animNormals;
    p.boneIds = o.ref.boneIds;
    p.boneWeights = o.ref.boneWeights;
    p.boneMatrices = o.ref.boneMatrices;
    p.vboId = o.ref.vboId;
  });

  if (p.vertices.address != 0) {
    for (int i = 0; i < vertices.length; i++) {
      p.vertices[i] = vertices[i];
    }
  }

  if (p.texcoords.address != 0) {
    for (int i = 0; i < texcoords.length; i++) {
      p.texcoords[i] = texcoords[i];
    }
  }

  if (p.texcoords2.address != 0) {
    for (int i = 0; i < texcoords2.length; i++) {
      p.texcoords2[i] = texcoords2[i];
    }
  }

  if (p.normals.address != 0) {
    for (int i = 0; i < normals.length; i++) {
      p.normals[i] = normals[i];
    }
  }

  if (p.tangents.address != 0) {
    for (int i = 0; i < tangents.length; i++) {
      p.tangents[i] = tangents[i];
    }
  }

  if (p.colors.address != 0) {
    for (int i = 0; i < colors.length; i++) {
      p.colors[i] = colors[i];
    }
  }

  if (p.indices.address != 0) {
    for (int i = 0; i < indices.length; i++) {
      p.indices[i] = indices[i];
    }
  }

  if (p.animVertices.address != 0) {
    for (int i = 0; i < animVertices.length; i++) {
      p.animVertices[i] = animVertices[i];
    }
  }

  if (p.animNormals.address != 0) {
    for (int i = 0; i < animNormals.length; i++) {
      p.animNormals[i] = animNormals[i];
    }
  }

  if (p.boneIds.address != 0) {
    for (int i = 0; i < boneIds.length; i++) {
      p.boneIds[i] = boneIds[i];
    }
  }

  if (p.boneWeights.address != 0) {
    for (int i = 0; i < boneWeights.length; i++) {
      p.boneWeights[i] = boneWeights[i];
    }
  }

  if (p.boneMatrices.address != 0) {
    for (int i = 0; i < boneMatrices.length; i++) {
      boneMatrices[i].writeInto((p.boneMatrices + i).ref);
    }
  }

  if (p.vboId.address != 0) {
    for (int i = 0; i < vboId.length; i++) {
      p.vboId[i] = vboId[i];
    }
  }
}