-
Notifications
You must be signed in to change notification settings - Fork 564
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
Next Major Update - Help Required! #60
Comments
Oh, regarding smaller builds: you can edit the IDL file for your actual build so it doesn't contain stuff you don't actually use, which is another benefit of the new bindings generator. |
Hi, I don't see the webidl branch. Is it not up yet? |
demo work for me, but is hard to compile |
I merged to master now, so no need for using a special branch. |
hi, maybe a great simple library to test with new emscripten |
Let's say I want to expose:
from btCollisionDispatcher. Will the following suffice in the ammo.idl file?
Or do I need to account for the const somehow? The reason I ask is that I have exposed:
This function returns a btDispatcher instance, but when I call dispatcher.getNumManifolds, the function is undefined. I'm conscious that getNumManifolds is declared in btCollisionDispatcher, not btDispatcher. While I'm on the subject, what's the difference between:
and
Thanks! |
Just thinking about it, perhaps it would be good to have a version of ammo.idl that exposes everything and developers can just delete what they don't need instead of add what they do. |
You can add I wasn't aware of I agree we should expose as much as possible, and let people delete what they don't need. |
So doesn't that declare the return value of const rather than the function being const? As for the colon syntax, this is in ammo.idl:
That's the only instance of that notation in the whole file and I wasn't sure what made that class special (if anything). Going back to my original problem, I have:
and
When I call getDispatcher on the collision world, it returns a btDispatcher object. With the old version of Ammo, I just called dispatcher.getNumManifolds and the call would succeed because the instance was actually a btCollisionDispather. Now the function is undefined. Do I now have to somehow cast the btDispatcher to a btCollisionDispatcher now in my JS? It's probably more likely I've just made a mistake in ammo.idl, but I'm not sure. |
I don't think it matters if the function is const? Do you get a compilation error? The glue code we emit should work without const functions, I believe. I didn't notice I wrote that colon notation, heh - no idea what it does. I fixed it now. Is your problem fixed when you use the "implements" notation as the idl now uses consistently? |
Oh, sorry, I just noticed that getNumManifolds actually is defined in btDispatcher as pure virtual. Duh, how did I miss that. ;o) So next problem. I've exposed btVector3::setValue, which takes 3 arguments (x, y and z). However, btVector4 implements btVector3 and overloads setValue with x, y, z and w as arguments. How do I deal with overloads in a subclass in the IDL file? |
Just to be clear about what I've done, I have:
And this generates the following error:
|
Another question. If I define:
I get the following error:
How do I specify a const return type? |
Ok, a fix for the first issue is on emscripten incoming. WebIDL will now accept a child interface that defines a function with the same name as the parent, overriding it. For const, you should add |
Thanks for fixing problem no.1! As for problem no.2, if I change my IDL file to:
I get the following error:
The C++ function signatures are:
|
Ok, I see, we had support only for attributes, not methods. Fixed now. |
Merged a pull from @willeastcott with lots of IDL updates, and pushed a new build with that. |
There is an old function on the Rigidbody: setWorldTransform(btTransform worldTrans), but it doesn't exist in the Bullet API. I do see it as a function of the MotionState, but calling it doesn't work the same way as the old Ammo RigidBody function. I'm wondering if someone created a utility function to do some automagic stuff with the MotionState, and if so, can it be added to the new Rigidbody interface functions, or is there a 'new' way to get the same results as calling the old setWorldTransform on the Rigidbody? Here's an example of what I mean:
ctx.quat is a Quaternion from our engine It works like a charm with the old gh-pages builds, but it doesn't exist on the master Rigidbody class, and when I went to add it, I was surprised it also doesn't exist on the Bullet API. |
Is the problem that bullet removed those functions, or that we don't expose On Mon, May 19, 2014 at 8:50 PM, Brett Unzaga notifications@github.comwrote:
|
I guess if it is a direct port of Bullet, they must have removed that function from the Rigidbody. Perhaps it is called directly on the MotionState now. |
Looks like setActivationState and btVehicleTuning are missing, I suspect more of the Vehicle stuff to be missing :-( |
See the latest pull requests, stuff is being added all the time, and it's easy to add the things you find are missing. |
True and I want to help ! |
I'm trying to add in the btHeightfieldTerrainShape and I've hit a complete wall. I've put :
at the bottom of the ammo.idl file and I'm getting three : "error: unknown type name 'btHeightfieldTerrainShape'" messages. I'm having a real tough time figuring out what I need to do to get this to work. Edit: Ahhh I generated the doxygen docs for the bullet bundled with ammo and see no reference to it. That's probably the issue. |
It looks like |
Cool, I was thinking that I needed to edit that location but I've got zero experience with python. Many thanks! |
Soft bodies in javascript?! The world won't know how to react |
Hi, Most things are working fine, but when I try to declare the function getOverlappingPairCache (used in CharacterDemo/CharacterDemo.cpp:85) in ammo.idl (yes, I know that this function is pure virtual but I do not know how to declare this, sorry for that): interface btBroadphaseInterface { I run into the following problem: Edit: Is there a way to declare that method or should we find a way around it? Edit: 0 : regression tests |
Those errors look like an older emscripten version. It should work on incoming, perhaps not on others. |
Hi, I have come across various missing methods in the current build of ammo.js. I would like to help out, but I'm afraid I don't know anything about C++ or python, so I think adding the bindings and recompiling them myself is beyond me really. The methods that I have found that are missing are: btRigidBody: btQuaternion: Also, many of the operators do not appear to have equivlents, such as multiplying a vertor by a transform (I see you mentioned experimental operator support, e.g. op_mul, but this isn't present on a btTransform object). Is this information helpful? Should I mention any other missing methods I come across? |
Hi, I wanted to implement btConvexPointCloudShape for my project, is it supported in the current build or should I generate it? |
Hi,I want to use btCollisionObjectWrapper now,but in ammo.idl ,they are as follows. [NoDelete] So lack of much function.can you give me some help. |
btWorldImporter, btBulletWorldImporter is needed |
Need support for serialize() for all objects in Ammo.IDL:
Should output to binary/typed array. |
Hello, I need btCompoundShape::updateChildTransform() |
@crazyquark, a virtual machine or container for building and testing ammo.js would be fantastic! |
@mast4461 it seems there already is one, huh: https://github.com/kripken/ammo.js/blob/master/docker-compose.yml |
Would anybody be so kind and add the following to ammo.js (via ammo.idl, and then build it, I guess)?
... or help me build ammo.js myself on Windows - I gave up after 1hr? |
I just want to mention--having a link to an issue from 2014 that previews as "we're about to have a major new release!" on the top of the readme makes one immediately wonder if the project is dead when you're new here.... and until 20 days ago, the most recent comment was from 3 years prior. Seems like the readme should be updated to remove a link to this and to not suggest that something that happened in 2014 is "recent"? |
Thanks @kylebakerio , I'll update the readme. (2014... time flies 🪰 ) |
Thank you so much for managing this project, it's a gem! :) |
We are close to a new major update. This will bring:
Work is in the
webidl
branch. The current status is that all tests and the WebGL demo pass. The tests report a 20% speedup.This is far from complete, however - help is required. The new bindings are generated explicitly, using an IDL file that declares what should be wrapped. This avoids all the horrible hacks with the old bindings generator that tried to be 100% automatic (but a quick look through the bug tracker here shows it was anything but).
The
ammo.idl
file in the repo has enough detail for all the tests and the WebGL demo, but nothing else. So it is very likely your project will hit a missing function or class somewhere. It's very easy to fix those things, just add to the idl file, rebuild, and send a pull request, see details nextHow to Contribute
ammo.idl
what you need.python make.py
(you must use up to date emscripten, onmaster
orincoming
)python test.py
IDL docs are going up on https://github.com/kripken/emscripten/wiki/WebIDL-Binder . While incomplete, you can figure out the important stuff from looking at the already-present stuff in
ammo.idl
. If something doesn't make sense, feel free to ask.The text was updated successfully, but these errors were encountered: