Skip to content

Understanding the observer

richardTingle edited this page Oct 15, 2023 · 2 revisions

Tamarin largely abstracts away the Observer, allowing you to simply move the players feet to a location or have them look in a direction (left and right only to avoid a VR world, real world mismatch). But advanced functionality (like if you really really want a VR world, real world mismatch) requires understanding the observer. The observer is a member within the XrAppState

What is the observer

The observer is a reference point in the game that correlates with a point in the real world (typically at your feet in the centre of your real world play area)

observer explanation point 1

When you teleport the player (or even just walk programmatically) you are not directly moving the player, you are moving the section of the real world that overlaps with the virtual world

observer explanation point 2

This is expressed by moving (or rotating) the observer. This then indirectly moves the player. This indirection is necessary because the player's position can also be changed by the physical human walking in the real world; as such the game should only change the offset between the real world and the virtual world (by moving the observer) and letting the VR headset tell the game where the player is now as a result.

What isn't the observer

The observer isn't the player's eyes, or their head position. It is only indirectly related to the player's position in the game; it will in general be within a few meters of the players feet (depending on how much real world walking the player has done).

Getting more examples

Running the TamarinTestBed and entering the moving and teleporting example can give a better understanding (the observer is physically rendered in the scene in this example)

Clone this wiki locally