Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgilbers committed Sep 24, 2024
1 parent ba11d8d commit 21cded6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/Position.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const magnitudeArray = []
const stepLength = 10 // Schrittweite in Metern
const stepThreshold = 2

const rotationBias = 120
const rotationBias = 60

function toRadians (deg) {
return deg * (Math.PI / 180)
Expand Down Expand Up @@ -127,7 +127,7 @@ export function calculatePosition (motionArray, userPosition) {
yFiltered = filteredArrays[lastIndex][1]
zFiltered = filteredArrays[lastIndex][2]

lastOrientation = 360 - motionArray[lastIndex][3] + rotationBias
lastOrientation = motionArray[lastIndex][3] + rotationBias
magnitude = Math.sqrt(xFiltered * xFiltered + yFiltered * yFiltered + zFiltered * zFiltered)
if (magnitudeArray.length >= magnitudeArrayLength) {
magnitudeArray.shift()
Expand Down

0 comments on commit 21cded6

Please sign in to comment.