Replaced reactphysics3d with box2d

This commit is contained in:
Maximilian Giller 2023-06-01 23:25:33 +02:00
parent fd723a9689
commit 543c9e9728
3 changed files with 20 additions and 14 deletions

View file

@ -11,8 +11,8 @@ include_directories(${SFML_INCLUDE_DIR})
find_package(Eigen3 3.3 REQUIRED NO_MODULE) find_package(Eigen3 3.3 REQUIRED NO_MODULE)
include_directories(${EIGEN3_INCLUDE_DIR}) include_directories(${EIGEN3_INCLUDE_DIR})
# Find and include ReactPhysics3D # Find and include Box2D
find_package(ReactPhysics3D REQUIRED) #find_package(Box2D REQUIRED)
# Set up your project's source files # Set up your project's source files
@ -55,7 +55,10 @@ set(SOURCES
src/utilities/magic_enum.hpp src/utilities/magic_enum.hpp
src/game/player/player_spawner.cpp src/game/player/player_spawner.cpp
src/game/player/player_spawner.hpp src/game/player/player_spawner.hpp
src/game/camera/tracking_area.h src/game/camera/tracking_view_options.hpp) src/game/camera/tracking_area.h
src/game/camera/tracking_view_options.hpp
src/game/depth_renderer.cpp
src/game/depth_renderer.hpp)
set(PHYSICS_00_SOURCES set(PHYSICS_00_SOURCES
src/prototypes/physics_00.cpp) src/prototypes/physics_00.cpp)
@ -72,8 +75,8 @@ add_executable(Math_00 ${MATH_00_SOURCES})
# Link SFML and other libraries to your executable target # Link SFML and other libraries to your executable target
target_link_libraries(Holesome sfml-graphics sfml-audio) target_link_libraries(Holesome sfml-graphics sfml-audio)
target_link_libraries(Holesome Eigen3::Eigen) target_link_libraries(Holesome Eigen3::Eigen)
target_link_libraries(Holesome ReactPhysics3D::ReactPhysics3D) #target_link_libraries(Holesome Box2D::Box2D)
target_link_libraries(Physics_00 ReactPhysics3D::ReactPhysics3D) #target_link_libraries(Physics_00 Box2D::Box2D)
target_link_libraries(Math_00 Eigen3::Eigen) target_link_libraries(Math_00 Eigen3::Eigen)

View file

@ -50,18 +50,21 @@ Potential expansions:
Install SFML and Eigen: `sudo apt install libsfml-dev libsfml-doc libeigen3-dev` Install SFML and Eigen: `sudo apt install libsfml-dev libsfml-doc libeigen3-dev`
### Compiling ReactPhysics3D from source ### Compiling Box2D from source
Website: [ReactPhysics3D](https://www.reactphysics3d.com) Website: [Box2D](https://github.com/erincatto/box2d)
1. Make sure cmake, g++ and make are installed 1. Make sure cmake, g++ and Doxygen (`sudo apt-get install doxygen`) are installed
2. Clone the repository `git clone https://github.com/DanielChappuis/reactphysics3d.git` 2. Clone the repository `git clone git@github.com:erincatto/box2d.git`
3. Build and install the library 3. Build and install the library
``` ```
cd reactphysics3d cd box2d
mkdir build mkdir build
cd build cd build
cmake .. cmake -DBOX2D_BUILD_DOCS=ON ..
make ```
sudo make install In case of "RandR headers were not found": `sudo apt install xorg-dev`.
```
cmake --build .
cmake --build . --target INSTALL
``` ```

View file

@ -1,3 +1,3 @@
# Holesome - ToDos # Holesome - ToDos
- [ ] Make tracking view react to resize events, especially because of aspect ratio - [ ] Link box2d???