chandlerprall / GoblinPhysics

Collision Detection & Response in JavaScript
http://www.goblinphysics.com
Other
147 stars 18 forks source link

Terrain example..please:) #37

Closed Druidhawk closed 9 years ago

Druidhawk commented 9 years ago

I have been switiching over to goblin from cannon. Mainly because of the quality of the mesh/statue example. Cannon has a height fiied example, I was wondering how I would do a similar thing in Goblin. This is an example of what I was thinking about http://lo-th.github.io/Oimo.js/test_terrain.html or this http://chandlerprall.github.io/Physijs/examples/heightfield.html

chandlerprall commented 9 years ago

Currently there is no heightfield shape in Goblin. However, you can achieve the same thing by creating a MeshShape of your terrain. Under the hood this is what a lot (most?) engines do, but a heightfield can be further optimized for memory usage.

One thing to keep in mind; right now you can't have two MeshShape objects collide - they will pass through each other. If this is an issue for you I can take another shot at it, but it's not currently on the road map for the next release.

Oh, and thanks for using Goblin :)