josephg / Chipmunk-js

Port of slembcke/Chipmunk-Physics to Javascript
http://dl.dropbox.com/u/2494815/demo/Joints.html
536 stars 59 forks source link

Cannot create a body #44

Open rayzchen opened 4 years ago

rayzchen commented 4 years ago

I downloaded the cp.min.js file, then tried to create a body. Then I get an error Uncaught TypeError: this.setMass is not a function. I use cp.js and the same error happens. I delete all other libraries that I'm using, and still it doesn't work. To reproduce:

var space = new cp.Space();
var mass = 100;
var radius = 25;
var moment = cp.momentForCircle(mass, 20, radius, cp.vzero);
var body = cp.Body(mass, moment);

image I am using Chrome.