Planetary Terrain

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Jacks Sparrow
Posts: 2
Joined: Wed Nov 11, 2015 9:24 pm

Planetary Terrain

Post by Jacks Sparrow »

Dear Sirs,
I am trying to implement a terrain collision system that comes from 6 textures. The 6 textures contains the heightmaps of the 6 sides of a cube sphere. The current terrain as it is doesnt support x,z adjustments of the current vertex entry. My question is can i somehow manualy check the collisions nessesarely without providing any convex model(as the data will get retrieved directly from the heightmap data and will calculated on the fly)?

I have tried to implement a custom pair/manifold/collidable but as i see i must pre-fetch the convex models. Where exacly the collision detections occures?

Thanks in advance.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Planetary Terrain

Post by Norbo »

This type of thing does indeed require a custom collidable, as the built in terrain isn't flexible enough. The key area to look at as an example is the TerrainContactManifold. It collects the triangles which may collide with the other shape. A "PlanetContactManifold" would look similar, except rather than calling a Terrain.Shape.GetOverlaps, it would call YourPlanetType.GetOverlaps or something like that. You would then be responsible for selecting the set of triangles (reported as indices) which overlap the input bounding box.

No convex model associated with the planet is required at any step.

If you want to see where the 'actual' collision detection occurs, check out the parent class, the TriangleMeshConvexContactManifold, and its use of TrianglePairTesters. Ideally, though, you won't need to worry about any of that- so long as your code reports the overlapped triangles, all of that should be transparent.
Jacks Sparrow
Posts: 2
Joined: Wed Nov 11, 2015 9:24 pm

Re: Planetary Terrain

Post by Jacks Sparrow »

Thanks for the answer, i have found it and working on it already. Is exacly what i was looking for!
Post Reply