diff --git a/src/app/physics/physics.service.ts b/src/app/physics/physics.service.ts index 7551c81..4974051 100644 --- a/src/app/physics/physics.service.ts +++ b/src/app/physics/physics.service.ts @@ -64,6 +64,8 @@ export class PhysicsService { } info.heading = -data[1].alpha + (data[2] == Infinity ? 0 : data[2]); + if(info.heading < 0) info.heading += 360; + if(info.heading >= 360) info.heading -= 360; } if(info.speed == null && !!data[3]) info.speed = Math.sqrt(data[3].x**2 + data[3].y**2 + data[3].z**2);