API Docs for: 0.6.1
Show:

Demo Class

Defined in: src/demo/Demo.js:5

Demo framework class. If you want to learn how to connect Cannon.js with Three.js, please look at the examples/ instead.

Constructor

Demo

(
  • options
)

Defined in src/demo/Demo.js:5

Parameters:

  • options Object

Item Index

Methods

addScene

(
  • title
  • initfunc
)

Add a scene to the demo app

Parameters:

  • title String

    Title of the scene

  • initfunc Function

    A function that takes one argument, app, and initializes a physics scene. The function runs app.setWorld(body), app.addVisual(body), app.removeVisual(body) etc.

restartCurrentScene

()

Restarts the current scene