Reference points to aid in anchoring virtual objects to the physical world
Estimates for average color temperature and brightness
Tracking device position and orientation in physical space
Utilities for scaling content properly in AR
Raycasting against plane and depth data
Get started by installing 2018.1 with iOS and/or Android support, getting the sample projects from arfoundation-samples (they include ARFoundation and its required platform specific parts in their manifest), and deploying to your iOS and/or Android device.
Read up on the documentation, and come to this forum for any questions or comments. Weāre also working on more tools that work with ARFoundation, and integrating more recent features of the AR platforms.
So give this a try for your AR projects and give us feedback here! Happy developing!
Support for scale is still there, but we decided to remove the explicit āscaleā field from the ARSessionOrigin, since all it did was uniformly set the transform of its GameObject. Thereās no example in the sample repo yet, but all you have to do is set the scale of the transform of the GameObject with the ARSessionOrigin, and it will do the same thing as you may have seen in ARInterface.
hey, first of all itās good to have this package finally!
A question: How is camera permission managed for Android? Is it still on ARCore side? Previously I was able to subscribe to AndroidPermissionsManager event form GoogleARCore to get notified about user permission. But now ARCore API is not exposedā¦ Is there any way?
Does it still only ātransformā the camera? We changed the āPlace On planeā script, to find our gameobject by tag and move it.
When iĀ“m testing, it seems i only move part of my scene. And that dosent make sense if the camera is the one moving? Is it becourse i need to anchor the full scene?
If the app has been configured as AR Optional (instead of AR Required, see https://docs.unity3d.com/Packages/com.unity.xr.arcore@1.0/manual/index.html#build-settings ), then camera permissions are requested when you try to start an AR Session (in ARFoundation, this happens when the ARSession component is enabled). There is no callback (maybe there should be?), but you can query the current state of camera permissions with ARSubsystemManager.cameraSubsystem.IsPermissionGranted()
The āPlaceOnPlaneā sample component places itself on the plane, that is, it moves the content. This is to show how to place very simple content, like a cube, onto the plane using a raycast.
I swapped out the Unity ARKit 1.5 plugin with the new AR Foundation and builds worked great until I went to create an archive build in Xcode for publishing to Test Flight. Then I keep getting stuck on this error:
ld: bitcode bundle could not be generated because ā/Users/[UserName]/[ProjectName]/[BuildName]/Libraries/UnityARKit.a(RootViewSize.o)ā was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
What about other ar features? Will them be supported? Like face tracking, worldmap, reference image, reference objects of ARKit? Like cloud anchors , augmented image of ARCore?
Hmm, looks like we need to build the ARKit plugin with -fembed-bitcode to allow that. We donāt do that currently; Iāll look into it for the next release.
Iām really happy to see things are moving along with AR Framework! Iām doing some preliminary investigation before I replace the Experimental ARInterface in my project with AR Framework.
Does the Raycasting stuff work at all in the editor? With ARInterface I could aim AR Root around in the scene to raycast against planes in the ARGameObject layer. But the AR Default Plane in AR Framework doesnāt work the same way so Iām having a hard time figuring out how I can do simple raycast tests from the AR Camera in the editor.
Thanks Tim. I ended up using a separate plugin /UniAndroidPermission/ because I need to request camera permissions independently for a non AR-scene.
BTW. Whatās up with ARAnchors? Are they not needed anymore or not currently supported?
BTW2. I filed a bug report - > quitting ARscene causes Android app to hang and throw a leakage warning in Android Monitor, easly reproductuble with sample scene + added non-AR scene (all attached in bug report).
Whatās the best way to remove ARPlaneās after theyāve been created and stop generating new ones?
Hereās what Iāve tried so far:
public class RemovePlanes : MonoBehaviour
{
[SerializeField]
private ARPlaneManager m_ARPlaneManager;
private List<ARPlane> m_planes = new List<ARPlane>();
public void RemoveAllPlanes()
{
if (m_ARPlaneManager.planeCount == 0)
{
Debug.Log("** no planes to remove");
return;
}
// get all the planes in the scene
m_ARPlaneManager.GetAllPlanes(m_planes);
// and disable their game objects
for (int i = 0; i < m_planes.Count; i++)
{
Debug.Log("Removed "+m_planes[i].name);
m_planes[i].gameObject.SetActive(false);
}
// disable the plane manager so we stop generating new planes
m_ARPlaneManager.enabled = false;
}
}
The planes are disabled, plane generation stops and physics objects that were placed on top of the AR Planes fall through. So far so good.
But then in another script Iām aligning an object to the AR Planes with a Raycast. After removing the planes with the above script, my āhit objectā in the following script still moves around on the plane as if itās still totally there.
void Update ()
{
var hits = s_RaycastHits;
Ray ray = new Ray(m_camera.position, m_camera.forward);
if(m_SessionOrigin.Raycast(ray, hits, TrackableType.PlaneWithinPolygon))
{
m_hitObject.position = hits[0].pose.position;
}
}
List<ARRaycastHit> s_RaycastHits = new List<ARRaycastHit>();
So it seems that the physical Plane has been removed, but there is still some aspect of the plane there that the Raycast is hitting. This is probably ok, but it makes me think that Iām not removing the Planes correctly.