addMorphTargets method

dynamic addMorphTargets(
  1. dynamic parentGeo,
  2. dynamic parentGeoNode,
  3. dynamic morphTargets,
  4. dynamic preTransform,
)

Implementation

addMorphTargets(parentGeo, parentGeoNode, morphTargets, preTransform) {
  if (morphTargets.length == 0) return;

  parentGeo.morphTargetsRelative = true;

  parentGeo.morphAttributes.position = [];
  // parentGeo.morphAttributes.normal = []; // not implemented

  var scope = this;
  morphTargets.forEach((morphTarget) {
    morphTarget.rawTargets.forEach((rawTarget) {
      var morphGeoNode = fbxTree.Objects["Geometry"][rawTarget.geoID];

      if (morphGeoNode != null) {
        scope.genMorphGeometry(parentGeo, parentGeoNode, morphGeoNode,
            preTransform, rawTarget.name);
      }
    });
  });
}