diff --git a/src/utils.js b/src/utils.js index 8fa587b..1d28e44 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,3 @@ -import * as THREE from "three"; - function clone(obj) { if (Array.isArray(obj)) { return obj.map((el) => clone(el)); @@ -64,12 +62,4 @@ function prettyPrintVector(v, a, b) { return `${format(v[0], a, b)}, ${format(v[2], a, b)}, ${format(v[2], a, b)}`; } -function vector3(x = 0, y = 0, z = 0) { - return new THREE.Vector3(x, y, z); -} - -function quaternion(x = 0, y = 0, z = 0, w = 1) { - return new THREE.Quaternion(x, y, z, w); -} - -export { clone, isEqual, sceneTraverse, prettyPrintVector, vector3, quaternion }; +export { clone, isEqual, sceneTraverse, prettyPrintVector }; diff --git a/src/viewer.js b/src/viewer.js index 8ab63d8..2595d91 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -788,8 +788,8 @@ class Viewer { const theme = this.theme === "dark" || - (this.theme === "browser" && - window.matchMedia("(prefers-color-scheme: dark)").matches) + (this.theme === "browser" && + window.matchMedia("(prefers-color-scheme: dark)").matches) ? "dark" : "light"; @@ -2014,6 +2014,14 @@ class Viewer { // update the this this.update(true); } + + vector3(x = 0, y = 0, z = 0) { + return new THREE.Vector3(x, y, z); + } + + quaternion(x = 0, y = 0, z = 0, w = 1) { + return new THREE.Quaternion(x, y, z, w); + } } export { Viewer };