Adding MARS simulator to existing ARFoundation project

Hi all

We’ve been working on our own AR project using ARFoundation for a while and one of the biggest obstacles has been the need for on-device testing. We’d like to integrate MARS in our existing project so we can do more of our work and testing in the editor.

We currently use ARFoundation’s ARRaycastManager#Raycast method in combination with ARPlaneManager#GetPlane to get information about the user’s interaction with the environment (retrieve the location of the hits, retrieve the orientation of the hit planes, etc).

Is it possible to integrate the MARS simulator into our existing project so we can test it in the editor?

I looked at the DirectPlacement sample( MARS Direct Placement Example ) and noticed it uses a Replicator to create planes that were then used as Physics#Raycast targets.

Is it possible to continue using our ARFoundation (ARRaycastManager#Raycast) approach or should we update our app to also use replicators and Physics#Raycasts if we want to use the simulator?

Going forward, is the method shown in the DirectPlacement sample the recommended way of implementing AR raycast logic when using MARS? Should we use MARS methods and concepts instead of directly accessing the underlying ARFoundation classes and methods?

Thanks in advance


As you said, yes the Direct Placement sample is the recommended way to implement AR raycasting in MARS, if you want to test your app in Simulation. Currently the only way to get AR data and functionality in MARS Simulation is through the MARS data layer (through the proxy system, or by getting data directly by implementing "IUses" interfaces).

We are working on making Simulation its own XR Subsystem. With this you will be able to use features of Simulation without requiring the proxy system, and AR Foundation will work in Simulation. Stay tuned for more updates.

1 Like