Commit 408ed66
committed
Performance getNearestWaypoints
This will speed up the function getNearestWaypoints by 5x.
Idea is to catch up the waypoints in a distance of 50m around the looking position with simple distance function instead of performing complex calculations on all waypoints.
After that the complex calculations are performed on the catched waypoints to find the suitable nearest waypoint.
In case less then 10 waypoints are found the existing approach is followed.
Possible further improvements:
- consider workwith instead of fixed 50m
- consider number of workers(multitools) on same course
Remark:
I will not invest more time on this, so leave it up to you:
Take it, improve it or drop it.1 parent 557c1e0 commit 408ed66
1 file changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1333 | 1333 | | |
1334 | 1334 | | |
1335 | 1335 | | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1336 | 1369 | | |
1337 | 1370 | | |
1338 | 1371 | | |
| |||
0 commit comments