For a game concept im working on i want to let the player adjust their “world to meters” scale on the fly while walking around at the same time.
The problem is that “world to meters” works by reducing coordinates by the % of scale, thus “sucking” the player to the 0,0,0 of the tracked space location, as seen in this picture:
What i need to do achieve is to move the pawn the right amount of distance in order to keep the player located at the location he’s currently standing at.
This is a variable that needs to be calculated as a “AddActorWorldOffset” value that can be used to adjust the pawn’s location every tick.
The effect is similar to how you’d use GoogleMaps, where you can hover your mouse over one city, zoom in/out and your mouse would still be located over that same city
This is a diagram of the problem with only one dimension, with the tracked space resizing (with the world to meters variable changing) and moving the required amounts.
- the last value should be 150% not 50…
A calculation i worked out on paper was:
(World to meters Tick 1)-(World to meters Tick 2)= Variance
Variance * 0.01 * HMD Coordinate = amount that the pawn needs to move to compensate
However this causes the pawn to stay relatively in place at distances near the origin of the world, but the further you move out the more the player is moved while scaling takes place.
Is there a proper formula/solution to solve this?