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 focus distance of the camera. Use a value between 0 and 100 where 0 is infinity focus and 100 is the shortest distance from frontmost surface of the lens that can be brought into sharp focus.
Sets the autofocus mode of the camera, possible values are ONCE to start one-shot autofocus or CONTINUOUS to keep adjusting focus automatically.
true if the current camera supports manual focus, false otherwise.
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.
Defines a correction angle clockwise of the compass in degrees. Values will be applied modulo 360. A value of 361 degrees has the same effect as setting the value to 1 degree.
Controls if the sensors are active or not. Sensors include GPS, mangetometer, accelerometer and gyroscope. (gyroscope is only used on iOS)
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.