-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShape.h
More file actions
62 lines (54 loc) · 1.74 KB
/
Shape.h
File metadata and controls
62 lines (54 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef SHAPE_H
#define SHAPE_H
#include <SFML/Graphics.hpp>
#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/System.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/Window.hpp>
#include <cmath>
class Shape : public sf::Drawable
{
public:
Shape( int MAX_POINTS = 0,
sf::Vector2f position = sf::Vector2f(0.f, 0.f),
sf::Vector2f acceleration = sf::Vector2f(0.f, 0.f),
sf::Vector2f velocity = sf::Vector2f(0.f, 0.f),
sf::Color color = sf::Color::Yellow,
float angle = 0.f,
float mass = 0.f
);
virtual ~Shape();
virtual void setPosition (sf::Vector2f) = 0;
virtual void setAcceleration (sf::Vector2f) = 0;
virtual void setVelocity (sf::Vector2f) = 0;
virtual void setAngle (float) = 0;
const virtual sf::Vector2f getPosition () const = 0;
//const virtual sf::Vector2f getAcceleration () const = 0;
const virtual sf::Vector2f getVelocity () const = 0;
const virtual float getMass () const = 0;
const virtual sf::FloatRect getBounds () const = 0;
/*
const virtual float getSize () const = 0;
const virtual float getAngle () const = 0;
virtual void updateVelocity (float) = 0;
virtual void update() = 0;
virtual void render() = 0;
virtual void initVariables() = 0;
*/
virtual void initShape() = 0;
int MAX_POINTS;
sf::VertexArray m_vertices;
sf::Vector2f m_position;
sf::Vector2f m_acceleration;
sf::Vector2f m_velocity;
sf::Color m_colorShape;
sf::Color COLOR;
sf::FloatRect m_bounds;
float m_mass;
float m_angle;
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
};
#endif