Hi,
I have derived a custom shape from btConcaveShape in order to create a collision shape for our streamed-terrain (similarly to what btHeightFieldTerrainShape does).
It all works perfectly, however, I am facing the same issue I had in the past when we relied on the btBvhTriangleMeshShape shape, i.e. the "internal edge" problem.
I understand the workaround based on btAdjustInternalEdgeContacts() only works with TRIANGLE_SHAPE_PROXYTYPE type shapes.
Is there a way I can solve this ?
Thanks,
Greg
internal edge workaround + custom terrain shape
-
- Posts: 178
- Joined: Fri Apr 18, 2008 2:20 pm
-
- Posts: 178
- Joined: Fri Apr 18, 2008 2:20 pm
-
- Posts: 10
- Joined: Sun Apr 29, 2012 3:22 pm
Re: internal edge workaround + custom terrain shape
As far as I know, there is no other internal solution in bullet.
There is only btInternalEdgeUtility ( btAdjustInternalEdgeContacts ) addressing the internal-edge problem in bullet.
And btInternalEdgeUtility works with (from) btBvhTriangleMeshShape and btScaledBvhTriangleMeshShape shape types only.
So, I think, if you use other collision shape type for your collision, then you have to understand what modifications btInternalEdgeUtility does on the contact points to handle the internal-edge problem, and you have to write a similar one for your custom shape.
Probably the difference for your custom shape can be only at the area how you gives input to the real functionality of btInternalEdgeUtility, because you have a concave shape and btBvhTriangleMeshShape is a concave shape too, and probably you have vertices and edges like there are in btBvhTriangleMeshShape, so you will have to feed the functionality of btInternalEdgeUtility from the database of your custom shape, and you will have the same functionality.
Of course, you have to call your version of btAdjustInternalEdgeContacts for your custom shapes and the original version of btAdjustInternalEdgeContacts for btBvhTriangleMeshShape in your custom material callback, if those coexist in one scene.
There is only btInternalEdgeUtility ( btAdjustInternalEdgeContacts ) addressing the internal-edge problem in bullet.
And btInternalEdgeUtility works with (from) btBvhTriangleMeshShape and btScaledBvhTriangleMeshShape shape types only.
So, I think, if you use other collision shape type for your collision, then you have to understand what modifications btInternalEdgeUtility does on the contact points to handle the internal-edge problem, and you have to write a similar one for your custom shape.
Probably the difference for your custom shape can be only at the area how you gives input to the real functionality of btInternalEdgeUtility, because you have a concave shape and btBvhTriangleMeshShape is a concave shape too, and probably you have vertices and edges like there are in btBvhTriangleMeshShape, so you will have to feed the functionality of btInternalEdgeUtility from the database of your custom shape, and you will have the same functionality.
Of course, you have to call your version of btAdjustInternalEdgeContacts for your custom shapes and the original version of btAdjustInternalEdgeContacts for btBvhTriangleMeshShape in your custom material callback, if those coexist in one scene.
-
- Posts: 6
- Joined: Fri Oct 07, 2011 2:41 pm
- Location: Brighton, UK
Re: internal edge workaround + custom terrain shape
This reply might be a bit late for you but I solved that issue for my use-case and posted about it here: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=7498
-
- Posts: 178
- Joined: Fri Apr 18, 2008 2:20 pm
Re: internal edge workaround + custom terrain shape
Thanks you guys for your answers, really appreciated.
I haven't solved this issue yet; so any suggestion is still welcome
Indeed, a clean solution would be to add some kind of support for btConcaveShape-derived class, into the existing built-in Bullet internal edge detection routines.
Don, I will try to adapt your source code to my class. I created a custom terrain shape in order to support terrain tiles streaming, but I can't foresee any big issue with that. Thanks for sharing your code, it will really help (I am not such a physic engine expert, just a simple user - might reach the power user stage once I have manage to adapt your code )
I will keep you informed on the results.
Thanks once again guys !
I haven't solved this issue yet; so any suggestion is still welcome
Indeed, a clean solution would be to add some kind of support for btConcaveShape-derived class, into the existing built-in Bullet internal edge detection routines.
Don, I will try to adapt your source code to my class. I created a custom terrain shape in order to support terrain tiles streaming, but I can't foresee any big issue with that. Thanks for sharing your code, it will really help (I am not such a physic engine expert, just a simple user - might reach the power user stage once I have manage to adapt your code )
I will keep you informed on the results.
Thanks once again guys !