nativeReadFrom method
void
nativeReadFrom(
- MeshC p
)
override
Implementation
@override
void nativeReadFrom(MeshC p) {
structOnOp((o) {
o.ref.vertexCount = p.vertexCount;
o.ref.triangleCount = p.triangleCount;
o.ref.boneCount = p.boneCount;
o.ref.vertices = p.vertices;
o.ref.texcoords = p.texcoords;
o.ref.texcoords2 = p.texcoords2;
o.ref.normals = p.normals;
o.ref.tangents = p.tangents;
o.ref.colors = p.colors;
o.ref.indices = p.indices;
o.ref.animVertices = p.animVertices;
o.ref.animNormals = p.animNormals;
o.ref.boneIds = p.boneIds;
o.ref.boneWeights = p.boneWeights;
o.ref.boneMatrices = p.boneMatrices;
o.ref.vboId = p.vboId;
});
vertexCount = p.vertexCount;
triangleCount = p.triangleCount;
boneCount = p.boneCount;
if (vertexCount > 0 && p.vertices.address != 0) vertices = .generate(verticesCount, (i) => (p.vertices + i).value);
if (vertexCount > 0 && p.texcoords.address != 0) texcoords = .generate(texcoordsCount, (i) => (p.texcoords + i).value);
if (vertexCount > 0 && p.texcoords2.address != 0) texcoords2 = .generate(texcoords2Count, (i) => (p.texcoords2 + i).value);
if (vertexCount > 0 && p.normals.address != 0) normals = .generate(normalsCount, (i) => (p.normals + i).value);
if (vertexCount > 0 && p.tangents.address != 0) tangents = .generate(tangentsCount, (i) => (p.tangents + i).value);
if (vertexCount > 0 && p.colors.address != 0) colors = .generate(colorsCount, (i) => (p.colors + i).value);
if (triangleCount > 0 && p.indices.address != 0) indices = .generate(indicesCount, (i) => (p.indices + i).value);
if (vertexCount > 0 && p.animVertices.address != 0) animVertices = .generate(animVerticesCount, (i) => (p.animVertices + i).value);
if (vertexCount > 0 && p.animNormals.address != 0) animNormals = .generate(animNormalsCount, (i) => (p.animNormals + i).value);
if (vertexCount > 0 && p.boneIds.address != 0) boneIds = .generate(boneIdsCount, (i) => (p.boneIds + i).value);
if (vertexCount > 0 && p.boneWeights.address != 0) boneWeights = .generate(boneWeightsCount, (i) => (p.boneWeights + i).value);
if (p.boneMatrices.address != 0) boneMatrices = .generate(boneMatricesCount, (i) => (p.boneMatrices + i).toD());
vaoId = p.vaoId;
if (p.vboId.address != 0) vboId = .generate(vboIdCount, (i) => (p.vboId + i).value);
}