This repository has been archived by the owner on May 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
A.5. AR Initial Settings
Hadi Tavakoli edited this page Aug 2, 2019
·
5 revisions
Based on how your app works, you may need the AR experience to initiate in different modes. For example, you may need to use the front camera at the beginning of your experience. Or maybe you need to set the camera resolution at a specific value or many other configurations. The best place to do that is before running the AR experience.
var _arSettings:Config = new Config();
// common settings on both platforms
_arSettings.camFocusMode = CameraFocusMode.CONTINUOUS;
_arSettings.camPosition = CameraPosition.BACK;
_arSettings.camResolution = CameraResolution.SD_640x480;
// for best performance, you must activated only the AR features which you will use.
_arSettings.hasGeo = true;
_arSettings.hasInstant = true;
_arSettings.hasIR = true;
_arSettings.hasObject = true;
if(OverrideAir.os == OverrideAir.ANDROID)
{
// Android specific settings
_arSettings.android.cam2Enabled = false;
_arSettings.android.fullscreenMode = true;
_arSettings.android.camFocusDistanceAndroid = 1;
}
else if(OverrideAir.os == OverrideAir.IOS)
{
// iOS specific settings
_arSettings.ios.camFocusDistance = -1.0;
_arSettings.ios.camFocusRange = FocusRange.NONE;
_arSettings.ios.framerate = 30;
_arSettings.ios.excludeBinnedVideo = true;
}
AR.config(_arSettings);
AR.launchAR("ARWorld/index.html");
Enjoy building Air apps – With ♥ from MyFlashLabs Team