-
Notifications
You must be signed in to change notification settings - Fork 115
Enable static-body on ground with a Heightfield shape (wip)#24
Enable static-body on ground with a Heightfield shape (wip) #24vincentfretin wants to merge 1 commit intosupermedium:master from
Conversation
vincentfretin
commented
Oct 15, 2017
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
arpu
commented
Dec 23, 2017
@vincentfretin any news on this? works fantastic
vincentfretin
commented
Dec 24, 2017
@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!
I have aframe-environment-component.js and aframe-physics-system.min.js installed on aframe 0.7.0 as well as 0.8.0/0.8.2.
I made your changes on aframe-environment-component.js, check it with console but it takes no effect, i can go through the ground or e.g. pyramids. I also dont see the grid as in your screenshot.
Please, can you help me or show a working example or maybe is there a better solution?
My Code:
<html>
<head>
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
<script src="https://www.beverung.de/vr/ground/aframe-environment-component.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.2.0/dist/aframe-physics-system.min.js"></script>
</head>
<body>
<a-scene physics="debug: true">
<a-entity environment="preset:egypt"></a-entity>
<a-entity dynamic-body camera look-controls wasd-controls position="0 1.6 0"></a-entity>
</a-scene>
</body>
</html>
Thank you very much!
When i use physics 3.0.0 i can see the grid, but go still through all...
vincentfretin
commented
Aug 18, 2018
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.
vincentfretin
commented
Aug 18, 2018
You can look at my example https://github.com/vincentfretin/aframe-sandbox and compare with yours.
netgfx
commented
Oct 29, 2020
Is this going to be merged at some point? It is really useful!
vincentfretin
commented
Oct 29, 2020
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 know that the physics system switched from cannon to ammo, so if somebody works on this, they should use ammo now I think.
I know @arpu did similar thing in vrland.io, what tech did you use @arpu for your https://vrland.io/worldg/in map?
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
Uh oh!
There was an error while loading. Please reload this page.
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.ConvexPolyhedronshape, 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.Heightfieldshape 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">capture d ecran de 2017年10月09日 20-37-10