Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Timer;
- import java.util.TimerTask;
- /**
- *
- * @author Marcel
- */
- public class PhysicsSimulator {
- private World world;
- private ARDroneActor drone;
- private Timer timer = new Timer();
- double[] position = drone.getPosition();
- public PhysicsSimulator() {
- TimerTask task;
- world.getActors();
- task = new TimerTask() {
- @Override
- public void run() {
- if (position[2] > 0) {
- position[2] -= 0.1;
- drone.setPosition(position);
- }
- }
- };
- timer.scheduleAtFixedRate(task, 0, 100);
- }
- public void setWorld(World world) {
- this.world = world;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement