C++ Java Unity
C++ Reference
AreaTarget Class Referenceabstract

Detailed Description

A type of Trackable that represents a scanned physical environment.

Inheritance diagram for AreaTarget:
Trackable NonCopyable

Public Member Functions

virtual const char * getUniqueTargetId () const =0
 Get the persistent system-wide unique id for this target. More...
 
virtual Vec3F getSize () const =0
 Get the size of this target. More...
 
virtual const Box3DgetBoundingBox () const =0
 Get the bounding box of this target. More...
 
virtual bool setExternalPosition (const Vuforia::Vec2F &position, float radius)=0
 Set approximate position within the target from an external localization source. More...
 
virtual bool requiresExternalPositions () const =0
 Check whether the target requires external positions for initial detection. More...
 
- Public Member Functions inherited from Trackable
virtual Type getType () const =0
 Get the Type for this instance (typically a subclass of Trackable). More...
 
virtual bool isOfType (Type type) const =0
 Check whether this instance is of the given Type or any of its subclasses. More...
 
virtual int getId () const =0
 Get a unique id for this Trackable. More...
 
virtual const char * getName () const =0
 Get the name of this Trackable's name. More...
 
virtual bool setUserData (void *userData)=0
 Set user data for this Trackable. More...
 
virtual void * getUserData () const =0
 Get the user data that was previously set using setUserData(). More...
 
virtual ~Trackable ()
 

Static Public Member Functions

static Type getClassType ()
 Get the Type for class "Trackable". More...
 
- Static Public Member Functions inherited from Trackable
static Type getClassType ()
 Get the Type of class 'Trackable'. More...
 

Member Function Documentation

static Type getClassType ( )
static

Get the Type for class "Trackable".

virtual const char* getUniqueTargetId ( ) const
pure virtual

Get the persistent system-wide unique id for this target.

A target's unique id, which may be generated offline, identifies an AreaTarget across multiple Vuforia sessions. It is a property of Vuforia's model of the physical environment being tracked, and typically resides on permanent storage as part of loadable DataSet.

Note
Be careful not to confuse getUniqueTargetId() (which is persistent across Vuforia sessions) with Trackable::getId() (which is generated at runtime and not persistent).
virtual Vec3F getSize ( ) const
pure virtual

Get the size of this target.

Returns
The size of this target, in meters (width, height, depth).
virtual const Box3D& getBoundingBox ( ) const
pure virtual

Get the bounding box of this target.

Returns
An axis-aligned box that completely encloses the 3D geometry that this AreaTarget represents.
virtual bool setExternalPosition ( const Vuforia::Vec2F position,
float  radius 
)
pure virtual

Set approximate position within the target from an external localization source.

Setting up the external position only succeeds when the target is activated.

Note
The provided external position is valid until a successful localization, target deactivation, or updating the external position by a repeated call of this method (whichever happens first).
Parameters
positionPosition (x, z) in target coordinate system (which is y-up).
radiusUncertainty of the position in meters. Must be positive.
Returns
true on success, false on failure.
virtual bool requiresExternalPositions ( ) const
pure virtual

Check whether the target requires external positions for initial detection.

Large targets require external positions to provide an initial hint about which data to load. Until an external position is provided, the large target will not be detected. This is also necessary after an extended loss of tracking, e.g. after pausing the app and moving to a new location.

Note
The external position should be set using AreaTarget::setExternalPosition().
Returns
true if the target needs external positions for initial detection or after extended loss of tracking.