From 713556db95d2d87241aef1b8afe839ee4b7240ad Mon Sep 17 00:00:00 2001 From: Cody Persinger Date: Fri, 3 Apr 2020 10:45:49 -0500 Subject: [PATCH] Fix Compound body rotation format (#60), bump version number 0.4.1 --- package.json | 2 +- src/worker.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 799e472c..c851488e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "use-cannon", - "version": "0.4.0", + "version": "0.4.1", "description": "physics based hooks for react-three-fiber", "keywords": [ "cannon", diff --git a/src/worker.js b/src/worker.js index e5203fad..bd3ccc80 100644 --- a/src/worker.js +++ b/src/worker.js @@ -156,7 +156,7 @@ self.onmessage = (e) => { const shapeBody = body.addShape( createShape(type, args), position ? new Vec3(...position) : undefined, - rotation ? new Quaternion(...rotation) : undefined + rotation ? new Quaternion().setFromEuler(...rotation) : undefined ) if (material) shapeBody.material = new Material(material) Object.assign(shapeBody, extra) @@ -213,7 +213,7 @@ self.onmessage = (e) => { bodies[uuid].position.set(props[0], props[1], props[2]) break case 'setQuaternion': - bodies[uuid].quaternion.setFromEuler(props[0], props[1], props[2], 'XYZ') + bodies[uuid].quaternion.setFromEuler(props[0], props[1], props[2]) break case 'setVelocity': bodies[uuid].velocity.set(props[0], props[1], props[2])