Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
xianfei committed Jul 18, 2024
1 parent e107208 commit 3e0af12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mocaprender/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const rigRotation = (
};
}
const bindingFunc = modelObj.binding[name].func;
const order = modelObj.binding[name].order.toUpperCase();
const order = modelObj.binding[name].order?.toUpperCase();
const x = rotation.x * dampener;
const y = rotation.y * dampener;
const z = rotation.z * dampener;
Expand Down
7 changes: 5 additions & 2 deletions render/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,19 @@ const rigRotation = (
z: b.rotation.z,
};
}
var bindingFunc = modelObj.binding[name].func;
const bindingFunc = modelObj.binding[name].func;
const order = modelObj.binding[name].order?.toUpperCase();
const x = rotation.x * dampener;
const y = rotation.y * dampener;
const z = rotation.z * dampener;

// console.log("rotation.rotationOrder ",rotation.rotationOrder )

let euler = new THREE.Euler(
initRotation[name].x + eval(bindingFunc.fx),
initRotation[name].y + eval(bindingFunc.fy),
initRotation[name].z + eval(bindingFunc.fz),
rotation.rotationOrder || "XYZ"
order || rotation.rotationOrder || "XYZ"
);
let quaternion = new THREE.Quaternion().setFromEuler(euler);
b.quaternion.slerp(quaternion, lerpAmount); // interpolate
Expand Down

0 comments on commit 3e0af12

Please sign in to comment.