From b098b722c46b0bf71859ec48433fdd0d739a5329 Mon Sep 17 00:00:00 2001 From: ztimson Date: Thu, 11 Jul 2019 20:07:11 -0400 Subject: [PATCH] fixed rollover --- src/app/physics/physics.service.ts | 2 ++ 1 file changed, 2 insertions(+) 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);