Wikitude Unity Plugin
Public Member Functions | Public Attributes | Properties | List of all members
Wikitude.WikitudeCamera Class Reference

The Wikitude camera handles the connection with the native plugins. More...

Inherits MonoBehaviour.

Public Member Functions

bool IsFocusModeSupported (CaptureFocusMode focusMode)
 Checks if a focus mode is supported is supported by the current capture device. More...
 
bool IsExposureModeSupported (CaptureExposureMode exposureMode)
 Checks if an exposure mode is supported by the current capture device. More...
 
bool IsZoomLevelSupported (float zoomLevel)
 Checks if a zoom level is supported by the current capture device. More...
 
bool IsFlashModeSupported (CaptureFlashMode flashMode)
 Checks if a flash mode is supported by the current capture device. More...
 
void FocusAtPointOfInterest (Vector2 pointOfInterest)
 Sets the focus around a point. Should be called again whenever the camera is restarted More...
 
void ExposeAtPointOfInterest (Vector2 pointOfInterest, CaptureExposureMode exposureMode)
 Sets the exposure level around a point. Should be called again whenever the camera is restarted. More...
 

Public Attributes

OnCameraErrorEvent OnCameraError = new OnCameraErrorEvent()
 Called whenever the device camera encounters an error. More...
 
OnCameraOpenedEvent OnCameraOpened = new OnCameraOpenedEvent()
 Called whenever the device camera is opened. More...
 
OnSDKInitializedEvent OnSDKInitialized = new OnSDKInitializedEvent()
 Called after the SDK finished initialization. More...
 
TransformOverride ActiveOverride = null
 The current TransformOverride that should be applied before any Transform changes are made. More...
 

Properties

CaptureDevicePosition DevicePosition [get, set]
 Gets or sets the position of the capture device that is used or should be used. More...
 
CaptureFocusMode FocusMode [get, set]
 Gets or sets the focus mode that should be used by the current capture device, if supported. More...
 
CaptureExposureMode ExposureMode [get, set]
 Gets or sets the exposure mode that should be used by the current capture device, if supported. More...
 
float ManualFocusDistance [set]
 Gets or sets the manual focus distance that should be used. Valid values are between 0 and 1 and only works when the FocusMode is set to Locked and Camera2 API is enabled on Android. Value 0 indicates that the camera should focus as close as possible. More...
 
bool IsManualFocusAvailable [get]
 Checks if the current device supports manual focus. On Android, if Camera 2 API is not enabled, this will always be false. More...
 
CaptureAutoFocusRestriction AutoFocusRestriction [get, set]
 Gets or sets the current auto focus range restriction. This option is only available on iOS. More...
 
bool IsAutoFocusRestrictionSupported [get]
 Checks if auto focus range restriction is supported on the device. More...
 
float ZoomLevel [get, set]
 Gets or sets the zoom level that should be used. More...
 
float MaxZoomLevel [get]
 Gets the maximum zoom level supported by the current capture device. More...
 
CaptureFlashMode FlashMode [get, set]
 Gets or sets the current flash mode that should be used by the capture device. More...
 
CaptureDeviceResolution DesiredCameraResolution [get, set]
 Gets or sets the desired resolution of the camera capture device. The change will take place the next time a camera is started. More...
 
CaptureDeviceFramerate DesiredCameraFramerate [get, set]
 Gets or sets the desired framerate of the camera capture device. The change will take place the next time a camera is started. More...
 
bool EnableCamera2 [get, set]
 Enables Camera 2 API on Android, required if the Focus Distance needs to be set manually. More...
 
bool IsFocusAtPointOfInterestSupported [get]
 Checks if FocusAtPointOfInterest is supported by the current capture device. More...
 
bool IsExposeAtPointOfInterstSupported [get]
 Checks if FocusAtPointOfInterest is supported by the current capture device. More...
 
string WikitudeLicenseKey [get, set]
 Gets or sets the Wikitude license key. More...
 
bool EnableCameraRendering [get, set]
 Enables or disables rendering of the camera feed in the background of the scene. More...
 
bool StaticCamera [get, set]
 Changes how the camera and trackables are positioned in the world. By default, the camera is dynamic and moves around a static trackable. When enabling StaticCamera, the camera is fixed to the original position and the trackable moves around it. A static camera can be procedurally moved at runtime without affecting tracking. More...
 
Vector3 CalibrationPositionOffset [get, set]
 Position offset that is applied to the tracking matrix before it is processed by the plugin. More...
 
Quaternion CalibrationRotationOffset [get, set]
 Rotation offset that is applied to the tracking matrix before it is processed by the plugin. More...
 
bool IgnoreTrackableScale [get, set]
 When enabled, ignores the scaling of the trackable for tracking purposes and assumes it to be 1.0f. When doing a TransformOverride that also changes the scale of the trackables, this should be set to true. More...
 
Texture CameraTexture [get]
 Gets the GPU texture that contains the current camera frame. More...
 
bool EnableLivePreview [get, set]
 Gets or sets if the Live Preview mode should be enabled or not. More...
 
LivePreviewMode LivePreviewMode [get, set]
 Gets or sets which Live Preview mode should be used. More...
 
Texture2D StaticImage [get, set]
 Gets or sets which Image should be used in the Live Preview mode. The selected image should have the Read / Write settings enabled. More...
 
String WebCamName [get, set]
 Gets or sets which WebCam should be used in the Live Preview mode. More...
 
CaptureDevicePosition RemoteCameraPosition [get, set]
 Gets or sets which camera position to use in the Live Preview mode when using the Unity Remote app. More...
 
float CameraToHorizonAngle [get, set]
 Gets or sets the angle between the forward vector of the camera and the horizontal plane. A value of 0 indicates that the camera is pointed directly forward, while a value of 90 means that the camera is pointed directly down to the ground. When using static images or webcams, there is no sensor data to indicate how the ground plane is oriented in the image, but this is crucial for Instant Tracking to work correctly. More...
 
bool ForceResendData [get, set]
 When set to true, it will force resending the same image data, even if it didn't change. The value will revert to false when after the data was resent. More...
 

Detailed Description

The Wikitude camera handles the connection with the native plugins.

When the Awake function is called on it, the native plugin is initialized. When the WikitudeCamera it is destroyed, the plugin is also destroyed.

Also handles camera rendering and camera settings.

Member Function Documentation

void Wikitude.WikitudeCamera.ExposeAtPointOfInterest ( Vector2  pointOfInterest,
CaptureExposureMode  exposureMode 
)
inline

Sets the exposure level around a point. Should be called again whenever the camera is restarted.

Parameters
pointOfInterestThe point of interest around which the exposure should be taken. The point is in screen space, as would be returned by Input.mousePosition, for example.
exposureModeThe exposure mode that should be used around the point.
void Wikitude.WikitudeCamera.FocusAtPointOfInterest ( Vector2  pointOfInterest)
inline

Sets the focus around a point. Should be called again whenever the camera is restarted

Parameters
pointOfInterestThe point of interest where the camera should focus. The point is in screen space, as would be returned by Input.mousePosition, for example.
bool Wikitude.WikitudeCamera.IsExposureModeSupported ( CaptureExposureMode  exposureMode)
inline

Checks if an exposure mode is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsFlashModeSupported ( CaptureFlashMode  flashMode)
inline

Checks if a flash mode is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsFocusModeSupported ( CaptureFocusMode  focusMode)
inline

Checks if a focus mode is supported is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsZoomLevelSupported ( float  zoomLevel)
inline

Checks if a zoom level is supported by the current capture device.

Member Data Documentation

TransformOverride Wikitude.WikitudeCamera.ActiveOverride = null

The current TransformOverride that should be applied before any Transform changes are made.

OnCameraErrorEvent Wikitude.WikitudeCamera.OnCameraError = new OnCameraErrorEvent()

Called whenever the device camera encounters an error.

OnCameraOpenedEvent Wikitude.WikitudeCamera.OnCameraOpened = new OnCameraOpenedEvent()

Called whenever the device camera is opened.

OnSDKInitializedEvent Wikitude.WikitudeCamera.OnSDKInitialized = new OnSDKInitializedEvent()

Called after the SDK finished initialization.

Property Documentation

CaptureAutoFocusRestriction Wikitude.WikitudeCamera.AutoFocusRestriction
getset

Gets or sets the current auto focus range restriction. This option is only available on iOS.

Vector3 Wikitude.WikitudeCamera.CalibrationPositionOffset
getset

Position offset that is applied to the tracking matrix before it is processed by the plugin.

Quaternion Wikitude.WikitudeCamera.CalibrationRotationOffset
getset

Rotation offset that is applied to the tracking matrix before it is processed by the plugin.

Texture Wikitude.WikitudeCamera.CameraTexture
get

Gets the GPU texture that contains the current camera frame.

float Wikitude.WikitudeCamera.CameraToHorizonAngle
getset

Gets or sets the angle between the forward vector of the camera and the horizontal plane. A value of 0 indicates that the camera is pointed directly forward, while a value of 90 means that the camera is pointed directly down to the ground. When using static images or webcams, there is no sensor data to indicate how the ground plane is oriented in the image, but this is crucial for Instant Tracking to work correctly.

CaptureDeviceFramerate Wikitude.WikitudeCamera.DesiredCameraFramerate
getset

Gets or sets the desired framerate of the camera capture device. The change will take place the next time a camera is started.

CaptureDeviceResolution Wikitude.WikitudeCamera.DesiredCameraResolution
getset

Gets or sets the desired resolution of the camera capture device. The change will take place the next time a camera is started.

CaptureDevicePosition Wikitude.WikitudeCamera.DevicePosition
getset

Gets or sets the position of the capture device that is used or should be used.

bool Wikitude.WikitudeCamera.EnableCamera2
getset

Enables Camera 2 API on Android, required if the Focus Distance needs to be set manually.

Returns
bool Wikitude.WikitudeCamera.EnableCameraRendering
getset

Enables or disables rendering of the camera feed in the background of the scene.

bool Wikitude.WikitudeCamera.EnableLivePreview
getset

Gets or sets if the Live Preview mode should be enabled or not.

CaptureExposureMode Wikitude.WikitudeCamera.ExposureMode
getset

Gets or sets the exposure mode that should be used by the current capture device, if supported.

CaptureFlashMode Wikitude.WikitudeCamera.FlashMode
getset

Gets or sets the current flash mode that should be used by the capture device.

CaptureFocusMode Wikitude.WikitudeCamera.FocusMode
getset

Gets or sets the focus mode that should be used by the current capture device, if supported.

bool Wikitude.WikitudeCamera.ForceResendData
getset

When set to true, it will force resending the same image data, even if it didn't change. The value will revert to false when after the data was resent.

bool Wikitude.WikitudeCamera.IgnoreTrackableScale
getset

When enabled, ignores the scaling of the trackable for tracking purposes and assumes it to be 1.0f. When doing a TransformOverride that also changes the scale of the trackables, this should be set to true.

Returns
bool Wikitude.WikitudeCamera.IsAutoFocusRestrictionSupported
get

Checks if auto focus range restriction is supported on the device.

Returns
bool Wikitude.WikitudeCamera.IsExposeAtPointOfInterstSupported
get

Checks if FocusAtPointOfInterest is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsFocusAtPointOfInterestSupported
get

Checks if FocusAtPointOfInterest is supported by the current capture device.

bool Wikitude.WikitudeCamera.IsManualFocusAvailable
get

Checks if the current device supports manual focus. On Android, if Camera 2 API is not enabled, this will always be false.

LivePreviewMode Wikitude.WikitudeCamera.LivePreviewMode
getset

Gets or sets which Live Preview mode should be used.

float Wikitude.WikitudeCamera.ManualFocusDistance
set

Gets or sets the manual focus distance that should be used. Valid values are between 0 and 1 and only works when the FocusMode is set to Locked and Camera2 API is enabled on Android. Value 0 indicates that the camera should focus as close as possible.

float Wikitude.WikitudeCamera.MaxZoomLevel
get

Gets the maximum zoom level supported by the current capture device.

CaptureDevicePosition Wikitude.WikitudeCamera.RemoteCameraPosition
getset

Gets or sets which camera position to use in the Live Preview mode when using the Unity Remote app.

bool Wikitude.WikitudeCamera.StaticCamera
getset

Changes how the camera and trackables are positioned in the world. By default, the camera is dynamic and moves around a static trackable. When enabling StaticCamera, the camera is fixed to the original position and the trackable moves around it. A static camera can be procedurally moved at runtime without affecting tracking.

Texture2D Wikitude.WikitudeCamera.StaticImage
getset

Gets or sets which Image should be used in the Live Preview mode. The selected image should have the Read / Write settings enabled.

String Wikitude.WikitudeCamera.WebCamName
getset

Gets or sets which WebCam should be used in the Live Preview mode.

string Wikitude.WikitudeCamera.WikitudeLicenseKey
getset

Gets or sets the Wikitude license key.

The wikitude license key.

float Wikitude.WikitudeCamera.ZoomLevel
getset

Gets or sets the zoom level that should be used.