Skip to content
Snippets Groups Projects
Commit d81fa05e authored by Robert Long's avatar Robert Long
Browse files

Don't reuse the box-collider orientation quaternion.

parent 309fbeb0
No related branches found
No related tags found
No related merge requests found
...@@ -34,11 +34,10 @@ AFRAME.GLTFModelPlus.registerComponent( ...@@ -34,11 +34,10 @@ AFRAME.GLTFModelPlus.registerComponent(
"shape", "shape",
(() => { (() => {
const euler = new THREE.Euler(); const euler = new THREE.Euler();
const orientation = new THREE.Quaternion();
return (el, componentName, componentData) => { return (el, componentName, componentData) => {
const { scale, rotation } = componentData; const { scale, rotation } = componentData;
euler.set(rotation.x, rotation.y, rotation.z); euler.set(rotation.x, rotation.y, rotation.z);
orientation.setFromEuler(euler); const orientation = new THREE.Quaternion().setFromEuler(euler);
el.setAttribute(componentName, { el.setAttribute(componentName, {
shape: "box", shape: "box",
offset: componentData.position, offset: componentData.position,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment