lab712-kao / pre_TowerDefender

AR tower defender
0 stars 0 forks source link

new Moving method #7

Open Os-carsun opened 9 years ago

Os-carsun commented 9 years ago

After all,I find the moving method of moving object is not as well as I think so; it should be change ,but I don't know what is better way to complete this method, is anyone have ideal?

Os-carsun commented 9 years ago

now , I'm trying to save all path in a arraylist, it is produced by Path Planer. Path Planer have following feature 1.give begin and goal (both of Vector3d type), and Path Planer can produced Path

  1. use addPos it can add a position(Vector3d type) in the path, and the path will reproduced
  2. side by each position is at a distance of avaLength

then I'll change the method move of movingObject

Os-carsun commented 9 years ago

finally,I find it maybe get a problem in this way of moving method if next position is on the left of last position and the distance of this two position is bigger than avaLength that the function,fillPos() will work; However the math formula is only work in the situation that next position on right of the last position,then X and Y are become divergence.

I need some help on math

Os-carsun commented 9 years ago

After over a week ,I come up with an idea -- merge those two way of moving method ( path planer and move angle);
First, using path planer to make path,but it is no longer to use fill method,there is just the point that must be passed. Second,every objects will move along with the move angle,if there is object over the point of path,then the mover will change move angle of this object to next point of path.

it thinks simple to complete,but I need somebody touch me Dot Product and Trigonometric Functions...