hardware includes some general functions which allow interaction
with the device itself.
The Singleton instance of the class will automatically be created on World
startup and can be accessed via AR.hardware.
AR.hardware.camera.position = AR.CONST.CAMERA_POSITION.FRONT
Controls if the camera is active or not.
If the property is set to true, the camera is visible on the screen, and computer vision components are activated. If the property is set to false, the camera will be disabled, a black background will be visible and computer vision components are specifically deactivated.
It is recommended to disable the camera service temporarily when fullscreen HTML is shown. This reduces power consumption and increases performance.
Queries the capabilities of the device camera, returns informations about min and max zoom levels, supported camera positions, and focus modes.
Turns the device flashlight on or off. Use the isFlashlightAvailable property to check if the device has a flashlight or not. If the device has no flashlight and the property is set to true, this will have no effect.
true if the device has a flashlight, false otherwise.
Note that the following permissions are required on Android:
<uses-feature android:name="android.hardware.camera.flash" />
Sets the autofocus mode of the camera, possible values are ONCE to start one-shot autofocus or CONTINUOUS to keep adjusting focus automatically.
Sets the active camera position, possible values are FRONT or BACK.
Sets the zoom level of the camera. Use a value of 1 for no zoom. If a particular value is not supported, a "best match" will be used.
Controls if the sensors are active or not. Sensors include GPS, mangetometer, accelerometer and gyroscope.
If the property is set to true, any geo-related components (such as GeoObjects and ActionRanges) are active. If the property is set to false, any geo-related components will not be visible on the screen, and triggers will not fire.
It is recommended to disable the sensors when only computer vision components are used. This reduces power consumption and increases performance.