Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dukuo committed Mar 8, 2020
1 parent 3dd343f commit 596fef0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions examples/spark/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/spark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "npm run dev"
},
"dependencies": {
"physar": "^0.1.2",
"physar": "^0.1.9-0",
"short-uuid": "^3.1.1",
"webpack": "^4.41.6"
},
Expand Down
6 changes: 4 additions & 2 deletions examples/spark/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const groundProps = {
}
}
physar.createObject(plane, 'ground', groundProps)
physar.createObject(sphere, 'sphere', sphereProps)
physar.createObject(cube, 'box', cubeProps)
const sphereID = physar.createObject(sphere, 'sphere', sphereProps)
const boxID = physar.createObject(cube, 'box', cubeProps)

const constraint = physar.addConstrait(sphereID, boxID)
physar.start()
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default class Physar {
// We need at least two bodies to make a constraint.
if ( !params.bodyA || !params.bodyB) return

let { bodyA, bodyB, pivotA, pivotB, axisA, axisB } = params
let [bodyA, bodyB, pivotA, pivotB, axisA, axisB] = params
const options = {
pivotA,
pivotB,
Expand Down Expand Up @@ -404,12 +404,12 @@ export default class Physar {

resumeConstraint(id) {
const c = this.find('constraint', id)
const {id, constraint} = c
const [id, constraint] = c

if(c && c.isActive == false) {

this.world.addConstraint(constraint)

const idx = this.worldConstraints.indexOf(c)
this.worldConstraints[idx].isActive = true
}
Expand Down

0 comments on commit 596fef0

Please sign in to comment.