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 70a58f7 commit aa52aaa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/Position.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const magnitudeArray = []
const stepLength = 10 // Schrittweite in Metern
const stepThreshold = 2

const rotationBias = 120

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

lastOrientation = motionArray[lastIndex][3]
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 aa52aaa

Please sign in to comment.