Update Examples

This commit is contained in:
2026-10-25 12:04:24 -07:00
parent 0c116b8c60
commit b6551ad24c
218 changed files with 224 additions and 13 deletions

View File

@ -15,7 +15,7 @@ class MoveBoneFK extends iron.Trait {
// Fetch armature animation
var anim = cast(object.children[0].animation, BoneAnimation);
// Fetch bone
var bone = anim.getBone("mixamorig:RightLnx");
var bone = anim.getBone("mixamorig:RightArm");
// Manipulating bone in local space
//var m = anim.getBoneMat(bone);
@ -27,7 +27,7 @@ class MoveBoneFK extends iron.Trait {
// Manipulating bone in world space
anim.notifyOnUpdate(function() {
// Get bone mat in world space
var m = anim.getAbsWorldMat(bone);
var m = anim.getAbsWorldMat(anim.skeletonMats, bone);
// Decompose transform
var loc = new Vec4();
var scl = new Vec4();
@ -39,7 +39,7 @@ class MoveBoneFK extends iron.Trait {
// Compose world matrix
m.compose(loc, rot, scl);
// Set bone matrix from world matrix
anim.setBoneMatFromWorldMat(m, bone);
anim.setBoneMatFromWorldMat(anim.skeletonMats, m, bone);
});
});
}

View File

@ -21,7 +21,7 @@ class MoveBoneIK extends iron.Trait {
anim.notifyOnUpdate(function() {
goal.set(tr.worldx(), tr.worldy(), tr.worldz());
// Align skeleton to touch the goal
anim.solveIK(bone, goal);
anim.solveIK(anim.skeletonMats, bone, goal);
});
});
}