Update Examples
This commit is contained in:
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user