Vuforia Engine observes the real world through configured and activated Observers. An Observer creates Observations that represent information about a target. Observations are collected in the State.
An Observer is a component that is configured and associated with an element of the real world. This can be a target or other things, e.g., lighting conditions. An Observer could, for example, be configured to observe an image, a 3D object, an area in the user’s physical environment, or features of a scene. In many cases, the target is represented by a database that contains a digital representation of it. At runtime, the Vuforia Engine will search for any targets that you have configured and created with an Observer.
An Observation is then the information about that target that is communicated to the application through Vuforia Engine’s state. As the application is running and the Vuforia Engine observes the environment using the camera and device tracking information, Observations deliver information on the status of the tracking quality and the poses of the detected targets. This information helps you place and maintain digital content on a physical object and for making your content react to environment changes and device movement.
Unity
In Unity, Observers are represented by different ObserverBehaviour
. For instance, an ImageTargetBehaviour
observes a specific Image Target. See Getting Started with Vuforia Engine in Unity for more information about how to set up an Image Target in Unity.
Once an ObserverBehaviour
like an ImageTargetBehaviour
is created and active, it will automatically process Observations. Vuforia Engine will trigger events when the target is detected and automatically updates the position of the corresponding game object in the Unity scene. These events are, by default, processed by the DefaultObserverEventHandler
component that is attached to any ObserverBehaviour
’s game object.
The DefaultObserverEventHandler
renders augmentations when a target is actively tracked and hides them if it is not. Some configuration settings can be changed directly from the inspector of that component, and Unity events are exposed to add custom behavior.
It is also possible to replace the DefaultObserverEventHandler
with a custom event handler implementation.
For more information about the Vuforia Engine life cycle in Unity and an overview of the API, see Vuforia Engine API for Unity. See also Pose Status and Status Info for detailed information on the returned status.
Native
Observer Types
Each Vuforia feature can be identified through a unique integer constant. When getting Observations from the state, it is often helpful to filter by vuObserverGetType
and vuObservationGetType
.
VuObserverType |
Identifiable as enum values
|
Observer Management |
Identify the Observer by its type, or by its assigned unique id.
|
The Vuforia Engine manages an observer’s lifecycle. Engine functions create, destroy, activate, and deactivate Observers. See Vuforia Engine Lifecycle for more information and best practices.
Observation Types
Observations also have a type associated with them. Depending on its type, you can access a target's pose and status using vuObservationGetPoseInfo
.
For example, to get information on the status info and target info of a tracked image, you would call vuImageTargetObservationGetStatusInfo
and vuImageTargetObservationGetTargetInfo
. For some generic info types, you can query if a particular info is available, e.g., for pose info ,you can call vuObservationHasPoseInfo()
. To see what pose status and status info Observations provide, please see Status Poses and Status Info.
Access information specified by the Observation type:
VuObservationType |
Identifiable as enum values
|
Observation Management |
|