diff options
author | unknown <paulx161@umn.edu> | 2021-02-04 18:37:17 -0600 |
---|---|---|
committer | unknown <paulx161@umn.edu> | 2021-02-04 18:37:17 -0600 |
commit | fee4cbf40b07e17eca676b4687c51313f7cfdd2e (patch) | |
tree | c3e668b7e76a7f293806f897ae88b4a2dcb254b8 /dev/angry-vectors/angry_vectors.h | |
parent | added dev/MinGfx/ (diff) | |
download | csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.gz csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.bz2 csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.lz csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.xz csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.tar.zst csci4611-fee4cbf40b07e17eca676b4687c51313f7cfdd2e.zip |
Added example projects from lecture
Diffstat (limited to 'dev/angry-vectors/angry_vectors.h')
-rw-r--r-- | dev/angry-vectors/angry_vectors.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/dev/angry-vectors/angry_vectors.h b/dev/angry-vectors/angry_vectors.h new file mode 100644 index 0000000..37ad578 --- /dev/null +++ b/dev/angry-vectors/angry_vectors.h @@ -0,0 +1,71 @@ +/** CSci-4611 In-Class Example */ + +#ifndef ANGRY_VECTORS_H_ +#define ANGRY_VECTORS_H_ + +#include <mingfx.h> +using namespace mingfx; + +#include <string> +#include <vector> + +class AngryVectors : public GraphicsApp { +public: + + // Creates the App + AngryVectors(); + + // Cleans up when the App shuts down + virtual ~AngryVectors(); + + // Note a Run() function is inherited from GraphicsApp, that's what + // actually starts up the App. + + // This is a callback, a function that gets called when the user presses + // the Pause button in the GUI. + void OnPauseBtnPressed(); + + // This calculates the bird position given a time value. + Point3 CalcBirdPos(double time); + + // This calculates the bird velocity given a time value, this is the routine + // we want to check to make sure it is working properly + Vector3 CalcBirdVel(double time); + + // This gets called once each frame. Note that dt (a.k.a., "delta time") is + // the amount of time (in seconds) that has passed since the last frame. + void UpdateSimulation(double dt); + + // This is where we initialize the on-screen GUI, which is implemented using + // an open source library called NanoGUI. It gets called once + // when the program starts up. + void InitNanoGUI(); + + // This is where we initialize any OpenGL data, like textures or meshes that + // need to be loaded from files and setup in OpenGL. It gets called once + // when the program starts up. + void InitOpenGL(); + + // This gets called once each frame, and this is where you draw the latest + // version of your 3D graphics scene. + void DrawUsingOpenGL(); + + +private: + + // Time of flight for our "bird" + float time_; + + // Sets up the computer graphics camera + Matrix4 view_matrix_; + Matrix4 proj_matrix_; + + // A helper class for drawing some simple shapes (cubes, spheres, 3D arrows) + QuickShapes quick_shapes_; + + // Gui elements + nanogui::Button *pauseBtn_; + bool playing_; +}; + +#endif
\ No newline at end of file |