Last active
April 20, 2017 17:39
-
-
Save fmnxl/e7d706645c01b8f813d6ac101a49ea52 to your computer and use it in GitHub Desktop.
Creating a Cannon.Body and adding it into a Cannon.World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a World | |
var world = new CANNON.World() | |
// Create a Body | |
var mass = 1 | |
var radius = 1 | |
var position = new CANNON.Vec3(0, 0, -3) | |
var shape = new CANNON.Sphere(radius) | |
var body = new CANNON.Body({ mass, position, shape }) | |
// Add the body to the world | |
world.addBody(body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment