Skip to content
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

Physics bullet #43

Merged
merged 28 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8337610
Chore: New version and fix warnings
brenocq Sep 17, 2022
dacdbea
Refactor: Linux script reloading
brenocq Sep 17, 2022
1206c34
Chore: Test new linux workflow
brenocq Sep 17, 2022
8cde9f8
Chore: Fix workflow comma
brenocq Sep 17, 2022
4cc2d16
Chore: Linux workflow renaming
brenocq Sep 18, 2022
cca594d
Docs: Better OS specific instructions
brenocq Sep 18, 2022
d7777f4
Feat: Linux scripting with included files
brenocq Sep 19, 2022
cd8985e
Fix: Ubuntu 18.04 scripting
brenocq Sep 19, 2022
00443ef
Fix: Increased number of old script libraries
brenocq Sep 19, 2022
078c646
Chore: Ubuntu 18.04 build
brenocq Sep 27, 2022
442a6d7
Docs: Fedora build
brenocq Sep 27, 2022
5f16472
Docs: Arch build
brenocq Sep 27, 2022
3a848f0
Refactor: Physics selection
brenocq Sep 29, 2022
2cdfafa
Refactor: Physics box drawing
brenocq Sep 29, 2022
6e2202a
Feat: Sphere collider drawing
brenocq Oct 1, 2022
6b3465f
Refactor: Simulation step control
brenocq Oct 1, 2022
b2369a6
Feat: Viewport rendering button
brenocq Oct 2, 2022
4f6a81f
Feat: Bullet collision check and contact drawing
brenocq Oct 2, 2022
13d9f0e
Fix: Undeclared M_PI windows
brenocq Oct 2, 2022
580f3a4
Feat: Starting bullet prismatic joint
brenocq Oct 3, 2022
3154dfc
Feat: Prismatic joint motor
brenocq Oct 3, 2022
d3fed5a
Feat: Starting bullet revolute joint
brenocq Oct 4, 2022
bcbe0dc
Chore: Test ClickUp 0
brenocq Oct 5, 2022
d96a1ec
Refeat: Revolute joint as btGeneric6DofSpring2Constraint
brenocq Oct 10, 2022
64908cb
Feat: Bullet engine ray casting and cylinder collider
brenocq Oct 15, 2022
72c3672
Chore: Disable dependency update
brenocq Oct 16, 2022
322ef59
Chore: Test fix resource download error
brenocq Oct 16, 2022
5a2fe2e
Chore: Fix github workflow download error
brenocq Oct 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,28 @@ jobs:
matrix:
config:
- {
name: "Ubuntu Latest",
name: "Ubuntu g++",
os: ubuntu-latest,
build_type: "Release"
compiler: "g++"
}
- {
name: "Ubuntu clang++",
os: ubuntu-latest,
compiler: "clang++"
}

steps:
- name: Checkout atta
uses: actions/checkout@v2

- name: Install dependencies on ubuntu
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install cmake xorg-dev curl
cmake --version
gcc --version
- name: Checkout atta
uses: actions/checkout@v2

- name: Configure
run: |
mkdir build
cd build
cmake ..
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install cmake xorg-dev curl

- name: Build
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}
- name: Build
run: ./build.sh --jobs 2 --compiler ${{ matrix.config.compiler }}

- name: Test
run: ctest
working-directory: build
- name: Test
run: ctest
working-directory: build/release
34 changes: 17 additions & 17 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ jobs:
}

steps:
- name: Checkout atta
uses: actions/checkout@v2
- name: Checkout atta
uses: actions/checkout@v2

- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake
cmake --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake
cmake --version

- name: Configure
run: |
mkdir build
cd build
cmake ..
- name: Configure
run: |
mkdir build
cd build
cmake ..

- name: Build
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}
- name: Build
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}

- name: Test
run: ctest
working-directory: build
- name: Test
run: ctest
working-directory: build
33 changes: 16 additions & 17 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@ jobs:
}

steps:
- name: Checkout atta
uses: actions/checkout@v2
- name: Checkout atta
uses: actions/checkout@v2

- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install cmake
cmake --version
- name: Install dependencies
run: |
choco install cmake
cmake --version

- name: Configure
run: |
mkdir build
cd build
cmake ..
- name: Configure
run: |
mkdir build
cd build
cmake ..

- name: Build
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}
- name: Build
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}

- name: Test
run: ctest
working-directory: build
- name: Test
run: ctest
working-directory: build
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.14)

project(atta VERSION 0.2.0.0 LANGUAGES CXX C)
project(atta VERSION 0.4.0.0 LANGUAGES CXX C)

OPTION(ATTA_BUILD_TESTS
"Set to ON to build also the test executables"
Expand All @@ -22,8 +22,8 @@ set(ATTA_VERSION_SAFE atta-${CMAKE_PROJECT_VERSION})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/atta/cmakeConfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/atta/cmakeConfig.h)

# Set flags necessary for the script system to work correctly
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Set flags necessary for the script system to work correctly
set(CMAKE_CXX_FLAGS "-Wl,--export-dynamic")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--export-dynamic")
endif()
Expand Down Expand Up @@ -253,6 +253,8 @@ if(NOT (ATTA_SYSTEM_NAME MATCHES "Web") AND NOT ATTA_STATIC_PROJECT_FILE)
FILES_MATCHING REGEX ".*\.(h|inl)$")
install(DIRECTORY ${CMAKE_BINARY_DIR}/_deps/implot-src/ DESTINATION include/${ATTA_VERSION_SAFE}/extern/implot
FILES_MATCHING REGEX ".*\.(h|cpp)$")
install(DIRECTORY ${CMAKE_BINARY_DIR}/_deps/bullet3-src/ DESTINATION include/${ATTA_VERSION_SAFE}/extern/bullet3
FILES_MATCHING REGEX ".*\.(h|cpp)$")
install(DIRECTORY src/extern/glad/ DESTINATION include/${ATTA_VERSION_SAFE}/extern/glad
FILES_MATCHING REGEX ".*\.(h|inl)$")
install(DIRECTORY src/extern/stb_image/ DESTINATION include/${ATTA_VERSION_SAFE}/extern/stb_image
Expand All @@ -262,6 +264,8 @@ if(NOT (ATTA_SYSTEM_NAME MATCHES "Web") AND NOT ATTA_STATIC_PROJECT_FILE)
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE})
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/extern/imgui)
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/extern/implot)
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/extern/bullet3/src)
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/extern/segvcatch/lib)
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/extern/glad/include)
list(APPEND ATTA_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/extern/stb_image)
set(ATTA_INSTALL_PCH ${CMAKE_INSTALL_PREFIX}/include/${ATTA_VERSION_SAFE}/atta/pch.h)
Expand Down
80 changes: 55 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,40 +77,70 @@ Arrows show dependencies between modules. Green boxes show which features are im
This project aims to simulate complex systems like this, mainly composed of robots.

## Build & test
#### Dependencies
To build atta properly, you need to have cmake installed.
Dependencies for some operating systems:

**Windows:**
```bash
choco install cmake
```

**MacOS:**
```bash
brew install cmake
```

**Linux:**
```bash
sudo apt-get install cmake xorg-dev curl
```

#### Clone
Atta should build without errors when the **compiller supports C++17** (g++ >= 9.0).
<!------------ Windows ------------>
<details><summary> Windows </summary>
<h4>Dependencies</h4>
To build atta properly, you need to have cmake installed.
<pre><code>choco install cmake</code></pre>
Also, be sure that your <strong>compiller supports C++17</strong> (g++ >= 9.0).

If you found any errors, please do not hesitate to [create an issue](https://github.com/brenocq/atta/issues/new?assignees=brenocq&labels=fix&template=bug_report.md&title=) :wink:.
<h4>Run</h4>
<pre><code>git clone [email protected]:brenocq/atta.git
cd atta
mkdir build
cd build
cmake ..
</code></pre>

You can now use Visual Studio to open the <code>atta.sln</code> file.
</details>
<!------------ MacOS ------------>
<details><summary> MacOS </summary>
<h4>Dependencies</h4>
To build atta properly, you need to have cmake installed.
<pre><code>brew install cmake</code></pre>
Also, be sure that your <strong>compiller supports C++17</strong> (g++ >= 9.0).

```bash
git clone [email protected]:brenocq/atta.git
<h4>Run</h4>
<pre><code>git clone [email protected]:brenocq/atta.git
cd atta
./scripts/build.sh --help
./scripts/build.sh
./build/release/bin/atta_test
./build/release/bin/atta
```
</code></pre>
</details>
<!------------ Linux ------------>
<details><summary> Linux </summary>
<h3>Dependencies</h3>
To build atta, you need:
<ul>
<li>g++ >= 9.0</li>
<li>cmake >= 3.14</li>
</ul>

<strong>Ubuntu:</strong>
<pre><code>sudo apt-get install g++ cmake git xorg-dev curl</code></pre>
<i>Note: If your ubuntu is old, you may need to install the latest cmake/g++ manually.</i>

<strong>Fedora:</strong>
<pre><code>sudo yum install g++ cmake git glfw-devel curl</code></pre>

<strong>Arch:</strong>
<pre><code>sudo pacman -Sy g++ cmake git glfw-x11 curl</code></pre>

<h3>Run</h3>
<pre><code>git clone [email protected]:brenocq/atta.git
cd atta
./build.sh --help
./build.sh
./build/release/bin/atta_test
./build/release/bin/atta
</code></pre>
</details>

_Obs: The build script should help the user with dependencies. If you found ploblems please let me know_
If you found any errors, please do not hesitate to [create an issue](https://github.com/brenocq/atta/issues/new?assignees=brenocq&labels=fix&template=bug_report.md&title=) :wink:.

## Discussions
If you want to contribute, have ideas, or have questions about atta, feel free to [start a discussion](https://github.com/brenocq/atta/discussions).
Expand Down
21 changes: 15 additions & 6 deletions scripts/build.sh → build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
SOURCE_PATH="$SCRIPT_PATH/.."
SOURCE_PATH="$SCRIPT_PATH"
BUILD_PATH="$SOURCE_PATH/build"
CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release"
CMAKE_COMPILER=""
Expand All @@ -14,14 +14,15 @@ BUILD_TYPE="default"
RUN_AFTER="false"
PROJECT_TO_RUN=""
INSTALL_AFTER="false"
NUM_JOBS=""

printHelp()
{
echo "Atta build script"
echo
echo "Usage: ./build.sh [args ...]"
echo "Usage: ./build.sh [option(s)]"
echo
echo "options:"
echo "Options:"
echo
echo "-h or --help"
echo " This help menu"
Expand All @@ -39,6 +40,9 @@ printHelp()
echo "-c or --compiler <name>"
echo " Select the compiler."
echo
echo "-j or --jobs <num_jobs>"
echo " Set number of jobs to use when building."
echo
echo "-s or --static <project_file>"
echo " Build statically linked to a project."
echo " The file should be a valid .atta"
Expand All @@ -59,7 +63,7 @@ buildDefault()
echo "---------- Building ----------"
# Build
cmake $CMAKE_BUILD_TYPE $CMAKE_COMPILER $CMAKE_ATTA_STATIC $SOURCE_PATH
make -j
make -j $NUM_JOBS

# Install
if [[ "$INSTALL_AFTER" == "true" ]]; then
Expand Down Expand Up @@ -97,7 +101,7 @@ buildWeb()
# Build
echo "---------- Building web ----------"
emcmake cmake $CMAKE_MODULE $CMAKE_BUILD_TYPE $CMAKE_ATTA_STATIC $SOURCE_PATH
make -j
make -j $NUM_JOBS

# Run
if [[ "$RUN_AFTER" == "true" ]]; then
Expand All @@ -112,7 +116,7 @@ buildDocs()
{
echo "---------- Building docs ----------"
cmake -ATTA_BUILD_DOCS=ON -DATTA_BUILD_TESTS=OFF $SOURCE_PATH
make -j
make -j $NUM_JOBS
exit
}

Expand All @@ -136,6 +140,11 @@ while [[ $# -gt 0 ]]; do
RUN_AFTER="true"
shift # past argument
;;
-j|--jobs)
NUM_JOBS="$2"
shift # past argument
shift # past value
;;
-p|--project)
PROJECT_TO_RUN="$2"
shift # past argument
Expand Down
Loading