pose method

void pose()

Returns the skeleton to the base pose.

Implementation

void pose() {
  // recover the bind-time world matrices

  for (int i = 0, il = bones.length; i < il; i++) {
    final bone = bones[i];
    bone.matrixWorld..setFrom(boneInverses[i])..invert();
  }

  // compute the local matrices, positions, rotations and scales

  for (int i = 0, il = bones.length; i < il; i++) {
    final bone = bones[i];
    if (bone.parent != null && bone.parent is Bone) {
      bone.matrix..setFrom(bone.parent!.matrixWorld)..invert();
      bone.matrix.multiply(bone.matrixWorld);
    } else {
      bone.matrix.setFrom(bone.matrixWorld);
    }

    bone.matrix.decompose(bone.position, bone.quaternion, bone.scale);
  }
}