-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
btDynamicsWorld::setInternalTickCallback() has no effect #30
Comments
I'm having the same issue. It says setInternalTickCallback is supposed to take a 'btInternalTickCallback': Ammo.btInternalTickCallback is undefined... |
Any news regarding this issue? |
I hope in the next few weeks to have a new version of ammo that uses a new On Thu, Apr 17, 2014 at 4:15 AM, cschinko notifications@github.com wrote:
|
this seems to be axed entirely in the new build, can we bring it back please? function callback(dw,timeDelta){
...
}
var fp = Ammo.Runtime.addFunction(callback);
dynamicWorld.setInternalTickCallback(fp); also, you might need to go into your ammo.js and search for "functionPointers" then change value from "[]" to "new Array(x)" where x is number of pointers you wish to be able to hold, if this isn't done you will likely see an error in console when trying to invoke "addFunction". |
Adding this to the new IDL files seems to require support for passing in function pointers, which I don't think we support yet. But shouldn't be too hard to add. |
Any word on how to do this with the new IDL? I'd like to create a btInternalTickCallback to handle kinematic rigidbodies, since nothing I do will prevent dynamic rigidbodies from passing through fast moving kinematic rigidbodies (A and D to move the kinematic flippers, hold space to shoot the ball https://goote.ch/169f43e6e96e434d879039deede2bb7e.scene). Even if we were to create an interface for setInternalTickCallback() in the btDiscreteDynamicsWorld class, how would we be able to pass in a JavaScript function? |
Just a note, you can still do this, but you need to bypass IDL however, you will need to edit generated C files by hand. If you really need this then a gap-stop solution might work for you. |
Hey all - I'm also struggling with this - is there some way to set a substep callback in ammo js? I really need this to speed up my game, and I don't want to write any gap-stop code.. |
Hey guys - any feedback on this - is it a simple thing? I don't know the details of emscripten but will try to build a new version of ammo soon - so that I could at least set an internal substep callback - or can someone tell me know if I should not even try this? |
@cybafelo |
ok - I tried the following - i modified the ammo.idl to have the following lines:
the then, in
Now I rebuild ammo.js with python make.py, which builds a temp.js which I copy over to my ammo.js - it loads fine, everything still works - i have the function 'setInternalTickCallback' - but my callback doesn't execute (its a closure, ex. So - it appears to be the same problem, setInternalTickCallback has no effect my last attempt is
this.world is an instance of btDiscreteDynamicsWorld |
@cybafelo |
Hey guys... I tried every thing listed above... tried both 10 and 20 (make.py)
But i have NO Ammo.addFunction and/or NO Ammo.Runtime.addFunction Anybody know what gives ??? |
Do you have this arg included, it fixed it for me?
|
Thats weird... I could not get EXPORTED_RUNTIME_METHODS to work with Pointers_stringify But luckily there is a EXTRA_EXPORTED_RUNTIME_METHODS that worked for me: Update make.py EMCC_ARGS: |
I'm trying to get called back on internal ticks, without success. I tried the naive approach:
I looked at Callbacks from C++ to JS in
tests/wrapping.js
, but that doesn't seem to apply in this case, as I'm not replacing a function on an object, just trying to pass JS objects/functions.I think I can work around not being able to use the
worldUserInfo
parameter tosetInternalTickCallback()
, but I do need the callback function to get invoked.Am I doing something wrong, or is this just not possible right now?
The text was updated successfully, but these errors were encountered: