diff options
author | Sebastian Park <SebPark03@gmail.com> | 2024-04-10 02:45:04 -0400 |
---|---|---|
committer | Sebastian Park <SebPark03@gmail.com> | 2024-04-10 02:45:04 -0400 |
commit | 47cd8a592ecad52c1b01f27d23476c0a5afeb7f1 (patch) | |
tree | 36b9abaff4e92a4a6df0d5ecb0e43e05c3aefd48 /wave-sim/src/simulation.h | |
parent | fd19124693bb32835ad97802ba1950cd5202dbd2 (diff) |
initial
Diffstat (limited to 'wave-sim/src/simulation.h')
-rw-r--r-- | wave-sim/src/simulation.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/wave-sim/src/simulation.h b/wave-sim/src/simulation.h new file mode 100644 index 0000000..68f2178 --- /dev/null +++ b/wave-sim/src/simulation.h @@ -0,0 +1,42 @@ +#pragma once + +#include "graphics/shape.h" +#include "system.h" + +class Shader; + +class Simulation +{ +public: + Simulation(); + + void init(); + + void update(double seconds); + + void draw(Shader *shader); + + void toggleWire(); + + void toggleForceRender(); + + Eigen::Vector3d calculateFaceNormal(Eigen::Vector3d a, Eigen::Vector3d b, Eigen::Vector3d c); + + bool calculatePointBehindNormal(Eigen::Vector3d a, Eigen::Vector3d b, Eigen::Vector3d c, Eigen::Vector3d p); + + System mainSystem; + + enum EstimationMode { EULER, MIDPOINT, ADAPTIVE }; + +private: + Shape m_shape; + + Shape m_ground; + + Shape m_extra; + + EstimationMode estimationMode = MIDPOINT; + + void initGround(); + void initExtra(); +}; |