aboutsummaryrefslogtreecommitdiffstats
path: root/dev/a2-carsoccer/ball.h
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2021-09-24 10:05:55 -0500
committerMatt Strapp <matt@mattstrapp.net>2021-09-24 10:05:55 -0500
commit458496b2db6d67736fd1ffc18c6e51a7a4e1180c (patch)
tree3d6ee4e37a48d71a6ac781cbd93a6d6dcb234f98 /dev/a2-carsoccer/ball.h
parentPushed feedback file submission-w1.1 (diff)
parentpublish a2 (diff)
downloadcsci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.tar
csci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.tar.gz
csci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.tar.bz2
csci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.tar.lz
csci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.tar.xz
csci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.tar.zst
csci4611-458496b2db6d67736fd1ffc18c6e51a7a4e1180c.zip
Merge branch 'support-code' of github.umn.edu:umn-csci-4611-f21/shared-upstream
Diffstat (limited to '')
-rw-r--r--dev/a2-carsoccer/ball.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/dev/a2-carsoccer/ball.h b/dev/a2-carsoccer/ball.h
new file mode 100644
index 0000000..0fa107e
--- /dev/null
+++ b/dev/a2-carsoccer/ball.h
@@ -0,0 +1,39 @@
+/** CSci-4611 Assignment 2: Car Soccer
+ */
+
+#ifndef BALL_H_
+#define BALL_H_
+
+#include <mingfx.h>
+using namespace mingfx;
+
+/// Small class representing the ball. Feel free to add additional member variables and functions if you wish.
+class Ball {
+public:
+
+ Ball();
+ virtual ~Ball();
+
+ // The same radius is used to draw the ball and to calculate physics for the ball
+ float radius();
+
+ // Current 3D position
+ Point3 position();
+ void set_position(const Point3 &p);
+
+ // Current 3D velocity
+ Vector3 velocity();
+ void set_velocity(const Vector3 &v);
+
+ // Resets the ball's position and velocity to initial values.
+ void Reset();
+
+ void Draw(QuickShapes quickShapes, Matrix4 modelMatrix, Matrix4 viewMatrix, Matrix4 projMatrix);
+
+private:
+ Point3 position_;
+ Vector3 velocity_;
+ float radius_;
+};
+
+#endif