-
Notifications
You must be signed in to change notification settings - Fork 113
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
Enable static-body on ground with a Heightfield shape (wip) #24
base: master
Are you sure you want to change the base?
Conversation
As I said on donmccurdy/three-to-cannon#1 I'll probably move the heightfield creation to three-to-cannon and add an option to the environment component to enable the heightfield creation, disabled by default. And be sure that I don't broke something when a property of the environment component schema changes. |
3d28a47
to
2890e06
Compare
2890e06
to
e589340
Compare
@vincentfretin any news on this? works fantastic |
@arpu I didn't do anything on this front yet. I still have to do the work I described. |
@vincentfretin Great idea, but i dont get this to work!
Thank you very much! When i use physics 3.0.0 i can see the grid, but go still through all... |
For the red wireframe, if I remember well, it only appears for me on firefox on desktop, not on chrome on desktop, not sure why. |
You can look at my example https://github.com/vincentfretin/aframe-sandbox and compare with yours. |
Is this going to be merged at some point? It is really useful! |
I don't plan to work on it myself for the time being. It was really a proof of concept for me back in October 2017, time flies :) |
i still use the typedscrypt port from cannon https://github.com/pmndrs/cannon-es with the CANNON.Heightfield generated from a heighmap image and https://github.com/mapbox/martini |
I create the PR so you folks know I'm working on that. I'll probably continue this work in two weeks.
I want my cubes and spheres to rest on the ground, not go through it!
I first tested
this.ground.setAttribute('static-body', 'shape', 'hull');
that create aCANNON.ConvexPolyhedron
shape, but I had really poor performance on GearVR, lots of frame drop.While reading some old https://github.com/donmccurdy/aframe-physics-system issues, I stopped at c-frame/aframe-extras#41 and donmccurdy/three-to-cannon#1 where it gave me the idea to try that.
I successfully created a
CANNON.Heightfield
shape for the generated ground, and it is working great!I don't have any slowdown with this on GearVR.
I'm sure there are issues with updating the properties of the schema, so please don't merge.
If you want to play with it, please do! ;-)
Here is screenshot with
<a-scene physics="debug:true">