Add setCurrentPoseAsRest
@@ -1140,4 +1140,11 @@ export class Bone extends Node {
Vector3.TransformCoordinatesToRef(position, tmat, result);
}
+
+ /**
+ * Set the current local matrix as the restPose for this bone.
+ */
+ public setCurrentPoseAsRest(): void {
+ this.setRestPose(this.getLocalMatrix());
+ }
@@ -880,4 +880,13 @@ export class Skeleton implements IAnimatable {
bones.push(bone);
+ * Set the current local matrix as the restPose for all bones in the skeleton.
+ this.bones.forEach((b) => {
+ b.setCurrentPoseAsRest();
+ });