Skip to content

Commit

Permalink
Add csg boolean operators using elalish/manifold.
Browse files Browse the repository at this point in the history
Uses MeshGL64 for more floating point precision.

Co-Authored-By: 31 <[email protected]>
Co-Authored-By: Claudio Z <[email protected]>
  • Loading branch information
3 people committed Sep 24, 2024
1 parent 77dcf97 commit bd5966f
Show file tree
Hide file tree
Showing 483 changed files with 85,495 additions and 165 deletions.
44 changes: 43 additions & 1 deletion modules/csg/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,49 @@ Import("env_modules")

env_csg = env_modules.Clone()

# Godot source files
# Thirdparty source files

thirdparty_obj = []

thirdparty_dir = "#thirdparty/manifold/"
thirdparty_sources = [
"src/polygon/src/polygon.cpp",
"src/cross_section/src/cross_section.cpp",
"src/manifold/src/constructors.cpp",
"src/manifold/src/edge_op.cpp",
"src/manifold/src/face_op.cpp",
"src/manifold/src/impl.cpp",
"src/manifold/src/boolean_result.cpp",
"src/manifold/src/boolean3.cpp",
"src/manifold/src/manifold.cpp",
"src/manifold/src/properties.cpp",
"src/manifold/src/smoothing.cpp",
"src/manifold/src/sort.cpp",
"src/manifold/src/csg_tree.cpp",
"src/manifold/src/subdivision.cpp",
"src/manifold/src/quickhull.cpp",
]

thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_csg.Prepend(
CPPPATH=[
"#thirdparty/glm",
"#thirdparty/quickhull",
thirdparty_dir + "src/polygon/include",
thirdparty_dir + "src/manifold/include",
thirdparty_dir + "src/manifold/include/manifold",
thirdparty_dir + "src/utilities/include",
thirdparty_dir + "src/collider/include",
thirdparty_dir + "src/cross_section/include",
]
)
env_thirdparty = env_csg.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env_thirdparty.add_source_files(thirdparty_obj, "#thirdparty/quickhull/QuickHull.cpp")
env.modules_sources += thirdparty_obj

# Godot's own source files
env_csg.add_source_files(env.modules_sources, "*.cpp")
if env.editor_build:
env_csg.add_source_files(env.modules_sources, "editor/*.cpp")
Loading

0 comments on commit bd5966f

Please sign in to comment.