-
Notifications
You must be signed in to change notification settings - Fork 71
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
Let's make super-hands work with Ammo.js physics engine #196
Comments
Here's a link directly to the forked repo with the changes in it. |
@diarmidmackenzie yes this sounds awesome!! I'll take a look soon |
Trying to grab an object (w/ 2 hands) immediately freezes the tab for me |
@RGFTheCoder was this using the latest code here: https://github.com/diarmidmackenzie/aframe-super-hands-component ? Live version here: https://terrific-minute.surge.sh/examples/physics/index-ammo.html If so, can you tell me what VR system you were testing on? |
@RGFTheCoder - also just wanted to respnd to your point about changing the object type to kinematic. That is not necessary. The hand itself is a kinematic object, and then we then define a constraint between the grabbed object and the hand. That's enough to get the grabbed object moving as required. I've tested that solution extensively and it's working well. The problems you are seeing, I suspect, will either be that you are using a different level of code, or something to do with the specific controllers or VR headset you are using. (e.g. maybe the code is failing to detect the "grip" button on your controller?). |
It's been a while, didn't see a further update on this. Just coming back to this now & have submitted a PR with these changes. |
Thanks for your work! However, the example you provided at https://terrific-minute.surge.sh/examples/physics/index-ammo.html does not seem to be working for me... the non-ammo physics demo lets me grab the blocks but I can't seem to move them with the ammo demo. Is it working for you? I'm testing with the Mozilla WebXR extension set to Oculus Quest |
Hi, yes that link still works for me. This is on Oculus Quest 2 using Oculus Browser. I use the grip button to grab the blocks. Note the caveat in the background about maybe having to press grip twice the first time. FYI, there's also a version now published on github pages (easier for me to track what code is deployed than with surge, though I believe this is exactly the same code). I haven't tested in your setup. Press 1 to select x-axis movement, then hold - (minus) until the left sphere intersects the blue block. These key pressses are simulating the exact same input into the software as you'd get from the Oculus Quest 2 controller. |
Nevermind, seems alright when I test it with the actual Oculus Quest 2 and I got it to work on my own project. Is there any way to make objects follow the ammo-constraints? I have a pendulum weight (sphere) attached to a 'rope' (cylinder) and I don't want the sphere to move away from the hinge constraint I have between them, but while I'm grabbing, it just follows the hand. Thanks so much for your help! |
(deleted last comment, because it was wrong). I thought that one constraint might be replacing the other, but the super-hands constraints shouldn't collide with anything else. The super-hands code sets a name of ammo-constraint__ + a random number, which should almost never collide with anything.
If your constraint component was just called ammo-constraint, it might be worth giving it a unique name, e.g.
That might help ensure it doesn't get overwritten by any other constraints? Beyond that I think I'd need some sample code to figure out what is going on. Could you create a glitch showing the problem? |
I can't seem to figure out what is going on with my code, I have taking your example you remade from the original example, I have even gone as far as copying the mixins, entities, and the ground from the page instead of just typing them to avoid errors. The only difference from your scene and mine is that I have a rig with movement controls and a couple of lights in the scene. As well as I am using A-Frame 1.3.0 (But I am currently switched to 1.2.0 and still nothing). If you happen to have a second would you be able to look at this? |
Also there are one error, I am getting a three.js error saying |
@DDincBrent - in what sense is this "not working"? I just tried your page on Oculus Quest 2, and it seemed to basically work. There were a few weird glitches where pick-up didn't seem completely reliable (I didn't try to troubleshoot these), but I was able to pick up blocks, move them around, release them etc. I'm wondering what VR hardware you are using? I've only tested with Oculus Quest 2 so far (that's all I have available). The THREE.Geometry error will be due to using a component that still uses THREE.Geometry, deprecated since A-Frame 1.2.0 I think. I didn't see that error, so no idea why you were seeing it. If you do see it, the fix will be to upgrade whatever component references THREE.Geometry to a more recent version that uses THREE.BufferGeometry. or... just include this in the head of your HTML file... (credit: n5ro/aframe-physics-system#187 (comment))
|
Just wanted to bump on this cuz I also would love Ammo support with super-hands! I just tested https://glitch.com/edit/#!/aframe-super-hands-not-working on Quest 2 browser and indeed it didn't work (hands couldn't pick things up and getting However, it works when I update the Ammo lib source to The code I tested: |
Yes, this is because Mozilla pulled the published version of their Ammo library: c-frame/aframe-physics-system#30 In terms of getting this merged, don't know what @wmurphyrd's thoughts on this are? I ran into difficulties running the machanima tests, and never got a resolution to that... |
@diarmidmackenzie |
aframe-physics-system offers 2 different physics engines: CANNON.js and Ammo.js.
Currently super-hands only works with the CANNON.js engine.
It would be great if super-hands could work with the Ammo.js engine as well. This is particularly important as of A-Frame 1.2.0, because the CANNON.js version of aframe-physics-system is broken, and it's not clear that's going to be fixed soon.
See: n5ro/aframe-physics-system#187
In any case, Ammo.js seems to be more mature & performant than CANNON,js, being a javascript port of the extremely widely used Bullet physics engine, so it would be good to support it in any case.
The set of changes required to get basic function with Ammo.js working seems to be fairly small. I have made a set of changes here, which appears to be most of what is required.
master...diarmidmackenzie:master
@wmurphyrd - would you be willing to work with me to get this set of changes folded into this repo as a PR?
The text was updated successfully, but these errors were encountered: