-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBody.java
More file actions
56 lines (45 loc) · 1.43 KB
/
Body.java
File metadata and controls
56 lines (45 loc) · 1.43 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
/**
* Created by niklas on 23.12.16.
*/
public class Body {
private String id;
private double mass;
//TODO make somehow private
public MathVector position;
public MathVector velocity;
public MathVector acceleration; //TODO remove
private double radius;
public Body(String id, double mass, MathVector position, MathVector velocity, MathVector acceleration, double radius) {
this.id = id;
this.mass = mass;
this.position = position;
this.velocity = velocity;
this.acceleration = acceleration;
this.radius = radius;
}
public Body(String id, double mass, MathVector position, MathVector velocity, MathVector acceleration) {
this(id, mass, position, velocity, acceleration, 0);
}
public Body(String id, double mass, MathVector position, MathVector velocity, double radius) {
this(id, mass, position,velocity,null, radius);
}
public Body(String id, double mass, MathVector position, MathVector velocity) {
this(id, mass, position,velocity,null, 0);
}
public double getMass() {
return mass;
}
public MathVector getPosition() {
return position;
}
public MathVector getVelocity() {
return velocity;
}
public MathVector getAcceleration() {
return acceleration;
}
public double getRadius() {
return radius;
}
public String getId(){return id;}
}