Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2a82855
Add grass texture
Pulsarnixx Oct 25, 2024
1edea46
Add OpenGL Math (glm) module
Pulsarnixx Oct 25, 2024
8683dfd
Merge pull request #14 from Pulsarnixx/feature/small-changes
Pulsarnixx Oct 25, 2024
f56e92b
Merge pull request #15 from Pulsarnixx/feature/glm-module
Pulsarnixx Oct 25, 2024
0acdfa9
Add mvp matrix, Add GLFW callbacks, changes texture
Pulsarnixx Oct 27, 2024
36679cd
Add mesh class, modified renderer
Pulsarnixx Oct 27, 2024
acbde27
Merge pull request #16 from Pulsarnixx/feature/mvp-calculation
Pulsarnixx Oct 27, 2024
a14d6cc
Add generitic sphere, adjust Mesh and create new shader
Pulsarnixx Oct 28, 2024
adff4ed
Comment cube creation
Pulsarnixx Oct 28, 2024
eae3348
Merge pull request #17 from Pulsarnixx/feature/sphere
Pulsarnixx Oct 28, 2024
11b0609
Small chagnes
Pulsarnixx Oct 28, 2024
7da4cb7
Merge pull request #18 from Pulsarnixx/feature/refactor
Pulsarnixx Oct 29, 2024
182a980
Add central point to the sphere class
Pulsarnixx Oct 30, 2024
41abc9b
Add big grid, line
Pulsarnixx Nov 4, 2024
5b2e0b8
Modify grid, adjust code to get GLFW call backs
Pulsarnixx Nov 4, 2024
9fcfa73
Adjust grid shader, add camera to main loop
Pulsarnixx Nov 4, 2024
eec2ff1
Add ball texture and adjust main code
Pulsarnixx Nov 4, 2024
9f231d6
Code adjustment, add second sphere, add platform
Pulsarnixx Nov 10, 2024
97a9387
Add 2D double pendulum
Pulsarnixx Nov 11, 2024
9d9ff57
Adjust example app to present two simulation - 2D and 3D
Pulsarnixx Nov 11, 2024
c2a86d4
Merge pull request #19 from Pulsarnixx/feature/graphics
Pulsarnixx Nov 11, 2024
dca26ea
Huge changes.
Pulsarnixx Nov 16, 2024
55d4c68
Add tests
Pulsarnixx Nov 17, 2024
116a538
Add double pendulum physics
Pulsarnixx Nov 18, 2024
73d38b1
Add numerical tests for double pendulum, delete txt tests files, upda…
Pulsarnixx Nov 20, 2024
ab103ae
Merge pull request #20 from Pulsarnixx/feature/pendulum-physics
Pulsarnixx Nov 20, 2024
e948721
Add RK2 and RK4 method for single pendulum, License update
Pulsarnixx Nov 20, 2024
8e1a69f
Add implot, change cmake files
Pulsarnixx Nov 20, 2024
655b762
Delete 3D simulation option in main
Pulsarnixx Nov 20, 2024
d1b5ed4
Add RK2 and RK4 method for double pendulum visualization
Pulsarnixx Nov 21, 2024
adadf4f
Add basic plots for both pendulums
Pulsarnixx Nov 21, 2024
acb7c75
Add energy plot for double pendulum
Pulsarnixx Nov 21, 2024
f1eed32
Change configuration settings
Pulsarnixx Nov 25, 2024
d23ca7d
Change gitignore, add config script
Pulsarnixx Nov 25, 2024
0fc6873
Merge pull request #21 from Pulsarnixx/feature/pendulum-physics
Pulsarnixx Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
/bin/
/data/
/scripts/
/Articles/
/tests_results/
#Files
*.o
*.obj
*.out
*.exe
*.sh
*.ini
17 changes: 15 additions & 2 deletions App/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
set(APP_NAME PrototypeApp)
set(APP_NAME Simulation)

add_executable( ${APP_NAME} app.cpp )
#Shaders and test folder path
set(CIRCLE_SHADER "${CMAKE_SOURCE_DIR}/res/shaders/circle.shader")
add_compile_definitions(CIRCLE_SHADER="${CIRCLE_SHADER}")

set(LINE_SHADER "${CMAKE_SOURCE_DIR}/res/shaders/line.shader")
add_compile_definitions(LINE_SHADER="${LINE_SHADER}")

set(TRAIL_SHADER "${CMAKE_SOURCE_DIR}/res/shaders/trail.shader")
add_compile_definitions(TRAIL_SHADER="${TRAIL_SHADER}")

set(TEST_FOLDER_PATH "${CMAKE_SOURCE_DIR}/tests_results/")
add_compile_definitions(TEST_FOLDER_PATH="${TEST_FOLDER_PATH}")

add_executable( ${APP_NAME} app.cpp simulation2D.cpp pendulum.cpp numerical_eq.cpp)

target_include_directories( ${APP_NAME} PUBLIC
${PULSAR_INCLUDE_PATH}
Expand Down
106 changes: 11 additions & 95 deletions App/app.cpp
Original file line number Diff line number Diff line change
@@ -1,113 +1,29 @@
#include "Pulsar.hpp"
#include "simulation2D.hpp"
#include "numerical_eq.hpp"
// #include "simulation3D.hpp"

#define EXAMPLE_SHADER "/home/marek/Dev/Projects/pulsarEngine/res/shaders/shader_prog.txt"
#define EXAMPLE_TEXTURE "/home/marek/Dev/Projects/pulsarEngine/res/images/hagrid.jpg"
#include <memory>

int main(){

//Pulsar core
PX_LOG::Init();
GlobalTimer::Init();
FPSTimer::Init();
ScopedTimer::Init();

//Pulsar graphics
PX::Init();

const Window* window = PX::GetWindow();
const Renderer* renderer = PX::GetRenderer();
const Gui* gui = PX::GetGui();

//Window option
window->SetVsync(false);

class Cube cube1;

//Buffers / containers
VertexArray vao;
VertexBuffer vbo(cube1.GetVerticesArrayData(), cube1.GetVerticesArraySize() );
IndexBuffer ebo(cube1.GetIndicatesArrayData(), cube1.GetIndicatesArraySize());

//Vertex attributes
VertexBufferLayout layout;
layout.Push<float>(3);
layout.Push<float>(2);

//Add everything to one container - vao
vao.AddBuffer(vbo, layout);

//Unbind everything (buffers are not needed, vao will be changed in loop)
vao.UnBind();
vbo.UnBind();
//Unbind index buffer only when vao is unbind.
ebo.UnBind();

/*
SHADERS
NUMERICAL TESTS FIRST
*/
std::string file_path = EXAMPLE_SHADER;
Shader shaderProgram(file_path);
shaderProgram.Bind();

//Bind shaderProgram first
shaderProgram.SetUniform4f("u_color", 1.0f, 0.984f, 0.0f, 1.0f );
RunTests();

/*
TEXTURES
SIMULATION APP
*/
file_path = EXAMPLE_TEXTURE;
Texture2D texture1(file_path);
texture1.Bind(); //choose slot

while (!window->ShouldWindowClose())
{

/*
START MEASURING APP FRAMERATE
*/
FPSTimer::GetTimer()->StartFrame();


//Event handler - in the future
window->onEvents();

renderer->BeginRender();


//Calculation...

//Rendering staff...
vao.Bind();
ebo.Bind();


std::unique_ptr<Simulation> sim = std::make_unique<Simulation2D>();

/*
START MEASURING RENDER FRAME TIME
*/
sim->initialize();

renderer->Render();
/*
STOP MEASURING RENDER FRAME TIME
*/


gui->OnBegin();
/*
Customizing gui...
*/
gui->OnEnd();

window->onUpdate();
sim->run();

/*
STOP MEASURING APP FRAMERATE
*/
sim->shutdown();

FPSTimer::GetTimer()->UpdateFPS();

}

PX::ShutDown();
return 0;
}
Loading