diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..9ae4a1c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +## Description + +Briefly describe what this PR implements. + +## Changes Made + +- +- +- + +## Implementation Details + +Mention key design decisions if any. + + +## Checklist +**Type:** +- [ ] Bug Fix +- [ ] Feature +- [ ] Chore diff --git a/CMakeLists.txt b/CMakeLists.txt index fca2e14..364982b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,12 @@ cmake_minimum_required(VERSION 3.20) -project(AetherPhysics) +project(Aether_Test) set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) -# Collect source files -file(GLOB_RECURSE ENGINE_SOURCES engine/*.cpp) -file(GLOB_RECURSE APP_SOURCES app/*.cpp) - -# Create executable -add_executable(AetherPhysics - ${ENGINE_SOURCES} - ${APP_SOURCES} +add_executable(Aether_Test + app/main.cpp + engine/vec3.cpp ) -# Include directories -target_include_directories(AetherPhysics - PRIVATE - engine -) \ No newline at end of file +target_include_directories(Aether_Test PRIVATE engine) \ No newline at end of file diff --git a/app/main.cpp b/app/main.cpp index a71bc9f..8e48acb 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,6 +1,39 @@ #include +#include +#include +#include "vec3.hpp" + using namespace std; int main(){ cout << "Hello Worlds\n"; + + const float dt=1.0f/60.0f; + const Vec3 gravity(0.0f,-9.8f,0.0f); + + Vec3 position(0.0f,10.0f,0.0f); + Vec3 velocity; + + float simulation_time=0.0f; + float total_runtime=3.0f; // we will run the simulation for 3 seconds in the startung testing phase + + auto last_time=std::chrono::high_resolution_clock::now(); + float accumulator=0.0f; + + while(simulation_time(current_time-last_time).count(); + last_time=current_time; + + accumulator+=frametime; + while(accumulator>=dt){ + velocity=velocity+(gravity*dt); + position=position+(velocity*dt); + + simulation_time+=dt; + accumulator-=dt; + } + std::cout<<"Time: "< + +class Vec3 { +public: + float x, y, z; + + Vec3(); + Vec3(float x, float y, float z); + + Vec3 operator+(const Vec3& other) const; + Vec3 operator-(const Vec3& other) const; + Vec3 operator*(float scalar) const; + + float dot(const Vec3& other) const; + float length() const; + Vec3 normalized() const; +}; \ No newline at end of file