summaryrefslogtreecommitdiffstats
path: root/dev/a2-carsoccer/car_soccer.h
diff options
context:
space:
mode:
authorunknown <paulx161@umn.edu>2021-02-02 18:35:09 -0600
committerunknown <paulx161@umn.edu>2021-02-02 18:35:09 -0600
commit7ea1b2c0320d74152d33e74718a39319a7a0e507 (patch)
tree7c2995f547889f00e381449b5c91dbb0abd1a0c3 /dev/a2-carsoccer/car_soccer.h
parentAdded /dev/gfxtest/* (diff)
downloadcsci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.tar
csci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.tar.gz
csci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.tar.bz2
csci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.tar.lz
csci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.tar.xz
csci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.tar.zst
csci4611-7ea1b2c0320d74152d33e74718a39319a7a0e507.zip
Added worksheet and support code for assignment 2
Diffstat (limited to '')
-rw-r--r--dev/a2-carsoccer/car_soccer.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/dev/a2-carsoccer/car_soccer.h b/dev/a2-carsoccer/car_soccer.h
new file mode 100644
index 0000000..8cd144f
--- /dev/null
+++ b/dev/a2-carsoccer/car_soccer.h
@@ -0,0 +1,76 @@
+/** CSci-4611 Assignment 2: Car Soccer
+ */
+
+#ifndef CAR_SOCCER_H_
+#define CAR_SOCCER_H_
+
+#include <mingfx.h>
+using namespace mingfx;
+
+#include "ball.h"
+#include "car.h"
+
+
+// The main class for the Car Soccer application
+class CarSoccer : public GraphicsApp {
+public:
+ CarSoccer();
+ virtual ~CarSoccer();
+
+ /// This is called when special keys like SPACEBAR are pressed
+ void OnSpecialKeyDown(int key, int scancode, int modifiers);
+
+ /// This is called once each frame. dt is "delta time", the time elapsed
+ /// since the last call.
+ void UpdateSimulation(double dt);
+
+ /// This is called when it is time to initialize graphics objects, like
+ /// texture files.
+ void InitOpenGL();
+
+ /// This is called once each frame, and you should draw the scene inside
+ /// this function.
+ void DrawUsingOpenGL();
+
+ /// This is a little utility function that is helpful. It treats the
+ /// arrow keys like a joystick and returns the direction you are pressing
+ /// as a 2D vector, taking into account the fact that you might be holding
+ /// down more than one key at a time.
+ Vector2 joystick_direction();
+
+ // Feel free to add more functions here as needed.
+
+
+
+private:
+
+ // Simulation objects/parameters:
+
+ // We suggest you start with the Car and Ball objects provided, adding new
+ // member variables to those classes if you need to. You'll probably want
+ // to store some other data for the simulation here too, like some value
+ // for gravity.
+ Car car_;
+ Ball ball_;
+
+
+
+
+ // Support for drawing some simple shapes:
+ QuickShapes quickShapes_;
+
+ // Images to use as textures:
+ Texture2D fieldTex_;
+ Texture2D crowdTex_;
+
+ // Control the computer graphics camera (we'll learn about this in a few weeks):
+ Matrix4 modelMatrix_;
+ Matrix4 viewMatrix_;
+ Matrix4 projMatrix_;
+
+ // A list of paths to search for data files (images):
+ std::vector<std::string> searchPath_;
+};
+
+
+#endif \ No newline at end of file