-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make CSG nodes able to generate collision using CSG primitives rather than a triangle mesh #2083
Comments
Related to #200. This would require implementing CSG collision shapes in the engine, which has many use cases (even outside of CSG nodes) but also sounds pretty difficult. |
With the way that CSG operations are handled, CSG collisions wouldn't be far off from the current collision shape workflow. Adding more collision shapes to the engine would further expedite a possible inclusion of CSG based collision, as collisions can be tested using logical operators on the results of multiple individual collision bodies. https://en.wikipedia.org/wiki/Constructive_solid_geometry The only probably issue I can imagine is current CSG may not translate to binary trees, possibly needing reworking. Using the preexisting collision shapes of the engine, and using the logical and, or, and not operators, we can test for intersections of CSG objects quite easily, while being able to return collision information from individual elements. |
This is not mathematically possible, sorry. The only technique that can more or less work this way is sphere-SDF collisions, which rules out all other physics shapes (box, convex poly, capsule, etc) and its also not amazingly precise. Physics engines work on the premise of convex shapes, and once you do a union/intersection/subtraction in CSG, it rarely remains convex. |
Closing per the above comment. |
Describe the project you are working on
I am working on a semi-realistic FPS, that focuses on player controls and ergonomics.
Describe the problem or limitation you are having in your project
I want to be able to use CSG objects (specifically tori [torus plural]) for collision. There is no built in option for a torus collision shape, or being able to apply a CSG difference operation on collision shapes, without using mesh collision
Describe the feature / enhancement and how it helps to overcome the problem or limitation
CSG objects having their proper round collision shapes, along with combination CSG primitives in the physics engine, without using tri mesh collision
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
CSG objects are notorious for being easy to raycast, along with raymarching. There are a few papers from the 90s documenting CSG collision. CSG basics outline how boolean operations are handled.
If this enhancement will not be used often, can it be worked around with a few lines of script?
no
Is there a reason why this should be core and not an add-on in the asset library?
CSG is very common for prototyping, and is useful for approximate collision shapes of meshes. This should be a core functionality to the physics engine which can be hard to modify in this way, and keep efficiency without custom builds.
The text was updated successfully, but these errors were encountered: