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
  };
}