chipmunk addPostStepCallback was undefined in jsb


#1

chipmunk addPostStepCallback was undefined in jsb ??
It works well in chrome browser.


#2

jsb is not binding to addPostStepCallback.


#3

you can implement addPostStepCallback in javascript yourself
like this:

var callbacks = [];
function addPostStepCallback(callback) {
    callbacks.push(callback);
}

// in update
space.step(dt);
for (var i = 0; i < callbacks.length; ++i) {
    callbacks[i]();
}
callbacks = [];