( state: number, waypoints: DecodedPathWaypoint[], currentWaypoint: number, distanceToGoal: number, )
| 44 | * Store new path data. Called from WebRTC onmessage handler. |
| 45 | */ |
| 46 | export function setPathData( |
| 47 | state: number, |
| 48 | waypoints: DecodedPathWaypoint[], |
| 49 | currentWaypoint: number, |
| 50 | distanceToGoal: number, |
| 51 | ): void { |
| 52 | globalStore.state = state; |
| 53 | globalStore.waypoints = waypoints; |
| 54 | globalStore.currentWaypoint = currentWaypoint; |
| 55 | globalStore.distanceToGoal = distanceToGoal; |
| 56 | globalStore.version++; |
| 57 | globalStore.timestamp = performance.now(); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Read current path data. Called from useFrame. |
no outgoing calls
no test coverage detected