Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistake in Docs #107

Closed
Devang47 opened this issue Sep 25, 2021 · 0 comments · Fixed by #108
Closed

Mistake in Docs #107

Devang47 opened this issue Sep 25, 2021 · 0 comments · Fixed by #108

Comments

@Devang47
Copy link

In Getting started in Cannon-es docs
Code is

const groundBody = new CANNON.Body({
  type: Body.STATIC,
  shape: new CANNON.Plane(),
})
groundBody.quaternion.setFromEuler(-Math.PI / 2, 0, 0) // make it face up
world.addBody(groundBody)

It throws Uncaught ReferenceError: Body is not defined
Whereas it should be:

const groundBody = new CANNON.Body({
   type: CANNON.Body.STATIC,
   shape: new CANNON.Plane()
})
groundBody.quaternion.setFromEuler(-Math.PI / 2, 0, 0)
world.addBody(groundBody)

Cause we aren't importing Body directly into our script.
Same mistake here:
Group 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant