From a75b08b76f91451bb586b154fdca872955d8a57a Mon Sep 17 00:00:00 2001 From: KT Date: Tue, 21 Sep 2021 10:05:57 -0500 Subject: publish a2 --- dev/a2-carsoccer/ball.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 dev/a2-carsoccer/ball.h (limited to 'dev/a2-carsoccer/ball.h') 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 +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 -- cgit v1.2.3