Skip to content

Commit

Permalink
Fix Compound body rotation format (#60), bump version number 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
codynova committed Apr 3, 2020
1 parent e9712e2 commit 713556d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 713556d

Please sign in to comment.