@Test public void limit_acceleration() throws Exception { Assert.assertEquals(new D3Vector(0, 0, 0), Engine.limit_acceleration(new D3Vector(0, 0, 0))); Assert.assertEquals(new D3Vector(5, 5, 5), Engine.limit_acceleration(new D3Vector(5, 5, 5))); Assert.assertEquals(new D3Vector(-5, -5, -5), Engine.limit_acceleration(new D3Vector(-5, -5, -5))); Assert.assertEquals(new D3Vector(-5, 5, -5), Engine.limit_acceleration(new D3Vector(-5, 5, -5))); Assert.assertEquals(new D3Vector(-5, 5, 5), Engine.limit_acceleration(new D3Vector(-5, 5, 5))); Assert.assertEquals(new D3Vector(10, 0, 0), Engine.limit_acceleration(new D3Vector(1000, 0, 0))); Assert.assertEquals(new D3Vector(-10, 0, 0), Engine.limit_acceleration(new D3Vector(-1000, 0, 0))); }
public static D3Vector limit_acceleration(D3Vector input) { D3Vector output = input; if (input.length() > Settings.MAX_DRONE_ACCELERATION) { double correctionFactor = Settings.MAX_DRONE_ACCELERATION / input.length(); output = input.scale(correctionFactor); } return output; }
Engine { public static D3Vector limit_acceleration(D3Vector input) { D3Vector output = input; if (input.length() > Settings.MAX_DRONE_ACCELERATION) { double correctionFactor = Settings.MAX_DRONE_ACCELERATION / input.length(); output = input.scale(correctionFactor); } return output; } }
Engine { public static D3Vector limit_acceleration(D3Vector input) { D3Vector output = input; if (input.length() > Settings.MAX_DRONE_ACCELERATION) { double correctionFactor = Settings.MAX_DRONE_ACCELERATION / input.length(); output = input.scale(correctionFactor); } return output; } Engine();  Engine(Publisher m_publisher, GPS m_gps, DroneInit m_drone, D3Vector lastAcceleration); }
Engine { public static D3Vector limit_acceleration(D3Vector input) { D3Vector output = input; if (input.length() > Settings.MAX_DRONE_ACCELERATION) { double correctionFactor = Settings.MAX_DRONE_ACCELERATION / input.length(); output = input.scale(correctionFactor); } return output; } Engine();  Engine(Publisher m_publisher, GPS m_gps, DroneInit m_drone, D3Vector lastAcceleration); D3Vector getLastAcceleration(); static D3Vector limit_acceleration(D3Vector input); static D3Vector maximize_acceleration(D3Vector input); D3Vector stagnate_acceleration(D3Vector input); void changeAcceleration(D3Vector input_acceleration); D3Vector changeVelocity(D3Vector input); final void registerCallback(EngineCallback callback); }
Engine { public static D3Vector limit_acceleration(D3Vector input) { D3Vector output = input; if (input.length() > Settings.MAX_DRONE_ACCELERATION) { double correctionFactor = Settings.MAX_DRONE_ACCELERATION / input.length(); output = input.scale(correctionFactor); } return output; } Engine();  Engine(Publisher m_publisher, GPS m_gps, DroneInit m_drone, D3Vector lastAcceleration); D3Vector getLastAcceleration(); static D3Vector limit_acceleration(D3Vector input); static D3Vector maximize_acceleration(D3Vector input); D3Vector stagnate_acceleration(D3Vector input); void changeAcceleration(D3Vector input_acceleration); D3Vector changeVelocity(D3Vector input); final void registerCallback(EngineCallback callback);  }