XRCamera3D near distance when parent is scaled

Godot Version

4.4.1 mono

Question

`I’m using the OpenXR plugin for meta, and made simple scene where my XROrigin3D node is reparented to a Node3D that have a scale of x0.1 in all direction (I’m going for a ToyStory like scaling effect :slight_smile: ).

The rest of the scene does appear to be 10x bigger (intended effect) but there something strange about the XrCamera Near distance. It appears to be around 5 meters (in my local miniature space, thus around 0.5m in global space) although the camera near value is still at its default value : 0.05m

Now, if after reparenting I set the camera Near value to 0.05 * 0.1 to take the parent scale into account, the Near distance is now 0.5m (in miniature space), thus 0.05m in global space.

It’s quite confusing, can anyone give me some explanation of what’s happening ?
It appears to apply the scale twice (squared value), so that being at 0.1 scale will multiply the near value by 100 in global world space.
Why does the near value not being in local camera space ?

Thank you so much for your help

M.`

While I don’t have a specific answer to why the near value would be effected in this way, scaling the branch that holds the XR camera to create a change of world scale has so far resulted in a number of side effects that have proven illusive to fix. Especially because the scene is blissfully unaware that we’re going to end up with a stereoscopic result. I do suspect your particular issue might extend beyond XR.

That said, at some point early on in Godot XRs development we decided to add a world_scale property to the XRServer which properly scales the tracking and IPD data to create the illusion of a bigger/smaller world, exactly what you’re trying to achieve here. So I suggest playing around that as a solution.

We do hope to some day deprecate this property and properly react to the camera node ending up being scaled but so far nobody has had the time to really dive into that and resolve the issues with this approach.