Commit 640cf23c authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

remove quick fix and add move call to ODEModel

parent 98db5d98
......@@ -295,7 +295,6 @@ public class Simulation {
for (Model m : models) {
topographyController.update(simTimeInSec); //rebuild CellGrid
if (topographyController.getTopography().hasTeleporter()) {
......@@ -179,7 +179,10 @@ public abstract class ODEModel<T extends DynamicElement, TAttributes extends Att
equations.getVelocity(counter, y, newVelocity);
// set data to ped
VPoint oldPosition = element.getPosition();
setPosition(element, newPos);
topography.moveElement(element, oldPosition);
setVelocity(element, new Vector2D(newVelocity[0], newVelocity[1]));
package org.vadere.state.scenario;
import org.vadere.util.geometry.shapes.VPoint;
public interface DynamicElementMover {
* @param element the DynamicElement which was moved to a new position
* @param oldPosition the old potion the DynamicElement was prior to this call. (The new position is contained in the element)
<T extends DynamicElement> void moveElement(T element, final VPoint oldPosition);
<T extends DynamicElement> void addElement(T element);
<T extends DynamicElement> void removeElement(T element);
......@@ -30,7 +30,7 @@ import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VShape;
@JsonIgnoreProperties(value = {"allOtherAttributes", "obstacleDistanceFunction"})
public class Topography {
public class Topography implements DynamicElementMover{
/** Transient to prevent JSON serialization. */
private static Logger logger = Logger.getLogger(Topography.class);
......@@ -216,14 +216,17 @@ public class Topography {
return getContainer(elementType).getElement(id);
public <T extends DynamicElement> void addElement(T element) {
((DynamicElementContainer<T>) getContainer(element.getClass())).addElement(element);
public <T extends DynamicElement> void removeElement(T element) {
((DynamicElementContainer<T>) getContainer(element.getClass())).removeElement(element);
public <T extends DynamicElement> void moveElement(T element, final VPoint oldPosition) {
((DynamicElementContainer<T>) getContainer(element.getClass())).moveElement(element, oldPosition);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment