Grund
An important aspect of most AR experiences is for virtual assets to be properly vertically aligned with surfaces in the physical environment. For example, an AR animal sitting on the floor should neither appear to sink into the floor nor float above the floor.
In a single-user AR experience, this can be achieved by relying on the trackables reported by the device's native SLAM session. One adjusts the virtual height of assets to match the height of the relevant tracked plane reported by the native SLAM session, i.e., the height of the asset "follows" the tracked plane.
In a multi-user AR session, participants also view assets that are positioned by other participants, whose height they cannot adjust. For participant B to perceive an asset positioned by participant A as being flush on B's own horizontal plane, the tracked planes of A and B must thus appear at the same height inside the virtual scene, whereas errors in initial calibration or intermittent drift will generically cause the two tracked planes of each device to have slightly different heights. The Grund module performs a continuous recalibration of the devices' relative height offsets in the scene, such as to keep the two tracked planes that are in the central field of view of the devices aligned in height when these planes can be inferred to correspond to the same physical surface in the environment by their otherwise proximity.
The Grund module generalizes to more than two participants, with each non-host participant calibrating separately with the host participant.
Basic usage
Grund needs the following components for proper functioning:
- Only one object in the scene with
ARSessionOrigin
orXROrigin
ARPlaneManager
component on the above objectARRaycastManager
component should also be attached, either to the same GameObject or to one of its child objects.
Import the Grund module
using Auki.ConjureKit.Grund;
Initialize the Grund module
public class Demo : MonoBehaviour
{
public Transform cameraTransform;
private IConjureKit _conjureKit;
private Vikja _vikja;
private Grund _grund;
private void Start()
{
var config = AukiConfiguration.Get();
_conjureKit = new ConjureKit(config, cameraTransform, "app_key", "app_secret");
_vikja = new Vikja(_conjureKit);
_grund = new Grund(_conjureKit, _vikja);
}
}
Start and stop
_grund.SetActive(true);
_grund.SetActive(false);