Birch-san/box2d-wasm

Function `b2Body::ApplyLinearImpulseToCenter` missing

BlueNebulaDev opened this issue · 3 comments

b2Body::ApplyLinearImpulseToCenter seems to be missing.

It's absolutely not a problem, as it's trivial to use b2Body::ApplyLinearImpulse instead, but I thought it was a good idea to report a missing function.

hmmm yeah; you're right:

void ApplyForce([Ref] b2Vec2 force, [Ref] b2Vec2 point, boolean awake);
void ApplyForceToCenter([Ref] b2Vec2 force, boolean awake);
void ApplyTorque(float torque, boolean awake);
void ApplyLinearImpulse([Ref] b2Vec2 impulse, [Ref] b2Vec2 point, boolean awake);
void ApplyAngularImpulse(float impulse, boolean awake);

https://github.com/erincatto/box2d/blob/cd2c28dba83e4f359d08aeb7b70afd9e35e39eda/include/box2d/b2_body.h#L229

looks like a gap inherited from the original box2d.js bindings:
https://github.com/kripken/box2d.js/blob/1e6e9da36a3160a9f40cda4cddcb4f83abb4d82c/Box2D_v2.3.1.idl#L218-L222

easy enough to add; will expose this at next convenience.

Thank you very much!

v7.0.0 exposes b2Body#ApplyLinearImpulseToCenter