C API Unity API
Unity API Reference
ObserverFactory Class Reference

Provides methods to create Vuforia tracked targets More...

Public Member Functions

AnchorBehaviour CreateAnchorBehaviour (string name, Vector3 position, Quaternion rotation)
 Creates an Anchor Behaviour in mid air using the transform of the pose (position/rotation) where it should be anchored. More...
 
AnchorBehaviour CreateAnchorBehaviour (string name, HitTestResult hitTestResult)
 Creates an Anchor Behaviour on a plane using the location (position/rotation) of a HitTestResult from a previous World.HitTest(). More...
 
AreaTargetBehaviour CreateAreaTarget (string databasePath, string targetName, bool requiresExternalPositions=false)
 Creates an Area Target Behaviour from a target stored in a Vuforia database. More...
 
AreaTargetBehaviour CreateAreaTarget (string databasePath, string targetName, bool hasOcclusion, bool hasCollision, string occlusionModelPath=null, bool requiresExternalPositions=false)
 Creates an Area Target Behaviour from a target stored in a Vuforia database. More...
 
BarcodeBehaviour CreateBarcodeBehaviour (HashSet< BarcodeBehaviour.BarcodeType > observedTypes, bool detectMultipleBarcodes)
 Creates a Barcode Behaviour More...
 
IEnumerable< ObserverBehaviourCreateBehavioursFromDatabase (string databasePath)
 Creates Behaviours from all observers in a database. More...
 
CloudRecoBehaviour CreateCloudRecoBehaviour (string accessKey, string secretKey)
 Creates a Cloud Recognition using auth keys. Then initializes the reco. More...
 
CylinderTargetBehaviour CreateCylinderTarget (string databasePath, string targetName)
 Creates a Cylinder Target Behaviour from a target stored in a Vuforia database. More...
 
ImageTargetBehaviour CreateImageTarget (string databasePath, string targetName)
 Creates an Image Target Behaviour from a target stored in a Vuforia database. More...
 
ImageTargetBehaviour CreateImageTarget (string filePath, float widthInMeters, string targetName)
 Creates an Image Target from a path to a Unity Texture file. More...
 
ImageTargetBehaviour CreateImageTarget (Texture2D texture, float widthInMeters, string targetName)
 Creates an Image Target from a Unity Texture2D. More...
 
ImageTargetBehaviour CreateImageTarget (IntPtr texturePointer, int textureWidth, int textureHeight, TextureFormat format, float widthInMeters, string targetName)
 Create an Image Target using raw image data loaded by functions independent from Vuforia Engine. More...
 
ModelTargetBehaviour CreateModelTarget (string databasePath, string targetName, TrackingOptimization? trackingOptimization=null)
 Creates a Model Target Behaviour from a target stored in a Vuforia database. More...
 
ModelTargetBehaviour CreateModelTarget (string databasePath, string targetName, bool hasOcclusion, bool hasCollision, TrackingOptimization? trackingOptimization=null)
 Creates a Model Target Behaviour from a target stored in a Vuforia database. More...
 
MultiTargetBehaviour CreateMultiTarget (string databasePath, string targetName)
 Creates a Multi Target Behaviour from a target stored in a Vuforia database. More...
 
GameObject CreateRuntimeMeshRenderingBehaviour (ModelTargetBehaviour modelTargetBehaviour, Material displayMaterial)
 Create a Runtime Mesh Behaviour for the Model Target. More...
 
GameObject CreateRuntimeMeshRenderingBehaviour (AreaTargetBehaviour areaTargetBehaviour, Material displayMaterial, bool hasCollision)
 Create a Runtime Mesh Rendering Behaviour for the Area Target. More...
 
GameObject CreateRuntimeMeshRenderingBehaviour (AreaTargetCaptureBehaviour areaTargetCaptureBehaviour, Material displayMaterial, bool hasCollision)
 Create a Runtime Mesh Rendering Behaviour for the Area Target Capture Behaviour. More...
 
VuMarkBehaviour CreateVuMarkBehaviour (string databasePath, string targetName)
 Creates a VuMark Behaviour from a target stored in a Vuforia database. More...
 

Detailed Description

Provides methods to create Vuforia tracked targets

Member Function Documentation

◆ CreateAnchorBehaviour() [1/2]

AnchorBehaviour CreateAnchorBehaviour ( string  name,
Vector3  position,
Quaternion  rotation 
)
inline

Creates an Anchor Behaviour in mid air using the transform of the pose (position/rotation) where it should be anchored.

Parameters
nameThe logical name of the anchor. This must be unique among all created anchors.
positionThe position at which the anchor will be created.
rotationThe rotation of the anchor that will be created.
Returns
The Anchor Behaviour at the specified position and rotation.

◆ CreateAnchorBehaviour() [2/2]

AnchorBehaviour CreateAnchorBehaviour ( string  name,
HitTestResult  hitTestResult 
)
inline

Creates an Anchor Behaviour on a plane using the location (position/rotation) of a HitTestResult from a previous World.HitTest().

Parameters
nameThe logical name of the anchor. This must be unique among all created anchors.
hitTestResultThe HitTestResult containing the pose at which the anchor will be created on a plane.
Returns
The Anchor Behaviour on the plane at the location of the hit test.

◆ CreateAreaTarget() [1/2]

AreaTargetBehaviour CreateAreaTarget ( string  databasePath,
string  targetName,
bool  requiresExternalPositions = false 
)
inline

Creates an Area Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
requiresExternalPositionsOptional parameter to force the dataset to require an external position. Useful to optimize large dataset loading behavior
Returns
The Area Target Behaviour created from the specified target.

◆ CreateAreaTarget() [2/2]

AreaTargetBehaviour CreateAreaTarget ( string  databasePath,
string  targetName,
bool  hasOcclusion,
bool  hasCollision,
string  occlusionModelPath = null,
bool  requiresExternalPositions = false 
)
inline

Creates an Area Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
hasOcclusionSets if target will have a runtime occlusion.
hasCollisionSets if target will have a runtime collision.
occlusionModelPathAbsolute path to the '*_occlusion.dt' file. If not set, it will be searched next to the dataset file.
requiresExternalPositionsOptional parameter to force the dataset to require an external position. Useful to optimize large dataset loading behavior
Returns
The Area Target Behaviour created from the specified target.

◆ CreateBarcodeBehaviour()

BarcodeBehaviour CreateBarcodeBehaviour ( HashSet< BarcodeBehaviour.BarcodeType observedTypes,
bool  detectMultipleBarcodes 
)
inline

Creates a Barcode Behaviour

Parameters
observedTypesThe set of observable Barcode Types.
detectMultipleBarcodesFlag to indicate whether the BarcodeBehaviour should detect multiple Barcodes in parallel.
Returns
The created Barcode Behaviour

◆ CreateBehavioursFromDatabase()

IEnumerable<ObserverBehaviour> CreateBehavioursFromDatabase ( string  databasePath)
inline

Creates Behaviours from all observers in a database.

Parameters
databasePathThe path to the XML file of the database for which to load observer Behaviours. Must be either an absolute path or relative to "StreamingAssets".
Returns
A list of Behaviours extracted from the targets in the database.

◆ CreateCloudRecoBehaviour()

CloudRecoBehaviour CreateCloudRecoBehaviour ( string  accessKey,
string  secretKey 
)
inline

Creates a Cloud Recognition using auth keys. Then initializes the reco.

Returns
The CloudReco Behaviour from the provided auth keys.

◆ CreateCylinderTarget()

CylinderTargetBehaviour CreateCylinderTarget ( string  databasePath,
string  targetName 
)
inline

Creates a Cylinder Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
Returns
The Cylinder Target Behaviour created from the specified target.

◆ CreateImageTarget() [1/4]

ImageTargetBehaviour CreateImageTarget ( string  databasePath,
string  targetName 
)
inline

Creates an Image Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
Returns
The Image Target Behaviour created from the specified target.

◆ CreateImageTarget() [2/4]

ImageTargetBehaviour CreateImageTarget ( string  filePath,
float  widthInMeters,
string  targetName 
)
inline

Creates an Image Target from a path to a Unity Texture file.

Parameters
filePathThe file path of the image to be used as target. Must be either an absolute path or relative to "StreamingAssets".
widthInMetersThe real world width of the target in meters.
targetNameThe name of the resulting target.
Returns
The Image Target Behaviour from the specified file.

◆ CreateImageTarget() [3/4]

ImageTargetBehaviour CreateImageTarget ( Texture2D  texture,
float  widthInMeters,
string  targetName 
)
inline

Creates an Image Target from a Unity Texture2D.

Parameters
textureThe texture from which the new Image Target is created.
widthInMetersThe real world width of the target in meters.
targetNameThe name of the resulting target.
Returns
The Image Target Behaviour from the specified Unity Texture2D.

◆ CreateImageTarget() [4/4]

ImageTargetBehaviour CreateImageTarget ( IntPtr  texturePointer,
int  textureWidth,
int  textureHeight,
TextureFormat  format,
float  widthInMeters,
string  targetName 
)
inline

Create an Image Target using raw image data loaded by functions independent from Vuforia Engine.

Currently only unpadded image sources are correctly supported.

Parameters
texturePointerPointer to the memory location of the image buffer.
textureWidthThe width of the image in pixels.
textureHeightThe height of the image in pixels.
formatThe texture format of the image.
widthInMetersThe real world width of the target in meters.
targetNameThe name of the resulting target.
Returns
The Image Target Behaviour from the specified image buffer.

◆ CreateModelTarget() [1/2]

ModelTargetBehaviour CreateModelTarget ( string  databasePath,
string  targetName,
TrackingOptimization trackingOptimization = null 
)
inline

Creates a Model Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
trackingOptimizationOptionally specify the tracking optimization for the target.
Returns
The Model Target Behaviour created from the specified target.

◆ CreateModelTarget() [2/2]

ModelTargetBehaviour CreateModelTarget ( string  databasePath,
string  targetName,
bool  hasOcclusion,
bool  hasCollision,
TrackingOptimization trackingOptimization = null 
)
inline

Creates a Model Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
hasOcclusionSets if target will have a runtime occlusion.
hasCollisionSets if target will have a runtime collision.
trackingOptimizationOptionally specify the tracking optimization for the target.
Returns
The Model Target Behaviour created from the specified target.

◆ CreateMultiTarget()

MultiTargetBehaviour CreateMultiTarget ( string  databasePath,
string  targetName 
)
inline

Creates a Multi Target Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
Returns
The Multi Target Behaviour created from the specified target.

◆ CreateRuntimeMeshRenderingBehaviour() [1/3]

GameObject CreateRuntimeMeshRenderingBehaviour ( ModelTargetBehaviour  modelTargetBehaviour,
Material  displayMaterial 
)
inline

Create a Runtime Mesh Behaviour for the Model Target.

Parameters
modelTargetBehaviourThe Model Target whose runtime mesh should be rendered.
displayMaterialThe material used to display the runtime mesh.

◆ CreateRuntimeMeshRenderingBehaviour() [2/3]

GameObject CreateRuntimeMeshRenderingBehaviour ( AreaTargetBehaviour  areaTargetBehaviour,
Material  displayMaterial,
bool  hasCollision 
)
inline

Create a Runtime Mesh Rendering Behaviour for the Area Target.

Parameters
areaTargetBehaviourThe Area Target whose runtime mesh should be rendered.
displayMaterialThe material used to display the runtime mesh.
hasCollisionFlag to indicate if the runtime meshes should collide with other objects

◆ CreateRuntimeMeshRenderingBehaviour() [3/3]

GameObject CreateRuntimeMeshRenderingBehaviour ( AreaTargetCaptureBehaviour  areaTargetCaptureBehaviour,
Material  displayMaterial,
bool  hasCollision 
)
inline

Create a Runtime Mesh Rendering Behaviour for the Area Target Capture Behaviour.

Parameters
areaTargetCaptureBehaviourThe Area Target Capture whose runtime mesh should be rendered.
displayMaterialThe material used to display the runtime mesh.
hasCollisionFlag to indicate if the runtime meshes should collide with other objects

◆ CreateVuMarkBehaviour()

VuMarkBehaviour CreateVuMarkBehaviour ( string  databasePath,
string  targetName 
)
inline

Creates a VuMark Behaviour from a target stored in a Vuforia database.

Parameters
databasePathThe path to the XML file of the database that contains the target. Must be either an absolute path or relative to "StreamingAssets".
targetNameThe name of the target in the database.
Returns
The VuMark Behaviour created from the specified target.