diff --git a/package.json b/package.json index b23b8e9..2359770 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "troisjs", - "version": "0.2.1", + "version": "0.2.2", "scripts": { "dev": "vite", "build": "vite build", @@ -11,6 +11,7 @@ "@rollup/plugin-replace": "^2.3.3", "@vitejs/plugin-vue": "^1.2.1", "@vue/compiler-sfc": "^3.0.11", + "cannon": "^0.6.2", "eslint": "^7.7.0", "eslint-config-airbnb-base": "^14.2.0", "eslint-config-standard": "^14.1.1", diff --git a/src/components/physics/useCannon.js b/src/components/physics/useCannon.js index 3cb27e1..380cd27 100644 --- a/src/components/physics/useCannon.js +++ b/src/components/physics/useCannon.js @@ -28,6 +28,7 @@ export default function useCannon(options) { removeMesh, step, }; + return obj; function addMesh(mesh) { const shape = getShape(mesh.geometry); @@ -189,6 +190,4 @@ export default function useCannon(options) { iMatrix[index + 14] = position.z; iMatrix[index + 15] = 1; } - - return obj; } diff --git a/src/core/Renderer.js b/src/core/Renderer.js index 81dd73d..b40bc95 100644 --- a/src/core/Renderer.js +++ b/src/core/Renderer.js @@ -61,6 +61,8 @@ export default defineComponent({ this.onMountedCallbacks.forEach(c => c()); }, beforeUnmount() { + this.beforeRenderCallbacks = []; + this.afterRenderCallbacks = []; this.raf = false; this.three.dispose(); },