-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbody.hpp
57 lines (38 loc) · 1018 Bytes
/
body.hpp
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
#ifndef PS3A_BODY_HPP_
#define PS3A_BODY_HPP_
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;
class body : public sf::Drawable, sf::Transformable{
public:
body();
body(sf::Vector2f, sf::Vector2f, float, string);
body(float, float, float, float, float, string);
sf::Vector2f getPosition();
void setPosition(sf::Vector2f);
void setPosition(float, float);
sf::Vector2f getVelocity();
void setVelocity(int t);
float getMass();
void setMass(float);
string getImage();
void setImage(string);
friend istream &operator>>(istream&, body&);
void virtual draw(sf::RenderTarget&, sf::RenderStates) const;
private:
sf::Vector2f _p, _v;// _f, _a;
float _mass;
string _image;
sf::Sprite _sprite;
sf::Texture _texture;
void scale(body&);
sf::Vector2f scale(sf::Vector2f p);
sf::Vector2f getForce();
sf::Vector2f getAcceleration();
float scaleMass(float);
};
#endif /* PS3A_BODY_HPP_ */