Packagemetaio.tracking
Classpublic class Tracking
InheritanceTracking Inheritance flash.events.EventDispatcher

The class encapsulates metaio tracking library interface by a flash interface.



Public Methods
 MethodDefined By
  
Tracking(cameraWidth:int, cameraHeight:int, trackingDataPath:String)
Constructor
Tracking
  
Retrieve the number of defined coordinate systems defined by the loaded tracking data.
Tracking
  
getTrackingPose(cosID:uint, mirrored:Boolean):Matrix3D
Retrieve tracking values for a particular coordinate system.
Tracking
  
getTrackingValues(cosID:uint):Array
Retrieve tracking values for a particular coordinate system.
Tracking
  
initTracking(raiseEvent:Boolean = false):void
Initialize tracking for a loaded tracking data.
Tracking
  
isEnabled():Boolean
Get the state of the tracking.
Tracking
  
isInitialized():Boolean
Get the initialization state of the tracking.
Tracking
  
Tracking
  
loadTrackingData(trackingDataURL:String):void
Loading tracking data from an given URL
Tracking
  
setEnable(enable:Boolean):void
Enable / disable tracking.
Tracking
  
trackFrame(frameBuffer:ByteArray, frameWidth:int = -1, frameHeight:int = -1, channels:int = 4):int
Track one single frame.
Tracking
Constructor Detail
Tracking()Constructor
public function Tracking(cameraWidth:int, cameraHeight:int, trackingDataPath:String)

Constructor

Parameters
cameraWidth:int — width of the tracking video stream
 
cameraHeight:int — height of the tracking video stream
 
trackingDataPath:String — path to tracking data file
Method Detail
getNumberOfDefinedCOSes()method
public function getNumberOfDefinedCOSes():int

Retrieve the number of defined coordinate systems defined by the loaded tracking data.

Returns
int — Number of defined coordinate systems
getTrackingPose()method 
public function getTrackingPose(cosID:uint, mirrored:Boolean):Matrix3D

Retrieve tracking values for a particular coordinate system.

Parameters

cosID:uint — is the id of a defined coordinate system.
 
mirrored:Boolean — returned pose is mirrored

Returns
Matrix3D — Tracking values as values of a column major 4x4 matrix.
getTrackingValues()method 
public function getTrackingValues(cosID:uint):Array

Retrieve tracking values for a particular coordinate system.

Parameters

cosID:uint — is the id of a defined coordinate system.

Returns
Array — Tracking values as values of a row driven 4x4 matrix.
initTracking()method 
public function initTracking(raiseEvent:Boolean = false):void

Initialize tracking for a loaded tracking data. This function is called when downloading of tracking data is completed.

Parameters

raiseEvent:Boolean (default = false) — Event

isEnabled()method 
public function isEnabled():Boolean

Get the state of the tracking.

Returns
Boolean — True if the tracking is enabled, otherwise false.
isInitialized()method 
public function isInitialized():Boolean

Get the initialization state of the tracking.

Returns
Boolean — true if tracking is initialized, otherwise false
loadAndInitTracking()method 
public function loadAndInitTracking():void

loadTrackingData()method 
public function loadTrackingData(trackingDataURL:String):void

Loading tracking data from an given URL

Parameters

trackingDataURL:String — is the url to a tracking data

setEnable()method 
public function setEnable(enable:Boolean):void

Enable / disable tracking.

Parameters

enable:Boolean — is true for enable the tracking, otherwise false.

trackFrame()method 
public function trackFrame(frameBuffer:ByteArray, frameWidth:int = -1, frameHeight:int = -1, channels:int = 4):int

Track one single frame. Clears frameBuffer after tracking.

Parameters

frameBuffer:ByteArray — is the frameBuffer which should be processed
 
frameWidth:int (default = -1) — is the width of the frame in pixels. If not set the default value given in the constuctor is used.
 
frameHeight:int (default = -1) — is the heigth of the frame in pixels. If not set the default value given in the constuctor is used.
 
channels:int (default = 4) — is the number of color channels. If not set, it is asumed that the image type is RGBA.

Returns
int — 1 if tracking successfull otherwise 0