Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

A.4. AR Features

Hadi Tavakoli edited this page Aug 9, 2017 · 3 revisions

AR Features

AR ANE has the following features:

  • Features.GEO
  • Features.IMAGE_TRACKING
  • Features.INSTANT_TRACKING
  • Features.OBJECT_TRACKING

Depending on your app, you may need all or some of these features. For better performance, it is highly suggested to start the AR experience with only the features which are really required by your app.

First, you need to check if the required features are supported on the running device or not.

var features:Array = [];
features.push(Features.GEO);
features.push(Features.IMAGE_TRACKING);
features.push(Features.INSTANT_TRACKING);
features.push(Features.OBJECT_TRACKING);

AR.init(
				"Wikitude's Android license key",
				"Wikitude's iOS license key"
		);
		
AR.checkFeatureSupport(features, onCheckResult);
function onCheckResult($status:int, $msg:String):void
{
	if($status == AR.RESULT_OK)
	{
		trace("Device supports all requested AR features");
	}
	else if($status == AR.RESULT_ERROR)
	{
		trace("Device does not support all features: " + $msg);
	}
}

Then, when you are ready to start the AR experience, you must set the required features in the config instance.

var _arSettings:Config = new Config();
_arSettings.hasGeo = true;
_arSettings.hasInstant = true;
_arSettings.hasIR = true;
_arSettings.hasObject = true;

// _arSettings includes more properties which we'll explain in: https://github.com/myflashlab/AR-ANE-Samples/wiki/A.5.-AR-Initial-Settings

AR.config(_arSettings);
AR.launchAR("ARWorld/index.html");