Bugfix: fix for IK constraint: rotation locks are now applied only on
boned woning the constraint and not to all that define it as it was before.
This commit is contained in:
parent
f9be42ee62
commit
cd97741f9c
@ -88,6 +88,8 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
|
||||
if (angle != 0) {
|
||||
Vector3d cross = currentDir.crossLocal(target).normalizeLocal();
|
||||
q.fromAngleAxis(angle, cross);
|
||||
|
||||
if(bone.equals(this.getOwner())) {
|
||||
if (boneContext.isLockX()) {
|
||||
q.set(0, q.getY(), q.getZ(), q.getW());
|
||||
}
|
||||
@ -97,6 +99,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
|
||||
if (boneContext.isLockZ()) {
|
||||
q.set(q.getX(), q.getY(), 0, q.getW());
|
||||
}
|
||||
}
|
||||
|
||||
boneTransform.getRotation().set(q.multLocal(boneTransform.getRotation()));
|
||||
constraintHelper.applyTransform(boneContext.getArmatureObjectOMA(), bone.getName(), Space.CONSTRAINT_SPACE_WORLD, boneTransform.toTransform());
|
||||
@ -124,6 +127,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
|
||||
Vector3d cross = currentDir.crossLocal(target).normalizeLocal();
|
||||
q.fromAngleAxis(angle, cross);
|
||||
|
||||
if(bone.equals(this.getOwner())) {
|
||||
if (boneContext.isLockX()) {
|
||||
q.set(0, q.getY(), q.getZ(), q.getW());
|
||||
}
|
||||
@ -133,6 +137,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
|
||||
if (boneContext.isLockZ()) {
|
||||
q.set(q.getX(), q.getY(), 0, q.getW());
|
||||
}
|
||||
}
|
||||
|
||||
boneWorldTransform.getRotation().set(q.multLocal(boneWorldTransform.getRotation()));
|
||||
constraintHelper.applyTransform(boneContext.getArmatureObjectOMA(), bone.getName(), Space.CONSTRAINT_SPACE_WORLD, boneWorldTransform.toTransform());
|
||||
|
Loading…
x
Reference in New Issue
Block a user