Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Adding MARS simulator to existing ARFoundation project

Discussion in 'Unity MARS' started by unity_j0AVxGlV9sp33Q, Aug 14, 2020.

  1. unity_j0AVxGlV9sp33Q

    unity_j0AVxGlV9sp33Q

    Joined:
    Feb 7, 2020
    Posts:
    1
    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(https://forum.unity.com/threads/mars-direct-placement-example.908381/) 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
     
  2. amydigiov_Unity

    amydigiov_Unity

    Unity Technologies

    Joined:
    May 24, 2016
    Posts:
    16
    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.
     
    unity_j0AVxGlV9sp33Q likes this.