tangible_tracker.h contains the primary API of the tangible engine.
#define DLLAPI __declspec( dllimport )
typedef __int32 touch_id_t
TE_Init must be called before any other Tangible Engine functions.
TE_Deinit()
DLLAPI int0 otherwise.
function deinit()
true for success and false otherwise.
TE_GetPatterns (TE_Pattern *patterns, int *count)
DLLAPI void[out] patterns The location to store the retrieved patterns.[in, out] count The maximum number of patterns that can be stored at patterns. The maximum number of patterns that can be stored at patterns. After calling this function count will store the number of patterns copied.
TE_GetPatternsFromFile (TE_Pattern *patterns, int *count, char *filename)
DLLAPI int[out] patterns The location to store the patterns read.[in, out] count The maximum number of patterns that can be stored at patterns. After calling this function count will store the number of patterns read.[in] filename The path of the patterns file.0 otherwise.TE_ProcessTouchEvent.
TE_GetTangibles (TE_Tangible *tangibles, int *tangible_count)
DLLAPI void[out] tangibles An array where the tangibles should be stored.[in, out] tangible_count The number of elements that can be stored in tangibles. After the function returns the value pointed to by count is the number of currently tracked tangibles.
function getTangibles()
TE_Tangible.
TE_Init()
DLLAPI int
function init()
true for success and false otherwise.
TE_IsTouchPointOwned (touch_id_t touch_id)
DLLAPI inttouch_id The id of a touch point.A non-zero value if the touch point is owned by a tangible and 0 otherwise.
function isTouchPointOwned(touch_id)
true if the touch point is owned and false otherwise..WM_POINTER* API, this function should be called on WM_POINTERENTER, WM_POINTERLEAVE, and WM_POINTERUPDATE with down taking values of 1, 0, and 0 respectively. The coordinate system used by the tangible engine and tangible configuration tool have the x axis pointing to the right and the y axis pointing down. All touch events passed to the Tangible Engine must be specified in a coordinate system following this convention.
TE_ProcessTouchEvent (int down, touch_id_t touch_id, float touch_x, float touch_y)
DLLAPI voiddown A non zero value indicates that a touch point is down, the value 0 indicates the touchpoint was released.touch_id A unique number identifying the touchpoint.touch_x The x coordinate in pixels of the touchpoint.touch_y The y coordinate in pixels of the touchpoint.
function processTouchEvent(down, touch_id, touch_x, touch_y)
true for success and false otherwise.
TE_SetPatterns (const TE_Pattern *patterns, int count)
DLLAPI void[in] patterns The new patterns.count The number of patterns stored at patterns.tangible_trainer/TangibleApp.exe
TE_SetPatternsFromFile (char *filename)
DLLAPI int[in] filename The path of the patterns file.
function setPatternsFromFile(filename)
true for success and false otherwise.
TE_WritePatternsToFile (TE_Pattern *patterns, int count, char *filename)
DLLAPI int[out] patterns The location to store the patterns read.count The maximum number of patterns that can be stored at patterns. After calling this function count will store the number of patterns read.[in] patterns The path of the patterns file.
#ifndef TANGIBLE_TRACKER_H
#define TANGIBLE_TRACKER_H
typedef __int32 touch_id_t;
#pragma pack(push, 1)
typedef struct
{
int id;
float x;
float y;
float angle;
char name[128];
} TE_Tangible;
typedef union {
struct { float x, y; };
float e[2];
} TE_Point;
typedef struct {
TE_Point points[8];
int num_points;
char name[128];
} TE_Pattern;
#pragma pack(pop)
#ifdef _WINDLL
#define DLLAPI __declspec( dllexport )
#else
#define DLLAPI __declspec( dllimport )
#endif
#ifdef __cplusplus
extern "C" {
#endif
DLLAPI void TE_SetPatterns(const TE_Pattern *patterns, int count);
DLLAPI int TE_SetPatternsFromFile(char *filename);
DLLAPI void TE_GetPatterns(TE_Pattern *patterns, int *count);
DLLAPI int TE_GetPatternsFromFile(TE_Pattern *patterns, int *count, char *filename);
DLLAPI int TE_WritePatternsToFile(TE_Pattern *patterns, int count, char *filename);
DLLAPI int TE_Init();
DLLAPI int TE_Deinit();
DLLAPI void TE_ProcessTouchEvent(int down, touch_id_t touch_id, float touch_x, float touch_y);
DLLAPI void TE_GetTangibles(TE_Tangible *tangibles, int *tangible_count);
DLLAPI int TE_IsTouchPointOwned(touch_id_t touch_id);
#ifdef __cplusplus
}
#endif
#endif