Constructive Solid Geometry Support
Posted: Fri Apr 27, 2012 3:55 am
Hi,
I've been thinking about this for a while now, and it seems like CSG support for defining complex shapes based on primites would be a relatively easy thing to add to a physics engine such as BEPU.
While I could perhaps do it as a layer on top of what BEPU does internally, obviously it wouldn't be as fast as doing it natively inside BEPU.
Of course I'm probably simplifying things a good deal here, but for example, when doing subtractive CSG, the collision result would flip the normals if it's colliding the subtracted primitive and only processed if it is colliding the additive primitive(s) as well. Intersection would simply only evaluate the collision if the contact point is inside both (or all intersected) primitives etc.
This really hit me when I started to realize how painful it'd be without CSG to try to generate a relatively accurate dome shaped primitive using only the only available "union" method.
It'd be cool to hear if anyone has attempted this, or if there are some inherent problems with trying to implement such a system in BEPU.
Cheers
I've been thinking about this for a while now, and it seems like CSG support for defining complex shapes based on primites would be a relatively easy thing to add to a physics engine such as BEPU.
While I could perhaps do it as a layer on top of what BEPU does internally, obviously it wouldn't be as fast as doing it natively inside BEPU.
Of course I'm probably simplifying things a good deal here, but for example, when doing subtractive CSG, the collision result would flip the normals if it's colliding the subtracted primitive and only processed if it is colliding the additive primitive(s) as well. Intersection would simply only evaluate the collision if the contact point is inside both (or all intersected) primitives etc.
This really hit me when I started to realize how painful it'd be without CSG to try to generate a relatively accurate dome shaped primitive using only the only available "union" method.
It'd be cool to hear if anyone has attempted this, or if there are some inherent problems with trying to implement such a system in BEPU.
Cheers