C++ Java Unity
Unity Reference
VuforiaRuntimeUtilities Class Reference

A utility class containing various helper methods More...

Static Public Member Functions

static Vector2 CameraFrameToScreenSpaceCoordinates (Vector2 cameraFrameCoordinate, Rect bgTextureViewPortRect, bool isTextureMirrored, CameraDevice.VideoModeData videoModeData)
 Calculates a position in screen space coordinates based on the current orientation and background config for a given screen-space position More...
 
static OrientedBoundingBox CameraFrameToScreenSpaceCoordinates (OrientedBoundingBox cameraFrameObb, Rect bgTextureViewPortRect, bool isTextureMirrored, CameraDevice.VideoModeData videoModeData)
 Calculates the screen space parameters for an oriented bounding box (center, half extents, rotation) specified in camera frame coordinates. The calculation is based on the current screen orientation. More...
 
static void DestroyAllDataSetsAndTrackables ()
 Destroys all the currently loaded DataSets and all the associated Trackables. More...
 
static void DisableSleepMode ()
 The device screen stays turned on and bright More...
 
static void ForceDisableTrackables ()
 Disables all TrackableBehaviours. Used when an GL or orientation error is detected in a sample. More...
 
static FusionProviderType GetActiveFusionProvider ()
 Returns which provider Vuforia Fusion has selected to use More...
 
static string GetStoragePath (String path, VuforiaUnity.StorageType storageType)
 Based on the storage type and current platform returns to the caller the correct path for a given platform. More...
 
static bool IsPlayMode ()
 returns ONLY true if we are running in Play Mode More...
 
static bool IsPlayModeRecording ()
 returns true if we are running in Play Mode with a Recording More...
 
static bool IsPlayModeWebCam ()
 returns true if we are running in Play Mode with a WebCam More...
 
static bool IsSimulatorMode ()
 returns ONLY true if we are running in Play Mode in Simulator Mode More...
 
static bool IsUfoEnabled (string licenseKey, string ufoKey)
 
static bool IsVuforiaEnabled ()
 returns true if we have access to Vuforia (on a mobile device OR in the emulator in Unity Pro with a webcam connected) More...
 
static bool IsWebCamUsed ()
 If the web cam is enabled. More...
 
static bool IsWSARuntime ()
 returns ONLY true if we are in any one of the WSA modes More...
 
static bool MatrixIsNaN (Matrix4x4 matrix)
 Check if a matrix is NaN. return true if any element is NaN, false otherwise. More...
 
static void ResetSleepMode ()
 Reset the sleep mode to the system settings. More...
 
static VuforiaRenderer.Vec2I ScreenSpaceToCameraFrameCoordinates (Vector2 screenSpaceCoordinate, Rect bgTextureViewPortRect, bool isTextureMirrored, CameraDevice.VideoModeData videoModeData)
 Calculates a position in camera frame coordinates based on the current orientation and background config for a given screen-space position More...
 
static Vector2 ScreenSpaceToCameraFrameCoordinatesNormalized (Vector2 screenSpaceCoordinate, Rect bgTextureViewPortRect)
 Calculates a normalized position in camera frame coordinates based on the current orientation and background config for given screen-space coordinates More...
 
static void SelectRectTopLeftAndBottomRightForLandscapeLeft (Rect screenSpaceRect, bool isMirrored, out Vector2 topLeft, out Vector2 bottomRight)
 Selects the top left and bottom right corners from a rect, where "top", "left", "bottom" and "right" are in respect to landscape left orientation Used for region of interest calculations for text tracking More...
 
static FusionProviderType SetAllowedFusionProviders (FusionProviderType providerTypes)
 Specifies which providers Vuforia Fusion is allowed to select from More...
 
StreamingAssets.*</summary > *static string StripStreamingAssetsFromPath (string fullPath)
 Returns the file path without the first two elements of the path for example it would remove ' More...
 
static Vector2 ViewPortToCameraFrameCoordinatesNormalized (Vector2 unityViewPortCoordinates, Rect bgTextureViewPortRect)
 Calculates a normalized position in camera frame coordinates based on the current orientation and background config for given Unity ViewPort coordinates More...
 

Properties

static bool IsLandscapeOrientation [get]
 returns true if ScreenOrientation is in ANY landscape mode More...
 
static bool IsPortraitOrientation [get]
 returns true if VuforiaScreenOrientation is in ANY portrait mode More...
 
static ScreenOrientation ScreenOrientation [get]
 Wrapper for Screen.orientation to enable correct handling in Editor and on devices that do not support all orientations. More...
 

Detailed Description

A utility class containing various helper methods

Member Function Documentation

static Vector2 CameraFrameToScreenSpaceCoordinates ( Vector2  cameraFrameCoordinate,
Rect  bgTextureViewPortRect,
bool  isTextureMirrored,
CameraDevice.VideoModeData  videoModeData 
)
static

Calculates a position in screen space coordinates based on the current orientation and background config for a given screen-space position

static OrientedBoundingBox CameraFrameToScreenSpaceCoordinates ( OrientedBoundingBox  cameraFrameObb,
Rect  bgTextureViewPortRect,
bool  isTextureMirrored,
CameraDevice.VideoModeData  videoModeData 
)
static

Calculates the screen space parameters for an oriented bounding box (center, half extents, rotation) specified in camera frame coordinates. The calculation is based on the current screen orientation.

static void DestroyAllDataSetsAndTrackables ( )
static

Destroys all the currently loaded DataSets and all the associated Trackables.

static void DisableSleepMode ( )
static

The device screen stays turned on and bright

static void ForceDisableTrackables ( )
static

Disables all TrackableBehaviours. Used when an GL or orientation error is detected in a sample.

static FusionProviderType GetActiveFusionProvider ( )
static

Returns which provider Vuforia Fusion has selected to use

This function must be called after initializing Vuforia. If called before initializing Vuforia Engine, the function returns INVALID_OPERATION.

static string GetStoragePath ( String  path,
VuforiaUnity.StorageType  storageType 
)
static

Based on the storage type and current platform returns to the caller the correct path for a given platform.

static bool IsPlayMode ( )
static

returns ONLY true if we are running in Play Mode

static bool IsPlayModeRecording ( )
static

returns true if we are running in Play Mode with a Recording

static bool IsPlayModeWebCam ( )
static

returns true if we are running in Play Mode with a WebCam

static bool IsSimulatorMode ( )
static

returns ONLY true if we are running in Play Mode in Simulator Mode

static bool IsUfoEnabled ( string  licenseKey,
string  ufoKey 
)
static
static bool IsVuforiaEnabled ( )
static

returns true if we have access to Vuforia (on a mobile device OR in the emulator in Unity Pro with a webcam connected)

static bool IsWebCamUsed ( )
static

If the web cam is enabled.

static bool IsWSARuntime ( )
static

returns ONLY true if we are in any one of the WSA modes

static bool MatrixIsNaN ( Matrix4x4  matrix)
static

Check if a matrix is NaN. return true if any element is NaN, false otherwise.

static void ResetSleepMode ( )
static

Reset the sleep mode to the system settings.

static VuforiaRenderer.Vec2I ScreenSpaceToCameraFrameCoordinates ( Vector2  screenSpaceCoordinate,
Rect  bgTextureViewPortRect,
bool  isTextureMirrored,
CameraDevice.VideoModeData  videoModeData 
)
static

Calculates a position in camera frame coordinates based on the current orientation and background config for a given screen-space position

static Vector2 ScreenSpaceToCameraFrameCoordinatesNormalized ( Vector2  screenSpaceCoordinate,
Rect  bgTextureViewPortRect 
)
static

Calculates a normalized position in camera frame coordinates based on the current orientation and background config for given screen-space coordinates

static void SelectRectTopLeftAndBottomRightForLandscapeLeft ( Rect  screenSpaceRect,
bool  isMirrored,
out Vector2  topLeft,
out Vector2  bottomRight 
)
static

Selects the top left and bottom right corners from a rect, where "top", "left", "bottom" and "right" are in respect to landscape left orientation Used for region of interest calculations for text tracking

static FusionProviderType SetAllowedFusionProviders ( FusionProviderType  providerTypes)
static

Specifies which providers Vuforia Fusion is allowed to select from

This function must be called before initializing Vuforia. If the call is successful, it returns the value of providerTypes which was passed in.

If called after initializing Vuforia Engine, the function returns INVALID_OPERATION.

providerTypes is a single value created by or'ing together the desired FusionProviderType enum values.

Note: The enum value INVALID_OPERATION should not be used when setting up the providerTypes.

StreamingAssets.*</summary> * static string StripStreamingAssetsFromPath ( string  fullPath)
static

Returns the file path without the first two elements of the path for example it would remove '

static Vector2 ViewPortToCameraFrameCoordinatesNormalized ( Vector2  unityViewPortCoordinates,
Rect  bgTextureViewPortRect 
)
static

Calculates a normalized position in camera frame coordinates based on the current orientation and background config for given Unity ViewPort coordinates

Property Documentation

bool IsLandscapeOrientation
staticget

returns true if ScreenOrientation is in ANY landscape mode

bool IsPortraitOrientation
staticget

returns true if VuforiaScreenOrientation is in ANY portrait mode

ScreenOrientation ScreenOrientation
staticget

Wrapper for Screen.orientation to enable correct handling in Editor and on devices that do not support all orientations.