Move car by waypoint list

I have a AGV car and I want the car to follow the waypoints in my waypoints vector list when it’s moving.
Can someone help me to fix the line in the for loop to let the car follow the waypoints?



Spatial agv;
List<Vector3f> waypoint = new ArrayList<Vector3f>(); // waypoints list

public void drive(){

waypoint.add(new Vector3f(0,0,0));
waypoint.add(new Vector3f(15,0,0));
waypoint.add(new Vector3f(30,0,0));
waypoint.add(new Vector3f(30,0,15));

for (int i = 0; i < waypoint.size(); i++) {
agv.move(waypoint,0,waypoint); //how to fix this line?


Well you first of all need to do this over time, and not isntantly, take a look at the vector interpolation methods and controls

Also we have motionpath, see the examples provided, that do pretty much what you want