parseNormals method

dynamic parseNormals(
  1. Map NormalNode
)

Implementation

parseNormals(Map NormalNode) {
  var mappingType = NormalNode["MappingInformationType"];
  var referenceType = NormalNode["ReferenceInformationType"];
  var buffer = NormalNode["Normals"]["a"];
  var indexBuffer = [];
  if (referenceType == 'IndexToDirect') {
    if (NormalNode["NormalIndex"] != null) {
      indexBuffer = NormalNode["NormalIndex"]["a"];
    } else if (NormalNode["NormalsIndex"] != null) {
      indexBuffer = NormalNode["NormalsIndex"]["a"];
    }
  }

  return {
    "dataSize": 3,
    "buffer": buffer,
    "indices": indexBuffer,
    "mappingType": mappingType,
    "referenceType": referenceType
  };
}