├── .clang-format ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── config.yml │ └── feature-request.md ├── dependabot.yml ├── scripts │ ├── .gitignore │ └── readme_svgs │ │ ├── .gitignore │ │ ├── common.py │ │ ├── gen_issue_cards.py │ │ ├── gen_status_cards.py │ │ ├── github_data.py │ │ └── requirements.txt └── workflows │ ├── format-check.yml │ ├── linux.yml │ ├── macos.yml │ ├── status-label.yml │ ├── update-readme.yml │ ├── versioning.yml │ ├── web.yml │ └── windows.yml ├── .gitignore ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── build.sh ├── cmake ├── attaConfig.cmake.in ├── attaUninstall.cmake.in ├── log.cmake └── macros.cmake ├── docs ├── CMakeLists.txt ├── Doxyfile.in ├── extra-dark-toggle.css ├── extra-darkmode-toggle.js ├── extra-sidebar-only.css ├── extra.css ├── footer.html ├── gettingStarted.md ├── header.html ├── installation.md ├── references.md └── systemsOverview.md └── src ├── atta ├── CMakeLists.txt ├── atta.cpp ├── atta.h ├── cmakeConfig.h.in ├── component │ ├── CMakeLists.txt │ ├── base.h │ ├── componentRegistry.cpp │ ├── componentRegistry.h │ ├── components │ │ ├── boxCollider.cpp │ │ ├── boxCollider.h │ │ ├── boxCollider2D.cpp │ │ ├── boxCollider2D.h │ │ ├── cameraSensor.cpp │ │ ├── cameraSensor.h │ │ ├── circleCollider2D.cpp │ │ ├── circleCollider2D.h │ │ ├── component.h │ │ ├── components.h │ │ ├── cylinderCollider.cpp │ │ ├── cylinderCollider.h │ │ ├── directionalLight.cpp │ │ ├── directionalLight.h │ │ ├── environmentLight.cpp │ │ ├── environmentLight.h │ │ ├── infraredSensor.cpp │ │ ├── infraredSensor.h │ │ ├── material.cpp │ │ ├── material.h │ │ ├── mesh.cpp │ │ ├── mesh.h │ │ ├── name.cpp │ │ ├── name.h │ │ ├── pointLight.cpp │ │ ├── pointLight.h │ │ ├── polygonCollider2D.cpp │ │ ├── polygonCollider2D.h │ │ ├── prismaticJoint.cpp │ │ ├── prismaticJoint.h │ │ ├── prototype.cpp │ │ ├── prototype.h │ │ ├── relationship.cpp │ │ ├── relationship.h │ │ ├── revoluteJoint.cpp │ │ ├── revoluteJoint.h │ │ ├── rigidBody.cpp │ │ ├── rigidBody.h │ │ ├── rigidBody2D.cpp │ │ ├── rigidBody2D.h │ │ ├── rigidJoint.cpp │ │ ├── rigidJoint.h │ │ ├── script.cpp │ │ ├── script.h │ │ ├── sphereCollider.cpp │ │ ├── sphereCollider.h │ │ ├── transform.cpp │ │ └── transform.h │ ├── entity.cpp │ ├── entity.h │ ├── factory.cpp │ ├── factory.h │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ ├── manager.inl │ ├── typedComponentRegistry.cpp │ ├── typedComponentRegistry.h │ └── typedComponentRegistry.inl ├── event │ ├── CMakeLists.txt │ ├── event.cpp │ ├── event.h │ ├── events │ │ ├── createComponent.h │ │ ├── createEntity.h │ │ ├── deleteComponent.h │ │ ├── deleteEntity.h │ │ ├── fileWatch.h │ │ ├── imageLoad.h │ │ ├── imageUpdate.h │ │ ├── materialCreate.h │ │ ├── materialDestroy.h │ │ ├── materialUpdate.h │ │ ├── meshDestroy.h │ │ ├── meshLoad.h │ │ ├── meshUpdate.h │ │ ├── projectBeforeDeserialize.h │ │ ├── projectClose.h │ │ ├── projectOpen.h │ │ ├── projectSave.h │ │ ├── scriptTarget.h │ │ ├── simulationContinue.h │ │ ├── simulationPause.h │ │ ├── simulationStart.h │ │ ├── simulationStep.h │ │ ├── simulationStop.h │ │ ├── uiCameraComponent.h │ │ ├── windowClose.h │ │ ├── windowFocus.h │ │ ├── windowKeyboardButton.h │ │ ├── windowMouseButton.h │ │ ├── windowMouseMove.h │ │ ├── windowMouseScroll.h │ │ └── windowResize.h │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ └── tests │ │ └── test.cpp ├── file │ ├── CMakeLists.txt │ ├── interface.cpp │ ├── interface.h │ ├── interface.inl │ ├── manager.cpp │ ├── manager.h │ ├── project │ │ ├── project.cpp │ │ ├── project.h │ │ ├── projectSerializer.cpp │ │ └── projectSerializer.h │ ├── serializer │ │ ├── section.cpp │ │ ├── section.h │ │ ├── section.inl │ │ ├── serializer.cpp │ │ └── serializer.h │ ├── tests │ │ └── serializer.cpp │ └── watchers │ │ ├── fileWatcher.cpp │ │ ├── fileWatcher.h │ │ ├── linuxFileWatcher.cpp │ │ ├── linuxFileWatcher.h │ │ ├── nullFileWatcher.cpp │ │ └── nullFileWatcher.h ├── graphics │ ├── CMakeLists.txt │ ├── apis │ │ ├── graphicsAPI.cpp │ │ ├── graphicsAPI.h │ │ ├── openGL │ │ │ ├── base.h │ │ │ ├── framebuffer.cpp │ │ │ ├── framebuffer.h │ │ │ ├── image.cpp │ │ │ ├── image.h │ │ │ ├── indexBuffer.cpp │ │ │ ├── indexBuffer.h │ │ │ ├── mesh.cpp │ │ │ ├── mesh.h │ │ │ ├── openGL.h │ │ │ ├── openGLAPI.cpp │ │ │ ├── openGLAPI.h │ │ │ ├── pipeline.cpp │ │ │ ├── pipeline.h │ │ │ ├── renderPass.cpp │ │ │ ├── renderPass.h │ │ │ ├── renderQueue.cpp │ │ │ ├── renderQueue.h │ │ │ ├── shader.cpp │ │ │ ├── shader.h │ │ │ ├── vertexBuffer.cpp │ │ │ └── vertexBuffer.h │ │ └── vulkan │ │ │ ├── buffer.cpp │ │ │ ├── buffer.h │ │ │ ├── commandBuffers.cpp │ │ │ ├── commandBuffers.h │ │ │ ├── commandPool.cpp │ │ │ ├── commandPool.h │ │ │ ├── common.cpp │ │ │ ├── common.h │ │ │ ├── debugMessenger.cpp │ │ │ ├── debugMessenger.h │ │ │ ├── descriptorPool.cpp │ │ │ ├── descriptorPool.h │ │ │ ├── descriptorSetLayout.cpp │ │ │ ├── descriptorSetLayout.h │ │ │ ├── descriptorSets.cpp │ │ │ ├── descriptorSets.h │ │ │ ├── device.cpp │ │ │ ├── device.h │ │ │ ├── fence.cpp │ │ │ ├── fence.h │ │ │ ├── framebuffer.cpp │ │ │ ├── framebuffer.h │ │ │ ├── image.cpp │ │ │ ├── image.h │ │ │ ├── indexBuffer.cpp │ │ │ ├── indexBuffer.h │ │ │ ├── instance.cpp │ │ │ ├── instance.h │ │ │ ├── mesh.cpp │ │ │ ├── mesh.h │ │ │ ├── physicalDevice.cpp │ │ │ ├── physicalDevice.h │ │ │ ├── pipeline.cpp │ │ │ ├── pipeline.h │ │ │ ├── pipelineLayout.cpp │ │ │ ├── pipelineLayout.h │ │ │ ├── pushConstant.cpp │ │ │ ├── pushConstant.h │ │ │ ├── renderPass.cpp │ │ │ ├── renderPass.h │ │ │ ├── renderQueue.cpp │ │ │ ├── renderQueue.h │ │ │ ├── semaphore.cpp │ │ │ ├── semaphore.h │ │ │ ├── shader.cpp │ │ │ ├── shader.h │ │ │ ├── stagingBuffer.cpp │ │ │ ├── stagingBuffer.h │ │ │ ├── surface.cpp │ │ │ ├── surface.h │ │ │ ├── swapChain.cpp │ │ │ ├── swapChain.h │ │ │ ├── uniformBuffer.cpp │ │ │ ├── uniformBuffer.h │ │ │ ├── vertexBuffer.cpp │ │ │ ├── vertexBuffer.h │ │ │ ├── vulkan.h │ │ │ ├── vulkanAPI.cpp │ │ │ └── vulkanAPI.h │ ├── base.h │ ├── bufferLayout.cpp │ ├── bufferLayout.h │ ├── cameras │ │ ├── camera.cpp │ │ ├── camera.h │ │ ├── orthographicCamera.cpp │ │ ├── orthographicCamera.h │ │ ├── perspectiveCamera.cpp │ │ └── perspectiveCamera.h │ ├── compute │ │ ├── entityClick.cpp │ │ └── entityClick.h │ ├── drawer.cpp │ ├── drawer.h │ ├── drawer.inl │ ├── framebuffer.cpp │ ├── framebuffer.h │ ├── image.cpp │ ├── image.h │ ├── indexBuffer.cpp │ ├── indexBuffer.h │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ ├── manager.inl │ ├── mesh.cpp │ ├── mesh.h │ ├── pipeline.cpp │ ├── pipeline.h │ ├── renderPass.cpp │ ├── renderPass.h │ ├── renderQueue.cpp │ ├── renderQueue.h │ ├── renderers │ │ ├── common │ │ │ ├── drawerPipeline.cpp │ │ │ ├── drawerPipeline.h │ │ │ ├── gridPipeline.cpp │ │ │ ├── gridPipeline.h │ │ │ ├── selectedPipeline.cpp │ │ │ └── selectedPipeline.h │ │ ├── fastRenderer.cpp │ │ ├── fastRenderer.h │ │ ├── pbrRenderer.cpp │ │ ├── pbrRenderer.h │ │ ├── phongRenderer.cpp │ │ ├── phongRenderer.h │ │ ├── renderer.cpp │ │ └── renderer.h │ ├── shader.cpp │ ├── shader.h │ ├── vertexBuffer.cpp │ ├── vertexBuffer.h │ └── windows │ │ ├── glfwWindow.cpp │ │ ├── glfwWindow.h │ │ ├── nullWindow.cpp │ │ ├── nullWindow.h │ │ ├── window.cpp │ │ └── window.h ├── io │ ├── CMakeLists.txt │ ├── bluetooth │ │ ├── bluetooth.cpp │ │ ├── bluetooth.h │ │ ├── linuxBluetooth.cpp │ │ ├── linuxBluetooth.h │ │ └── linuxBluetoothMsg.cpp │ ├── camera │ │ ├── camera.cpp │ │ ├── camera.h │ │ ├── linuxCamera.cpp │ │ └── linuxCamera.h │ ├── http │ │ ├── http.h │ │ ├── httpCurlpp.cpp │ │ ├── httpNull.cpp │ │ ├── httpWeb.cpp │ │ ├── json.cpp │ │ ├── json.h │ │ └── jsonParse.cpp │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ ├── manager.inl │ ├── serial │ │ ├── linuxSerial.cpp │ │ ├── linuxSerial.h │ │ ├── serial.cpp │ │ └── serial.h │ └── tests │ │ └── json.cpp ├── memory │ ├── CMakeLists.txt │ ├── allocatedObject.cpp │ ├── allocatedObject.h │ ├── allocatedObject.inl │ ├── allocator.cpp │ ├── allocator.h │ ├── allocators │ │ ├── bitmapAllocator.cpp │ │ ├── bitmapAllocator.h │ │ ├── bitmapAllocator.inl │ │ ├── mallocAllocator.cpp │ │ ├── mallocAllocator.h │ │ ├── poolAllocator.cpp │ │ ├── poolAllocator.h │ │ ├── poolAllocatorT.cpp │ │ ├── poolAllocatorT.h │ │ ├── poolAllocatorT.inl │ │ ├── stackAllocator.cpp │ │ ├── stackAllocator.h │ │ └── stackAllocator.inl │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ └── tests │ │ ├── allocatedObject.cpp │ │ ├── bitmapAllocator.cpp │ │ ├── poolAllocator.cpp │ │ ├── speed.cpp │ │ └── stackAllocator.cpp ├── pch.h ├── physics │ ├── CMakeLists.txt │ ├── engines │ │ ├── box2DEngine.cpp │ │ ├── box2DEngine.h │ │ ├── bulletEngine.cpp │ │ ├── bulletEngine.h │ │ ├── engine.cpp │ │ ├── engine.h │ │ ├── noneEngine.cpp │ │ └── noneEngine.h │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ └── manager.h ├── resource │ ├── CMakeLists.txt │ ├── core.h │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ ├── manager.inl │ ├── resource.cpp │ ├── resource.h │ └── resources │ │ ├── image.cpp │ │ ├── image.h │ │ ├── material.cpp │ │ ├── material.h │ │ ├── mesh.cpp │ │ ├── mesh.h │ │ └── resources.h ├── script │ ├── .gitignore │ ├── CMakeLists.txt │ ├── compilers │ │ ├── compiler.cpp │ │ ├── compiler.h │ │ ├── linuxCompiler.cpp │ │ ├── linuxCompiler.h │ │ ├── nullCompiler.cpp │ │ └── nullCompiler.h │ ├── core.h │ ├── interface.cpp │ ├── interface.h │ ├── linkers │ │ ├── linker.cpp │ │ ├── linker.h │ │ ├── linuxLinker.cpp │ │ ├── linuxLinker.h │ │ ├── nullLinker.cpp │ │ └── nullLinker.h │ ├── manager.cpp │ ├── manager.h │ ├── managerDynamic.cpp │ ├── managerStatic.cpp │ ├── projectScript.cpp │ ├── projectScript.h │ ├── script.cpp │ ├── script.h │ └── scripts.h.in ├── sensor │ ├── CMakeLists.txt │ ├── interface.cpp │ ├── interface.h │ ├── manager.cpp │ ├── manager.h │ ├── managerCamera.cpp │ └── managerInfrared.cpp ├── ui │ ├── CMakeLists.txt │ ├── drawers │ │ ├── physicsDrawer.cpp │ │ ├── physicsDrawer.h │ │ ├── sensorDrawer.cpp │ │ └── sensorDrawer.h │ ├── editor.cpp │ ├── editor.h │ ├── interface.cpp │ ├── interface.h │ ├── interface.inl │ ├── manager.cpp │ ├── manager.h │ ├── panels │ │ ├── toolBar │ │ │ ├── toolBar.cpp │ │ │ └── toolBar.h │ │ └── topBar │ │ │ ├── localWindows │ │ │ ├── repoWindow.cpp │ │ │ ├── repoWindow.h │ │ │ ├── versionWindow.cpp │ │ │ └── versionWindow.h │ │ │ ├── topBar.cpp │ │ │ └── topBar.h │ ├── widgets │ │ ├── align.cpp │ │ ├── align.h │ │ ├── button.cpp │ │ ├── button.h │ │ ├── component.cpp │ │ ├── component.h │ │ ├── gizmo.cpp │ │ ├── gizmo.h │ │ ├── help.cpp │ │ ├── help.h │ │ ├── image.cpp │ │ └── image.h │ └── windows │ │ ├── entityWindow.cpp │ │ ├── entityWindow.h │ │ ├── graphicsModuleWindow.cpp │ │ ├── graphicsModuleWindow.h │ │ ├── ioModuleWindow.cpp │ │ ├── ioModuleWindow.h │ │ ├── ioModuleWindowBluetooth.cpp │ │ ├── ioModuleWindowCamera.cpp │ │ ├── ioModuleWindowSerial.cpp │ │ ├── logWindow.cpp │ │ ├── logWindow.h │ │ ├── physicsModuleWindow.cpp │ │ ├── physicsModuleWindow.h │ │ ├── sensorModuleWindow.cpp │ │ ├── sensorModuleWindow.h │ │ ├── timeProfiler │ │ ├── components │ │ │ ├── flameGraph.cpp │ │ │ ├── flameGraph.h │ │ │ ├── tearDown.cpp │ │ │ ├── tearDown.h │ │ │ ├── timeline.cpp │ │ │ └── timeline.h │ │ ├── timeProfilerWindow.cpp │ │ └── timeProfilerWindow.h │ │ ├── utils │ │ ├── fileSelectionWindow.cpp │ │ └── fileSelectionWindow.h │ │ ├── viewport │ │ ├── viewport.cpp │ │ ├── viewport.h │ │ ├── viewportWindows.cpp │ │ └── viewportWindows.h │ │ ├── window.cpp │ │ └── window.h └── utils │ ├── CMakeLists.txt │ ├── assert.h │ ├── common.h │ ├── config.cpp │ ├── config.h │ ├── log.cpp │ ├── log.h │ ├── log.inl │ ├── math │ ├── bounds.cpp │ ├── bounds.h │ ├── common.cpp │ ├── common.h │ ├── math.h │ ├── matrix.cpp │ ├── matrix.h │ ├── matrix.inl │ ├── quaternion.cpp │ ├── quaternion.h │ ├── ray.cpp │ ├── ray.h │ ├── vector.cpp │ ├── vector.h │ ├── vector.inl │ ├── vector2.inl │ ├── vector3.inl │ └── vector4.inl │ ├── namespaces.h │ ├── profiler.cpp │ ├── profiler.h │ ├── stringId.cpp │ ├── stringId.h │ ├── stringId.inl │ ├── stringUtils.cpp │ ├── stringUtils.h │ └── tests │ ├── math.cpp │ ├── matrix.cpp │ ├── quaternion.cpp │ ├── stringId.cpp │ └── stringUtils.cpp ├── extern ├── extern.cmake ├── glad │ ├── CMakeLists.txt │ ├── include │ │ ├── EGL │ │ │ └── eglplatform.h │ │ ├── KHR │ │ │ └── khrplatform.h │ │ └── glad │ │ │ ├── egl.h │ │ │ ├── gl.h │ │ │ └── gles2.h │ └── src │ │ ├── egl.c │ │ ├── gl.c │ │ └── gles2.c ├── solveAssimp.cmake ├── solveBox2d.cmake ├── solveBullet.cmake ├── solveCurlpp.cmake ├── solveGlad.cmake ├── solveGlfw.cmake ├── solveGoogleTest.cmake ├── solveImgui.cmake ├── solveImguizmo.cmake ├── solveImplot.cmake ├── solveImplot3d.cmake ├── solveResources.cmake ├── solveShaderc.cmake ├── solveStbImage.cmake ├── solveSystemd.cmake ├── solveVolk.cmake └── stb_image │ ├── stb_image.h │ └── stb_image_write.h └── main.cpp /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: LLVM 4 | PointerAlignment: Left 5 | AlwaysBreakTemplateDeclarations: true 6 | ColumnLimit: 150 7 | IndentWidth: 4 8 | IndentCaseLabels: true 9 | ... 10 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @brenocq 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐛 Bug report 3 | about: Create a bug report to help us improve Atta 4 | title: '[Bug] A brief, descriptive title' 5 | labels: type:fix, status:todo, prio:high 6 | assignees: brenocq 7 | --- 8 | **Bug description** 9 | A clear and concise description of what the bug is. 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ❓ Q&A 4 | url: https://github.com/brenocq/atta/discussions/categories/q-a 5 | about: Please use GitHub Discussions for questions, help requests, and general chat 6 | - name: 📸 Atta Gallery 7 | url: https://github.com/brenocq/atta/discussions/categories/gallery 8 | about: Check out the gallery for examples of what Atta can do 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🚀 Feature request 3 | about: Suggest an idea or enhancement for Atta 4 | title: '[Feature] A brief, descriptive title' 5 | labels: type:feat, status:idea 6 | --- 7 | **Feature description** 8 | A clear and concise description of the new feature. 9 | 10 | **Tasks** (Optional: For maintainers to outline implementation steps) 11 | Add a list of tasks that should be performed to implement the feature. 12 | - [ ] Task 1 13 | - [ ] Sub-task 1 14 | - [ ] Task 2 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | target-branch: "main" 8 | labels: 9 | - "type:chore" 10 | - "prio:low" 11 | - "status:review" 12 | assignees: 13 | - "brenocq" 14 | groups: 15 | github-actions: 16 | patterns: 17 | - "*" 18 | -------------------------------------------------------------------------------- /.github/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | # Python environment 2 | env/ 3 | .env/ 4 | .venv/ 5 | venv/ 6 | 7 | # Python cache 8 | __pycache__/ 9 | -------------------------------------------------------------------------------- /.github/scripts/readme_svgs/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore generated SVG files 2 | *.svg 3 | -------------------------------------------------------------------------------- /.github/scripts/readme_svgs/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.32.5 2 | pillow==11.3.0 3 | -------------------------------------------------------------------------------- /.github/workflows/format-check.yml: -------------------------------------------------------------------------------- 1 | name: 🕵 Check clang-format 2 | 3 | on: 4 | pull_request: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | format-check: 9 | name: Check clang-format 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v5 15 | 16 | - name: Install clang-format 17 | run: | 18 | sudo apt-get update 19 | sudo apt-get install -y clang-format 20 | 21 | - name: Check clang-format 22 | run: | 23 | find src/atta/ -type f \( -name "*.h" -o -name "*.cpp" -o -name "*.inl" \) -exec clang-format --dry-run --Werror {} + 24 | -------------------------------------------------------------------------------- /.github/workflows/linux.yml: -------------------------------------------------------------------------------- 1 | name: 🐧 Linux 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | name: ${{ matrix.config.name }} - Build and test 13 | runs-on: ${{ matrix.config.os }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | config: 18 | - { name: "Ubuntu g++", os: ubuntu-latest, compiler: "g++" } 19 | - { name: "Ubuntu clang++", os: ubuntu-latest, compiler: "clang++" } 20 | 21 | steps: 22 | - name: Checkout atta 23 | uses: actions/checkout@v5 24 | 25 | - name: Install dependencies 26 | run: | 27 | sudo apt-get update 28 | sudo apt-get install cmake xorg-dev curl 29 | 30 | - name: Build 31 | run: ./build.sh --jobs 2 --compiler ${{ matrix.config.compiler }} 32 | 33 | - name: Test 34 | run: ctest 35 | working-directory: build/release 36 | -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: 🍎 MacOS 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | name: ${{ matrix.config.name }} - Build and test 13 | runs-on: ${{ matrix.config.os }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | config: 18 | - { name: "MacOS Latest", os: macos-latest, build_type: "Release" } 19 | 20 | steps: 21 | - name: Checkout atta 22 | uses: actions/checkout@v5 23 | 24 | - name: Configure 25 | run: | 26 | mkdir build 27 | cd build 28 | cmake .. 29 | 30 | - name: Build 31 | run: cmake --build build --parallel --config ${{ matrix.config.build_type }} 32 | 33 | - name: Test 34 | run: ctest 35 | working-directory: build 36 | -------------------------------------------------------------------------------- /.github/workflows/web.yml: -------------------------------------------------------------------------------- 1 | name: 🕸️ Web 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | name: ${{ matrix.config.name }} - Build 13 | runs-on: ${{ matrix.config.os }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | config: 18 | - { name: "Web Latest", os: ubuntu-latest, build_type: "Release" } 19 | 20 | steps: 21 | - uses: mymindstorm/setup-emsdk@v14 22 | 23 | - name: Checkout atta 24 | uses: actions/checkout@v5 25 | 26 | - name: Configure 27 | run: | 28 | mkdir build 29 | cd build 30 | emcmake cmake .. 31 | 32 | - name: Build 33 | run: cmake --build build --parallel --config ${{ matrix.config.build_type }} 34 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: 🪟 Windows 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | name: ${{ matrix.config.name }} - Build and test 13 | runs-on: ${{ matrix.config.os }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | config: 18 | - { name: "Windows Latest", os: windows-latest, build_type: "Release" } 19 | 20 | steps: 21 | - name: Checkout atta 22 | uses: actions/checkout@v5 23 | 24 | - name: Install dependencies 25 | run: | 26 | choco install cmake 27 | cmake --version 28 | 29 | - name: Configure 30 | run: | 31 | mkdir build 32 | cd build 33 | cmake .. 34 | 35 | - name: Build 36 | run: cmake --build build --parallel --config ${{ matrix.config.build_type }} 37 | 38 | - name: Test 39 | run: ctest 40 | working-directory: build 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Swap 2 | *.swp 3 | *.swo 4 | 5 | # Compiled shaders 6 | *.spv 7 | 8 | # Build 9 | /build/ 10 | /scripts/local_*.sh 11 | /projects/ 12 | /resources/ 13 | 14 | # Visual Studio 15 | /.vs 16 | /CMakeSettings.json 17 | 18 | # Vim 19 | codecompanion*.json 20 | 21 | # Local config 22 | /src/atta/cmakeConfig.h 23 | 24 | # ImGui 25 | imgui.ini 26 | 27 | # Debugging/Profile 28 | .cache/ 29 | perf.* 30 | .gdb_history 31 | profile/ 32 | compile_commands.json 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2025 Breno Cunha Queiroz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cmake/attaUninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 3 | endif() 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 9 | if(EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if("${rm_retval}" STREQUAL 0) 16 | else() 17 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 18 | endif() 19 | else() 20 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 21 | endif() 22 | endforeach() 23 | -------------------------------------------------------------------------------- /cmake/log.cmake: -------------------------------------------------------------------------------- 1 | if(NOT WIN32) 2 | string(ASCII 27 Esc) 3 | set(Reset "${Esc}[m") 4 | set(Bold "${Esc}[1m") 5 | set(Red "${Esc}[31m") 6 | set(Green "${Esc}[32m") 7 | set(Yellow "${Esc}[33m") 8 | set(Blue "${Esc}[34m") 9 | set(Magenta "${Esc}[35m") 10 | set(Cyan "${Esc}[36m") 11 | set(White "${Esc}[37m") 12 | set(BoldRed "${Esc}[1;31m") 13 | set(BoldGreen "${Esc}[1;32m") 14 | set(BoldYellow "${Esc}[1;33m") 15 | set(BoldBlue "${Esc}[1;34m") 16 | set(BoldMagenta "${Esc}[1;35m") 17 | set(BoldCyan "${Esc}[1;36m") 18 | set(BoldWhite "${Esc}[1;37m") 19 | endif() 20 | 21 | macro(atta_log type tag message) 22 | set(atta_log_color ${Reset}) 23 | if(${type} STREQUAL "Debug") 24 | set(atta_log_color ${Magenta}) 25 | elseif(${type} STREQUAL "Info") 26 | set(atta_log_color ${Cyan}) 27 | elseif(${type} STREQUAL "Success") 28 | set(atta_log_color ${Green}) 29 | elseif(${type} STREQUAL "Warn") 30 | set(atta_log_color ${Yellow}) 31 | endif() 32 | message(STATUS "${Bold}${atta_log_color}[${tag}] ${Reset}${atta_log_color}${message}${Reset}") 33 | endmacro() 34 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(ATTA_DOXYGEN_MARKDOWN 2 | "docs/gettingStarted.md" 3 | "docs/installation.md" 4 | "docs/systemsOverview.md" 5 | "docs/references.md" 6 | ) 7 | 8 | list(APPEND ATTA_DOXYGEN_SOURCES ${ATTA_DOXYGEN_MARKDOWN}) 9 | file(GLOB_RECURSE ATTA_DOXYGEN_HEADERS "../src/atta/*.h") 10 | foreach(header IN LISTS ATTA_DOXYGEN_HEADERS) 11 | file(RELATIVE_PATH relHeader ${CMAKE_SOURCE_DIR} ${header}) 12 | list(APPEND ATTA_DOXYGEN_SOURCES ${relHeader}) 13 | endforeach() 14 | 15 | # Format the source list into a Doxyfile INPUT value that Doxygen can parse 16 | foreach(path IN LISTS ATTA_DOXYGEN_SOURCES) 17 | set(ATTA_DOXYGEN_INPUT "${ATTA_DOXYGEN_INPUT} \\\n\"${CMAKE_SOURCE_DIR}/${path}\"") 18 | endforeach() 19 | 20 | # https://cmake.org/cmake/help/latest/command/configure_file.html 21 | configure_file(Doxyfile.in Doxyfile @ONLY) 22 | 23 | add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}" 24 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs" 25 | COMMENT "Generating HTML documentation" VERBATIM) 26 | 27 | install( 28 | DIRECTORY "${CMAKE_BINARY_DIR}/docs/html" 29 | DESTINATION "${CMAKE_INSTALL_DOCDIR}" 30 | ) 31 | -------------------------------------------------------------------------------- /docs/references.md: -------------------------------------------------------------------------------- 1 | # References 2 | - [Physically Based Rendering](http://www.pbr-book.org/) 3 | - [Game Physics Engine Development](https://www.amazon.com/Game-Physics-Engine-Development-Commercial-Grade/dp/0123819768) 4 | - [Real-Time Collision Detection](https://www.amazon.com/Real-Time-Collision-Detection-Interactive-Technology/dp/1558607323) 5 | - [Computer Graphics Principles and Practice](http://cgpp.net/about.xml) 6 | - [Programming Massively Parallel Processors](https://www.amazon.com/Programming-Massively-Parallel-Processors-Hands/dp/0128119861) 7 | - [Numerical Recipes: The Art of Scientific Computing](http://numerical.recipes/com/storefront.html) 8 | - [Game Programming Patterns](https://gameprogrammingpatterns.com) 9 | - [Game Engine Architecture](https://www.gameenginebook.com) 10 | - [C++ Templates: The Complete Guide](http://www.tmplbook.com) 11 | -------------------------------------------------------------------------------- /docs/systemsOverview.md: -------------------------------------------------------------------------------- 1 | # Systems Overview 2 | ## Component System 3 | ## Event System 4 | ## File System 5 | ## Graphics System 6 | ## IO System 7 | ## Memory System 8 | ## Physics System 9 | ## Resource System 10 | ## Script System 11 | ## Sensor System 12 | ## UI System 13 | -------------------------------------------------------------------------------- /src/atta/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(ATTA_SOURCE 4 | atta.cpp 5 | ) 6 | 7 | add_library(atta_lib STATIC 8 | ${ATTA_SOURCE} 9 | ) 10 | atta_target_common(atta_lib) 11 | atta_add_libs(atta_lib) 12 | 13 | ########## Subsystems ########## 14 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utils) 15 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/memory) 16 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/event) 17 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/file) 18 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/component) 19 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/graphics) 20 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/resource) 21 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/script) 22 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/physics) 23 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/sensor) 24 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/io) 25 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ui) 26 | 27 | set(ATTA_TEST_SOURCES ${ATTA_TEST_SOURCES} PARENT_SCOPE) 28 | set(ATTA_LIBS ${ATTA_LIBS} PARENT_SCOPE) 29 | -------------------------------------------------------------------------------- /src/atta/atta.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta 3 | // atta.h 4 | // Date: 2021-08-17 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_ATTA_H 8 | #define ATTA_ATTA_H 9 | #include 10 | #include 11 | #include 12 | 13 | namespace atta { 14 | class Atta { 15 | public: 16 | struct CreateInfo { 17 | std::filesystem::path projectFile = ""; 18 | }; 19 | 20 | Atta(const CreateInfo& info); 21 | ~Atta(); 22 | 23 | void run(); 24 | void loop(); 25 | void step(); 26 | 27 | private: 28 | // Handle events 29 | void onWindowClose(event::Event& event); 30 | void onSimulationStateChange(event::Event& event); 31 | 32 | // Memory 33 | memory::StackAllocator* _mainAllocator; 34 | 35 | // State 36 | bool _shouldFinish; 37 | bool _shouldStep; 38 | clock_t _lastStep; 39 | clock_t _currStep; 40 | }; 41 | } // namespace atta 42 | 43 | #endif // ATTA_ATTA_H 44 | -------------------------------------------------------------------------------- /src/atta/cmakeConfig.h.in: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta 3 | // cmakeConfig.h 4 | // Date: 2021-09-15 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_CMAKE_CONFIG 8 | #define ATTA_CMAKE_CONFIG 9 | 10 | #ifdef ATTA_OS_WEB 11 | #define ATTA_DIR "/" 12 | #define ATTA_BUILD_DIR "/" 13 | #else 14 | #define ATTA_DIR "@CMAKE_SOURCE_DIR@" 15 | #define ATTA_BUILD_DIR "@CMAKE_BINARY_DIR@" 16 | #endif 17 | 18 | #define ATTA_VERSION "@CMAKE_PROJECT_VERSION@" 19 | #define ATTA_VERSION_MAJOR @CMAKE_PROJECT_VERSION_MAJOR@ 20 | #define ATTA_VERSION_MINOR @CMAKE_PROJECT_VERSION_MINOR@ 21 | #define ATTA_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@ 22 | 23 | // Directory to look which atta versions are installed 24 | #define ATTA_INSTALLED_VERSIONS_DIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" 25 | 26 | // Project path when atta is built statically linked to one project 27 | #ifdef ATTA_STATIC_PROJECT 28 | 29 | #ifdef ATTA_OS_WEB 30 | #define ATTA_STATIC_PROJECT_FILE "/project/project.atta" 31 | #else 32 | #define ATTA_STATIC_PROJECT_FILE "@ATTA_STATIC_PROJECT_FILE@" 33 | #endif 34 | 35 | #endif 36 | 37 | #endif// ATTA_CMAKE_CONFIG 38 | -------------------------------------------------------------------------------- /src/atta/component/componentRegistry.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // componentRegistry.cpp 4 | // Date: 2021-11-05 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | #include 9 | #include 10 | 11 | namespace atta::component { 12 | 13 | void ComponentRegistry::registerToManager() { component::registerComponent(this); } 14 | 15 | } // namespace atta::component 16 | -------------------------------------------------------------------------------- /src/atta/component/components/boxCollider.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // boxCollider.cpp 4 | // Date: 2021-11-30 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Box Collider", 14 | {{AttributeType::VECTOR_FLOAT32, offsetof(BoxCollider, size), "size", 0.0001f, 2000.0f, 0.01f}, 15 | {AttributeType::VECTOR_FLOAT32, offsetof(BoxCollider, offset), "offset", -2000.0f, 2000.0f, 0.01f}}}; 16 | 17 | return desc; 18 | } 19 | 20 | } // namespace atta::component 21 | -------------------------------------------------------------------------------- /src/atta/component/components/boxCollider.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // boxCollider.h 4 | // Date: 2021-11-30 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_BOX_COLLIDER_H 8 | #define ATTA_COMPONENT_COMPONENTS_BOX_COLLIDER_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to create a box collider 15 | /** This collider can be used with 3D physics. 16 | * 17 | * Transform and RigidBody components are necessary 18 | * for the entity to participate in the physics iteration. 19 | * 20 | * The box will also be scaled by the Transform scale. 21 | */ 22 | struct BoxCollider final : public Component { 23 | vec3 size = {1.0f, 1.0f, 1.0f}; ///< Size 24 | vec3 offset = {0.0f, 0.0f, 0.0f}; ///< Offset 25 | }; 26 | ATTA_REGISTER_COMPONENT(BoxCollider) 27 | template <> 28 | ComponentDescription& TypedComponentRegistry::getDescription(); 29 | 30 | } // namespace atta::component 31 | 32 | #endif // ATTA_COMPONENT_COMPONENTS_BOX_COLLIDER_H 33 | -------------------------------------------------------------------------------- /src/atta/component/components/boxCollider2D.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // boxCollider2D.cpp 4 | // Date: 2022-10-16 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = { 14 | "Box Collider 2D", 15 | { 16 | {AttributeType::VECTOR_FLOAT32, offsetof(BoxCollider2D, size), "size", 0.0001f, 2000.0f, 0.01f}, 17 | {AttributeType::VECTOR_FLOAT32, offsetof(BoxCollider2D, offset), "offset", -2000.0f, 2000.0f, 0.01f}, 18 | }, 19 | }; 20 | 21 | return desc; 22 | } 23 | 24 | } // namespace atta::component 25 | -------------------------------------------------------------------------------- /src/atta/component/components/boxCollider2D.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // boxCollider2D.h 4 | // Date: 2022-10-16 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_BOX_COLLIDER_2D_H 8 | #define ATTA_COMPONENT_COMPONENTS_BOX_COLLIDER_2D_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to create a box collider 15 | /** This collider can be used for 2D physics. 16 | * 17 | * Transform and RigidBody2D components are necessary 18 | * for the entity to participate in the physics iteration. 19 | * 20 | * The box will also be scaled by the Transform. 21 | */ 22 | struct BoxCollider2D final : public Component { 23 | vec2 size = {1.0f, 1.0f}; ///< Size 24 | vec2 offset = {0.0f, 0.0f}; ///< Offset 25 | }; 26 | ATTA_REGISTER_COMPONENT(BoxCollider2D) 27 | template <> 28 | ComponentDescription& TypedComponentRegistry::getDescription(); 29 | 30 | } // namespace atta::component 31 | 32 | #endif // ATTA_COMPONENT_COMPONENTS_BOX_COLLIDER_2D_H 33 | -------------------------------------------------------------------------------- /src/atta/component/components/circleCollider2D.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // circleCollider2D.cpp 4 | // Date: 2021-11-30 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | #include 9 | 10 | namespace atta::component { 11 | 12 | template <> 13 | ComponentDescription& TypedComponentRegistry::getDescription() { 14 | static ComponentDescription desc = { 15 | "Circle Collider 2D", 16 | { 17 | {AttributeType::FLOAT32, offsetof(CircleCollider2D, radius), "radius", 0.0001f, 2000.0f, 0.01f}, 18 | {AttributeType::VECTOR_FLOAT32, offsetof(CircleCollider2D, offset), "offset", -2000.0f, 2000.0f, 0.01f}, 19 | }, 20 | }; 21 | 22 | return desc; 23 | } 24 | 25 | } // namespace atta::component 26 | -------------------------------------------------------------------------------- /src/atta/component/components/component.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // component.h 4 | // Date: 2021-11-03 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_H 8 | #define ATTA_COMPONENT_COMPONENTS_H 9 | 10 | namespace atta::component { 11 | 12 | /// Base class for all components 13 | struct Component { 14 | public: 15 | ~Component() = default; 16 | }; 17 | 18 | } // namespace atta::component 19 | 20 | #endif // ATTA_COMPONENT_COMPONENTS_H 21 | -------------------------------------------------------------------------------- /src/atta/component/components/cylinderCollider.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // cylinderCollider.cpp 4 | // Date: 2022-10-15 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = { 14 | "Cylinder Collider", 15 | { 16 | {AttributeType::FLOAT32, offsetof(CylinderCollider, radius), "radius", 0.0001f, 2000.0f, 0.01f}, 17 | {AttributeType::FLOAT32, offsetof(CylinderCollider, height), "height", 0.0001f, 2000.0f, 0.01f}, 18 | {AttributeType::VECTOR_FLOAT32, offsetof(CylinderCollider, offset), "offset", -2000.0f, 2000.0f, 0.01f}, 19 | }, 20 | }; 21 | 22 | return desc; 23 | } 24 | 25 | } // namespace atta::component 26 | -------------------------------------------------------------------------------- /src/atta/component/components/cylinderCollider.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // cylinderCollider.h 4 | // Date: 2022-10-15 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_CYLINDER_COLLIDER_H 8 | #define ATTA_COMPONENT_COMPONENTS_CYLINDER_COLLIDER_H 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace atta::component { 15 | 16 | /// %Component to create cylinder collider 17 | /** This collider can be used for 3D physics. 18 | * 19 | * Transform and RigidBody are necessary for the 20 | * entity to be participate in the physics iteration. 21 | */ 22 | struct CylinderCollider final : public Component { 23 | float radius = 0.5f; ///< Radius 24 | float height = 1.0f; ///< Height 25 | vec3 offset = {0.0f, 0.0f, 0.0f}; ///< Offset 26 | }; 27 | ATTA_REGISTER_COMPONENT(CylinderCollider) 28 | template <> 29 | ComponentDescription& TypedComponentRegistry::getDescription(); 30 | 31 | } // namespace atta::component 32 | 33 | #endif // ATTA_COMPONENT_COMPONENTS_CYLINDER_COLLIDER_H 34 | -------------------------------------------------------------------------------- /src/atta/component/components/directionalLight.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // directionalLight.cpp 4 | // Date: 2021-11-23 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Directional Light", 14 | {{AttributeType::VECTOR_FLOAT32, offsetof(DirectionalLight, intensity), "intensity", 0.0f, 10.0f}}}; 15 | return desc; 16 | } 17 | 18 | } // namespace atta::component 19 | -------------------------------------------------------------------------------- /src/atta/component/components/directionalLight.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // directionalLight.h 4 | // Date: 2021-09-18 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_DIRECTIONAL_LIGHT_H 8 | #define ATTA_COMPONENT_COMPONENTS_DIRECTIONAL_LIGHT_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to create directional light 15 | /** The light direction is the entity Z axis, you can change the transform rotation to change the light direction. 16 | * 17 | * A Transform is needed to the light to be rendered. 18 | */ 19 | struct DirectionalLight final : public Component { 20 | vec3f intensity = vec3f(1.0f, 1.0f, 1.0f); 21 | }; 22 | ATTA_REGISTER_COMPONENT(DirectionalLight) 23 | template <> 24 | ComponentDescription& TypedComponentRegistry::getDescription(); 25 | 26 | } // namespace atta::component 27 | 28 | #endif // ATTA_COMPONENT_COMPONENTS_DIRECTIONAL_LIGHT_H 29 | -------------------------------------------------------------------------------- /src/atta/component/components/environmentLight.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // environmentLight.cpp 4 | // Date: 2022-01-03 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Environment Light", 14 | { 15 | {AttributeType::STRINGID, offsetof(EnvironmentLight, sid), "sid", {}, {}, {}, {}}, 16 | }, 17 | 1}; 18 | 19 | return desc; 20 | } 21 | 22 | EnvironmentLight::EnvironmentLight() { 23 | if (TypedComponentRegistry::description->attributeDescriptions[0].options.size()) 24 | sid = StringId(*(TypedComponentRegistry::description->attributeDescriptions[0].options.begin())); 25 | } 26 | 27 | } // namespace atta::component 28 | -------------------------------------------------------------------------------- /src/atta/component/components/environmentLight.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // environmentLight.h 4 | // Date: 2022-01-03 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_ENVIRONMENT_LIGHT_H 8 | #define ATTA_COMPONENT_COMPONENTS_ENVIRONMENT_LIGHT_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | struct EnvironmentLight final : public Component { 15 | EnvironmentLight(); 16 | StringId sid; ///< Environment texture relative path 17 | }; 18 | ATTA_REGISTER_COMPONENT(EnvironmentLight) 19 | template <> 20 | ComponentDescription& TypedComponentRegistry::getDescription(); 21 | 22 | } // namespace atta::component 23 | 24 | #endif // ATTA_COMPONENT_COMPONENTS_ENVIRONMENT_LIGHT_H 25 | -------------------------------------------------------------------------------- /src/atta/component/components/mesh.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // mesh.cpp 4 | // Date: 2021-09-02 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | #include 9 | #include 10 | 11 | namespace atta::component { 12 | 13 | template <> 14 | ComponentDescription& TypedComponentRegistry::getDescription() { 15 | static ComponentDescription desc = { 16 | "Mesh", 17 | { 18 | {AttributeType::STRINGID, offsetof(Mesh, sid), "sid", {}, {}, {}, {}}, 19 | }, 20 | 1024, // Max instances 21 | }; 22 | 23 | return desc; 24 | } 25 | 26 | Mesh::Mesh() { sid = *resource::getResources().begin(); } 27 | 28 | void Mesh::set(std::string mesh) { sid = StringId(mesh); } 29 | 30 | } // namespace atta::component 31 | -------------------------------------------------------------------------------- /src/atta/component/components/mesh.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // mesh.h 4 | // Date: 2021-09-02 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_MESH_H 8 | #define ATTA_COMPONENT_COMPONENTS_MESH_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to define entity mesh 15 | /** The entity must also have a Transform to be rendered. 16 | */ 17 | struct Mesh final : public Component { 18 | Mesh(); 19 | /** The StringId string is the mesh path relative to the resource directory. 20 | * The resource directory can be the project resource directory or the atta 21 | * default resource directory. 22 | * 23 | * For example, if the mesh file is located at "/resources/myMeshes/robot.obj", 24 | * the StringId string should be "myMeshes/robot.obj". 25 | * */ 26 | StringId sid; ///< Mesh relative path 27 | void set(std::string mesh); 28 | }; 29 | ATTA_REGISTER_COMPONENT(Mesh) 30 | template <> 31 | ComponentDescription& TypedComponentRegistry::getDescription(); 32 | 33 | } // namespace atta::component 34 | 35 | #endif // ATTA_COMPONENT_COMPONENTS_MESH_H 36 | -------------------------------------------------------------------------------- /src/atta/component/components/name.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // name.cpp 4 | // Date: 2021-11-23 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Name", {{AttributeType::VECTOR_CHAR, offsetof(Name, name), "name"}}}; 14 | 15 | return desc; 16 | } 17 | 18 | void Name::set(std::string n) { strcpy(name, n.c_str()); } 19 | 20 | } // namespace atta::component 21 | -------------------------------------------------------------------------------- /src/atta/component/components/name.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // name.h 4 | // Date: 2021-09-02 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_NAME_H 8 | #define ATTA_COMPONENT_COMPONENTS_NAME_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to give an entity a name 15 | struct Name final : public Component { 16 | char name[32]; 17 | void set(std::string n); 18 | }; 19 | ATTA_REGISTER_COMPONENT(Name) 20 | template <> 21 | ComponentDescription& TypedComponentRegistry::getDescription(); 22 | 23 | } // namespace atta::component 24 | 25 | #endif // ATTA_COMPONENT_COMPONENTS_NAME_H 26 | -------------------------------------------------------------------------------- /src/atta/component/components/pointLight.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // pointLight.cpp 4 | // Date: 2021-11-23 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Point Light", {{AttributeType::VECTOR_FLOAT32, offsetof(PointLight, intensity), "intensity", 0.0f, 10.0f}}}; 14 | 15 | return desc; 16 | } 17 | 18 | } // namespace atta::component 19 | -------------------------------------------------------------------------------- /src/atta/component/components/pointLight.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // pointLight.h 4 | // Date: 2021-09-18 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_POINT_LIGHT_H 8 | #define ATTA_COMPONENT_COMPONENTS_POINT_LIGHT_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to create point light 15 | /** The light position is the entity position, you can change the 16 | * transform position to change the light position. 17 | * 18 | * A Transform is needed to the light to be rendered. 19 | */ 20 | struct PointLight final : public Component { 21 | vec3f intensity = vec3(1.0f, 1.0f, 1.0f); 22 | }; 23 | ATTA_REGISTER_COMPONENT(PointLight) 24 | template <> 25 | ComponentDescription& TypedComponentRegistry::getDescription(); 26 | 27 | } // namespace atta::component 28 | 29 | #endif // ATTA_COMPONENT_COMPONENTS_POINT_LIGHT_H 30 | -------------------------------------------------------------------------------- /src/atta/component/components/polygonCollider2D.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // polygonCollider2D.cpp 4 | // Date: 2022-10-16 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | #include 9 | #include 10 | 11 | namespace atta::component { 12 | 13 | template <> 14 | ComponentDescription& TypedComponentRegistry::getDescription() { 15 | static ComponentDescription desc = { 16 | "Polygon Collider 2D", 17 | { 18 | {AttributeType::VECTOR_FLOAT32, offsetof(PolygonCollider2D, offset), "offset", -2000.0f, 2000.0f, 0.01f}, 19 | {AttributeType::CUSTOM, offsetof(PolygonCollider2D, points), "points"}, 20 | }, 21 | // Max instances 22 | 1024, 23 | }; 24 | 25 | return desc; 26 | } 27 | 28 | } // namespace atta::component 29 | -------------------------------------------------------------------------------- /src/atta/component/components/polygonCollider2D.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // polygonCollider2D.h 4 | // Date: 2022-10-16 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_POLYGON_COLLIDER_2D_H 8 | #define ATTA_COMPONENT_COMPONENTS_POLYGON_COLLIDER_2D_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to create a polygon collider 15 | /** This collider can be used only for 2D physics. 16 | * 17 | * Transform and RigidBody2D components are necessary 18 | * for the entity to participate in the physics iteration. 19 | * 20 | * This collider allows to define the collision shape from a number of points 21 | * 22 | * The polygon will also be scaled by the Transform. 23 | */ 24 | struct PolygonCollider2D final : public Component { 25 | vec2 offset = {0.0f, 0.0f}; ///< Offset 26 | std::vector points; ///< Polygon points 27 | }; 28 | ATTA_REGISTER_COMPONENT(PolygonCollider2D) 29 | template <> 30 | ComponentDescription& TypedComponentRegistry::getDescription(); 31 | 32 | } // namespace atta::component 33 | 34 | #endif // ATTA_COMPONENT_COMPONENTS_POLYGON_COLLIDER_2D_H 35 | -------------------------------------------------------------------------------- /src/atta/component/components/prototype.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // prototype.cpp 4 | // Date: 2021-11-23 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Prototype", 14 | {{AttributeType::UINT64, offsetof(Prototype, maxClones), "maxClones", uint64_t(0), uint64_t(1000), 1}}}; 15 | 16 | return desc; 17 | } 18 | 19 | } // namespace atta::component 20 | -------------------------------------------------------------------------------- /src/atta/component/components/prototype.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // prototype.h 4 | // Date: 2021-09-17 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_PROTOTYPE_H 8 | #define ATTA_COMPONENT_COMPONENTS_PROTOTYPE_H 9 | 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// %Component to create entity clones 15 | /** Every entity with this component is a protype. Prototypes are not simulated, 16 | * they are only used as template to create clone entities. 17 | * 18 | * All components from the prototype entity are copied to the clones. 19 | * Clone data are allocated so they are continuous in memory, this makes simulating 20 | * clones faster than simulating entities scattered throughout the memory. 21 | */ 22 | struct Prototype final : public Component { 23 | uint64_t maxClones; ///< Number of clones to be created 24 | }; 25 | ATTA_REGISTER_COMPONENT(Prototype) 26 | template <> 27 | ComponentDescription& TypedComponentRegistry::getDescription(); 28 | 29 | } // namespace atta::component 30 | 31 | #endif // ATTA_COMPONENT_COMPONENTS_PROTOTYPE_H 32 | -------------------------------------------------------------------------------- /src/atta/component/components/rigidJoint.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // rigidJoint.cpp 4 | // Date: 2021-12-03 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | 9 | namespace atta::component { 10 | 11 | template <> 12 | ComponentDescription& TypedComponentRegistry::getDescription() { 13 | static ComponentDescription desc = {"Rigid Joint", 14 | { 15 | {AttributeType::INT32, offsetof(RigidJoint, bodyA), "bodyA"}, 16 | {AttributeType::INT32, offsetof(RigidJoint, bodyB), "bodyB"}, 17 | }}; 18 | 19 | return desc; 20 | } 21 | 22 | } // namespace atta::component 23 | -------------------------------------------------------------------------------- /src/atta/component/components/rigidJoint.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // rigidJoint.h 4 | // Date: 2021-12-03 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #ifndef ATTA_COMPONENT_COMPONENTS_RIGID_JOINT_H 8 | #define ATTA_COMPONENT_COMPONENTS_RIGID_JOINT_H 9 | #include 10 | #include 11 | 12 | namespace atta::component { 13 | 14 | /// Joint to keep entities fixed to each other 15 | /** The relative position and orientation between the entities will not change */ 16 | struct RigidJoint : public Component { 17 | EntityId bodyA; ///< First attached body 18 | EntityId bodyB; ///< Second attached body 19 | }; 20 | ATTA_REGISTER_COMPONENT(RigidJoint) 21 | template <> 22 | ComponentDescription& TypedComponentRegistry::getDescription(); 23 | 24 | } // namespace atta::component 25 | 26 | #endif // ATTA_COMPONENT_COMPONENTS_RIGID_JOINT_COMPONENT_BASE_H 27 | -------------------------------------------------------------------------------- /src/atta/component/components/script.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------- 2 | // Atta Component Module 3 | // script.cpp 4 | // Date: 2021-11-23 5 | // By Breno Cunha Queiroz 6 | //-------------------------------------------------- 7 | #include 8 | #include 9 | 10 | namespace atta::component { 11 | 12 | template <> 13 | ComponentDescription& TypedComponentRegistry