char HTriangleMesh::readAftCreation(ATriangleMesh * tri) { readVector3Data(".p", tri->numPoints(), (Vector3F *)tri->points()); readIntData(".a", tri->numPoints(), (unsigned *)tri->anchors()); readIntData(".v", tri->numTriangles() * 3, (unsigned *)tri->indices()); return 1; }
char HTriangleMeshGroup::load(ATriangleMeshGroup * tri) { int npart = 1; readIntAttr(".npart", &npart); int nv = 3; readIntAttr(".nv", &nv); int nt = 1; readIntAttr(".ntri", &nt); tri->create(nv, nt, npart); readIntData(".pntdrift", npart, (unsigned *)tri->pointDrifts()); readIntData(".inddrift", npart, (unsigned *)tri->indexDrifts()); return HTriangleMesh::readAftCreation(tri); }
char HMesh::load(BaseMesh * mesh) { int numVertices = 3; readIntAttr(".nv", &numVertices); int numPolygons = 1; readIntAttr(".nf", &numPolygons); int numPolygonVertices = 3; readIntAttr(".nfv", &numPolygonVertices); int numUVs = 3; readIntAttr(".nuv", &numUVs); int numUVIds = 3; readIntAttr(".nuvid", &numUVIds); mesh->createVertices(numVertices); mesh->createPolygonCounts(numPolygons); mesh->createPolygonIndices(numPolygonVertices); readVector3Data(".p", numVertices, mesh->vertices()); readIntData(".polyc", numPolygons, mesh->polygonCounts()); readIntData(".polyv", numPolygonVertices, mesh->polygonIndices()); mesh->createPolygonUV(numUVs, numUVIds); readFloatData(".us", numUVs, mesh->us()); readFloatData(".vs", numUVs, mesh->vs()); readIntData(".uvids", numUVIds, mesh->uvIds()); mesh->processTriangleFromPolygon(); mesh->processQuadFromPolygon(); mesh->verbose(); return 1; }
char HPolygonalUV::load(APolygonalUV * poly) { int nuv = 3; readIntAttr(".nuv", &nuv); int nind = 1; readIntAttr(".nind", &nind); poly->create(nuv, nind); readFloatData(".ucoord", poly->numCoords(), poly->ucoord()); readFloatData(".vcoord", poly->numCoords(), poly->vcoord()); readIntData(".uvid", poly->numIndices(), poly->indices()); return 1; }