bindSkeleton method

dynamic bindSkeleton(
  1. dynamic skeletons,
  2. dynamic geometryMap,
  3. dynamic modelMap
)

Implementation

bindSkeleton(skeletons, geometryMap, modelMap) {
  var bindMatrices = parsePoseNodes();

  for (var id in skeletons.keys) {
    var skeleton = skeletons[id];

    var parents = connections[parseInt(skeleton["ID"])]["parents"];

    parents.forEach((parent) {
      if (geometryMap.containsKey(parent["ID"])) {
        var geoID = parent["ID"];
        var geoRelationships = connections[geoID];

        geoRelationships["parents"].forEach((geoConnParent) {
          if (modelMap.containsKey(geoConnParent["ID"])) {
            var model = modelMap[geoConnParent["ID"]];

            model.bind(Skeleton(List<Bone>.from(skeleton["bones"])), bindMatrices[geoConnParent["ID"]]);
          }
        });
      }
    });
  }
}