Skip to content

Commit

Permalink
Pedestrian Nav Example Ported from FLAMEGPU 1
Browse files Browse the repository at this point in the history
Visualisation is limited to features of native FLAMEGPU 2 visualiser, and hence (currently) lacks the ability to:
* Hide a subset of agents in the same state (in this case navmap arrows with no force)
* Control environment properties via UI elements
* Control visualisation of agents via UI elements
  • Loading branch information
Robadob committed Aug 16, 2022
1 parent 5827874 commit ece6580
Show file tree
Hide file tree
Showing 4 changed files with 1,442,430 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ if(NOT NO_EXAMPLES)
option(BUILD_EXAMPLE_ENSEMBLE "Enable building examples/ensemble" OFF)
option(BUILD_EXAMPLE_SUGARSCAPE "Enable building examples/sugarscape" OFF)
option(BUILD_EXAMPLE_DIFFUSION "Enable building examples/diffusion" OFF)
option(BUILD_EXAMPLE_PEDESTRIAN_NAVIGATION "Enable building examples/pedestrian_navigation" OFF)
endif()

option(BUILD_SWIG_PYTHON "Enable python bindings via SWIG" OFF)
Expand Down Expand Up @@ -177,6 +178,9 @@ endif()
if(BUILD_ALL_EXAMPLES OR BUILD_EXAMPLE_DIFFUSION)
add_subdirectory(examples/diffusion)
endif()
if(BUILD_ALL_EXAMPLES OR BUILD_EXAMPLE_PEDESTRIAN_NAVIGATION)
add_subdirectory(examples/pedestrian_navigation)
endif()
# Add the tests directory (if required)
if(BUILD_TESTS OR BUILD_TESTS_DEV)
add_subdirectory(tests)
Expand Down
39 changes: 39 additions & 0 deletions examples/pedestrian_navigation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Minimum CMake version 3.18 for CUDA --std=c++17
cmake_minimum_required(VERSION VERSION 3.18 FATAL_ERROR)

# Name the project and set languages
project(pedestrian_navigation CUDA CXX)

# Set the location of the ROOT flame gpu project relative to this CMakeList.txt
get_filename_component(FLAMEGPU_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../.. REALPATH)

# Include common rules.
include(${FLAMEGPU_ROOT}/cmake/common.cmake)

# Define output location of binary files
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# If top level project
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/)
else()
# If called via add_subdirectory()
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../bin/${CMAKE_BUILD_TYPE}/)
endif()

# Prepare list of source files
# Can't do this automatically, as CMake wouldn't know when to regen (as CMakeLists.txt would be unchanged)
SET(ALL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cu
)

# Option to enable/disable building the static library
option(VISUALISATION "Enable visualisation support" ON)

# Add the executable and set required flags for the target
add_flamegpu_executable("${PROJECT_NAME}" "${ALL_SRC}" "${FLAMEGPU_ROOT}" "${PROJECT_BINARY_DIR}" TRUE)

# Also set as startup project (if top level project)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY VS_STARTUP_PROJECT "${PROJECT_NAME}")

# Set the default (visual studio) debugger configure_file
set_target_properties("${PROJECT_NAME}" PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
VS_DEBUGGER_COMMAND_ARGUMENTS "-i map.xml -s 200")
Loading

0 comments on commit ece6580

Please sign in to comment.