kripken / box2d.js

Port of Box2D to JavaScript using Emscripten
1.33k stars 196 forks source link

b2BodyDef.set_position does not work. #22

Closed Fishrock123 closed 11 years ago

Fishrock123 commented 11 years ago

These all create a body at 0, 0

 _bodyDef.set_position(0, 0)
 _bodyDef.set_position(200 , -9000)
 _bodyDef.set_position(40, 50)
 _bodyDef.set_position(-60, -20)
 _bodyDef.set_position(x, y)
jackwakefield commented 11 years ago

You have to pass the the position as a b2Vec2

_bodyDef.set_position(new Box2D.b2Vec2(200 , -9000));
Joncom commented 11 years ago

This should be closed because set_position functions exactly as it is supposed to.