getData function

dynamic getData(
  1. dynamic polygonVertexIndex,
  2. dynamic polygonIndex,
  3. dynamic vertexIndex,
  4. dynamic infoObject,
)

Implementation

getData(polygonVertexIndex, polygonIndex, vertexIndex, infoObject) {
  var index;

  switch (infoObject["mappingType"]) {
    case 'ByPolygonVertex':
      index = polygonVertexIndex;
      break;
    case 'ByPolygon':
      index = polygonIndex;
      break;
    case 'ByVertice':
      index = vertexIndex;
      break;
    case 'AllSame':
      index = infoObject.indices[0];
      break;
    default:
      print('THREE.FBXLoader: unknown attribute mapping type ${infoObject["mappingType"]}');
  }

  if (infoObject["referenceType"] == 'IndexToDirect') index = infoObject["indices"][index];

  var from = index * infoObject["dataSize"];
  var to = from + infoObject["dataSize"];

  return slice(dataArray, infoObject["buffer"], from, to);
}