forked from RLBot/RLBotJavaExample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCarData.java
More file actions
28 lines (23 loc) · 922 Bytes
/
Copy pathCarData.java
File metadata and controls
28 lines (23 loc) · 922 Bytes
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
package rlbot.input;
import rlbot.api.GameData;
import rlbot.vector.Vector3;
public class CarData {
public final Vector3 position;
public final Vector3 velocity;
public final CarOrientation orientation;
public final double boost;
public final boolean isMidair;
public final boolean isSupersonic;
public final int team;
public final float elapsedSeconds;
public CarData(GameData.PlayerInfo playerInfo, float elapsedSeconds) {
this.position = Vector3.fromProto(playerInfo.getLocation());
this.velocity = Vector3.fromProto(playerInfo.getVelocity());
this.orientation = CarOrientation.fromPlayerInfo(playerInfo);
this.boost = playerInfo.getBoost();
this.isSupersonic = playerInfo.getIsSupersonic();
this.team = playerInfo.getTeam();
this.isMidair = playerInfo.getIsMidair();
this.elapsedSeconds = elapsedSeconds;
}
}