public void drag(Vector3f location) { float changeX = location.x - dragPoint.x; float changeY = location.z - dragPoint.y; if (moveSmooth) { for (int i = 0; i < getSelectionCircles().size(); i++) { Doodad d = getSelectionCircles().get(i).getDoodad(); Vector2f v2f = new Vector2f(); v2f.x = d.getLocation().x + changeX; v2f.y = d.getLocation().z + changeY; d.setLocation(v2f, editorApp.getTerrainManager()); d.updateLocation(); getSelectionCircles().get(i).update(); } } else { for (int i = 0; i < getSelectionCircles().size(); i++) { Doodad d = getSelectionCircles().get(i).getDoodad(); Vector2f v2fold = new Vector2f(d.getLocation().getX(), d.getLocation().getZ()); Vector2f v2f = dragPositions.get(i); v2f.x += changeX; v2f.y += changeY; d.removeSpace(editorApp.getPathingManager().getPathingMap(), PathingMap.LayerUnit); d.setLocation(v2f, editorApp.getTerrainManager()); if (d.hasSpace(editorApp.getPathingManager().getPathingMap()) == false) { d.setLocation(v2fold, editorApp.getTerrainManager()); } d.setSpace(editorApp.getPathingManager().getPathingMap(), PathingMap.LayerUnit); d.updateLocation(); getSelectionCircles().get(i).update(); } } dragPoint.setX(location.x); dragPoint.setY(location.z); }