Skip to content

Commit

Permalink
Examples updated, now with a simple Point to point constraint.
Browse files Browse the repository at this point in the history
  • Loading branch information
dukuo committed Mar 8, 2020
1 parent 43fd363 commit 7f6dc14
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
9 changes: 9 additions & 0 deletions examples/spark/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "entry",
"corejs": 3
}
]
],
"plugins": ["@babel/plugin-transform-object-assign"]
}
13 changes: 9 additions & 4 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,6 +10,7 @@
"start": "npm run dev"
},
"dependencies": {
"core-js": "^3.6.4",
"physar": "file:../..",
"short-uuid": "^3.1.1",
"webpack": "^4.41.6"
Expand All @@ -23,7 +24,6 @@
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.0-beta.6",
"babel-plugin-transform-class-properties": "^6.24.1",
"core-js": "^2.5.2",
"regenerator-runtime": "^0.13.3",
"webpack-cli": "^3.3.11"
}
Expand Down
9 changes: 8 additions & 1 deletion examples/spark/physar_examples/scripts/script.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions examples/spark/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import Physar from 'physar'

const Scene = require('Scene');
Expand Down Expand Up @@ -62,5 +61,10 @@ physar.createObject(plane, 'ground', groundProps)
const sphereID = physar.createObject(sphere, 'sphere', sphereProps)
const boxID = physar.createObject(cube, 'box', cubeProps)

const constraint = physar.addConstraint('point', sphereID, boxID)
const constraintProps = {
bodyA: sphereID,
bodyB: boxID
}

const constraint = physar.createConstraint('point', constraintProps)
physar.start()

0 comments on commit 7f6dc14

Please sign in to comment.