Skip to content

Commit

Permalink
Physx integration (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren authored Mar 14, 2024
1 parent dae6d6c commit 22b99e0
Show file tree
Hide file tree
Showing 9 changed files with 1,002 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/AddExample.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

function(add_example)

set(flags TRY_LINK_IMGUI LINK_IMGUI LINK_ASSIMP LINK_XML WEB)
set(flags TRY_LINK_IMGUI LINK_IMGUI LINK_ASSIMP LINK_XML LINK_PHYSX WEB)
set(oneValueArgs NAME)
set(multiValueArgs SOURCES WEB_EMBED)

Expand All @@ -21,6 +21,11 @@ function(add_example)
return()
endif ()

if (arg_LINK_PHYSX AND NOT unofficial-omniverse-physx-sdk_FOUND)
message(AUTHOR_WARNING "physx not found, skipping '${arg_NAME}' example..")
return()
endif ()


if (NOT arg_SOURCES)
add_executable("${arg_NAME}" "${arg_NAME}.cpp")
Expand All @@ -38,6 +43,10 @@ function(add_example)
target_link_libraries("${arg_NAME}" PRIVATE assimp::assimp)
endif ()

if (arg_LINK_PHYSX AND unofficial-omniverse-physx-sdk_FOUND)
target_link_libraries("${arg_NAME}" PRIVATE unofficial::omniverse-physx-sdk::sdk)
endif ()

if (DEFINED EMSCRIPTEN)

set(LINK_FLAGS " --bind -sUSE_GLFW=3 -sGL_DEBUG=1 -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 -sFULL_ES3 -sASSERTIONS -sALLOW_MEMORY_GROWTH -sNO_DISABLE_EXCEPTION_CATCHING -sWASM=1")
Expand Down
1 change: 1 addition & 0 deletions examples/LibConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
find_package(imgui CONFIG QUIET)
find_package(assimp CONFIG QUIET)
find_package(unofficial-omniverse-physx-sdk CONFIG QUIET)

if (imgui_FOUND)
set_property(TARGET imgui::imgui APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS HAS_IMGUI)
Expand Down
1 change: 1 addition & 0 deletions examples/extras/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

add_subdirectory(core)
add_subdirectory(curves)
add_subdirectory(physics)
2 changes: 2 additions & 0 deletions examples/extras/physics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

add_example(NAME "physx_demo" LINK_PHYSX)
Loading

0 comments on commit 22b99e0

Please sign in to comment.