Comments (15)
I'm having the same issue. It says setInternalTickCallback is supposed to take a 'btInternalTickCallback':
http://bulletphysics.org/Bullet/BulletFull/btDynamicsWorld_8h.html#ab9ff268d3f8e17f20d6bcd7a7ef354c5
Ammo.btInternalTickCallback is undefined...
from ammo.js.
Any news regarding this issue?
from ammo.js.
I hope in the next few weeks to have a new version of ammo that uses a new
bindings generator, which should help with things like this.
On Thu, Apr 17, 2014 at 4:15 AM, cschinko [email protected] wrote:
Any news regarding this issue?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-40703726
.
from ammo.js.
this seems to be axed entirely in the new build, can we bring it back please?
by the way, for those still searching, you need to first create a function pointer to pass in:
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".
from ammo.js.
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.
from ammo.js.
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?
from ammo.js.
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.
from ammo.js.
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..
from ammo.js.
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?
from ammo.js.
@cybafelo
I did this in the past, might try to find it later. But it boils down to generation of C files from IDL that comes with ammo, IDL generator does not allow expression of interface such as one you describe, so you will have to edit generated C file by hand to add it, the rest is simple - just follow build process as usual.
from ammo.js.
ok - I tried the following - i modified the ammo.idl to have the following lines:
callback btInternalTickCallback = void (btDynamicsWorld world, float timeStep);
the float
above should actually be btScalar
but i didnt want to modify the idl too much (also btScalar is just a typedef for float or double)
then, in interface btDynamicsWorld
i added the following line
void setInternalTickCallback(btInternalTickCallback cb, optional VoidPtr worldUserInfo, optional boolean isPreTick);
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.
myDiscreteDynamicsWorld.setInternalTickCallback( function(){ console.log('hello'); } );
I tried the example above with Ammo.Runtime but Ammo.Runtime is not defined. Help anyone?
So - it appears to be the same problem, setInternalTickCallback has no effect
my last attempt is
this.world.setInternalTickCallback( function(__a, __b) { console.log('internal tick callback'); } , null, true);
this.world is an instance of btDiscreteDynamicsWorld
from ammo.js.
@cybafelo
it was a long time ago since i did this. However, reading my posts here - it appears that editing IDL will not work. I have been suggesting editing C files that are generated from the IDL. I'm sorry, but I can not help you further.
from ammo.js.
Hey guys... I tried every thing listed above...
tried both 10 and 20 (make.py)
emcc_args += '-s RESERVED_FUNCTION_POINTERS=10'.split(' ')
But i have NO Ammo.addFunction and/or NO Ammo.Runtime.addFunction
Anybody know what gives ???
from ammo.js.
Do you have this arg included, it fixed it for me?
-s EXPORTED_RUNTIME_METHODS=[\'addFunction\']
from ammo.js.
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:
emcc_args += '-s RESERVED_FUNCTION_POINTERS=20'.split(' ')
emcc_args += '-s EXTRA_EXPORTED_RUNTIME_METHODS=["addFunction"]'.split(' ')
from ammo.js.
Related Issues (20)
- How to improve the performance of physical scenes? HOT 1
- Custom SDF callback possible?
- How to use setUp or setUpAxis on btKinematicCharacterController
- When the clone model is introduced and added to the AMMO world, the position parameter becomes NaN
- _free is not a function (ammo.wasm)
- Debugging ammo.wasm.wasm using DWARF HOT 2
- Export some classes please
- rotation not what is set
- btRigidBody applyForce applyImpulse methods missing? HOT 1
- set functions for softbody anchors do not work
- Collision stops working after softbody deformation HOT 1
- Cannot parse with webidl2 because `B implements A` doesn't seem to be valid syntax
- ReferenceError: 'setTimeout' is not defined
- Memory access fault on constraint creation HOT 1
- I created a un-official ammo.js documentation HOT 1
- Need softBody self-collision API
- sbConfig.set_collisions()
- Error 'b._free is not a function' while adding multiple soft bodies. HOT 1
- btRaycastVehicle not syncing position on moving platform
- Include `btTransformUtil` functions? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ammo.js.