Tilt Five NDK
types.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020-2022 Tilt Five, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
21
22#ifndef __cplusplus
23#include <stdbool.h>
24#include <stdint.h>
25#else
26#include <cstdint>
27#endif
28
32
36
38#define T5_MAX_STRING_PARAM_LEN (260)
39
41#define T5_MIN_CAM_IMAGE_BUFFER_WIDTH (768)
42
44#define T5_MIN_CAM_IMAGE_BUFFER_HEIGHT (600)
45
47typedef struct {
48 float x;
49 float y;
50} T5_Vec2;
51
53typedef struct {
54 float x;
55 float y;
56 float z;
57} T5_Vec3;
58
60typedef struct {
61 float w;
62 float x;
63 float y;
64 float z;
65} T5_Quat;
66
71typedef struct T5_ContextImpl* T5_Context;
72
77typedef struct T5_GlassesImpl* T5_Glasses;
78
83typedef uint8_t T5_WandHandle;
84
86typedef enum {
89
92
96
98typedef enum {
101
104
107
111
113typedef struct {
117
121
125
129
134
136typedef struct {
138 const char* applicationId;
139
142
146 uint8_t sdkType;
147
149 uint64_t reserved;
151
153typedef enum {
156
159
162
166
168typedef enum {
177
185
199typedef struct {
202
206
210
214
216typedef struct {
218 uint8_t cameraIndex;
219
223
225typedef struct {
232
239
241 uint16_t texWidth_PIX;
242
245
247 bool isSrgb;
248
251
253 struct {
254 float startX_VCI;
255 float startY_VCI;
256 float width_VCI;
257 float height_VCI;
258 } vci;
259
262
266
269
274
276typedef struct {
279 uint16_t imageWidth;
280
283 uint16_t imageHeight;
284
287 uint16_t imageStride;
288
291 uint8_t cameraIndex;
292
296
299 uint32_t bufferSize;
300
302 uint8_t* pixelData;
303
306
310
312typedef struct {
315
317
319typedef enum {
322
325
328
332
334typedef enum {
337
340
343} T5_Hand;
344
346typedef struct {
349
352
355
358
361
363 float trigger;
364
367
368 // TODO(khunt) : Determine units
370 uint8_t battery;
371
373 struct {
374 bool t5;
375 bool one;
376 bool two;
377 bool three;
378 bool a;
379 bool b;
380 bool x;
381 bool y;
382 } buttons;
383
385 //
389
392
395
398
402
404typedef struct {
407
410
413
417
419typedef enum {
423
427
429typedef enum {
432
437
T5_ConnectionState
Glasses connection state.
Definition: types.h:153
T5_ParamGlasses
Possible parameters that can be retrieved for glasses.
Definition: types.h:419
uint8_t T5_WandHandle
Opaque handle used with wands.
Definition: types.h:83
struct T5_ContextImpl * T5_Context
Opaque handle used with system-wide functions.
Definition: types.h:71
T5_GraphicsApi
Graphics API types.
Definition: types.h:86
T5_Hand
Wand hand.
Definition: types.h:334
T5_ParamSys
Possible parameters that can be retrieved with System-wide parameters.
Definition: types.h:429
T5_GameboardType
Possible gameboard types.
Definition: types.h:98
T5_WandStreamEventType
Wand stream event type.
Definition: types.h:319
struct T5_GlassesImpl * T5_Glasses
Opaque handle used with glasses.
Definition: types.h:77
T5_GlassesPoseUsage
Glasses pose usage indicator.
Definition: types.h:168
@ kT5_ConnectionState_Disconnected
Glasses were previously exclusively connected, but the device has disconnected.
Definition: types.h:164
@ kT5_ConnectionState_ExclusiveConnection
Glasses are connected for exclusive use.
Definition: types.h:155
@ kT5_ConnectionState_NotExclusivelyConnected
Glasses have not been exclusively connected or reserved.
Definition: types.h:161
@ kT5_ConnectionState_ExclusiveReservation
Glasses are reserved for exclusive use.
Definition: types.h:158
@ kT5_ParamGlasses_Float_IPD
Interpupillary distance - Float, millimeters
Definition: types.h:422
@ kT5_ParamGlasses_UTF8_FriendlyName
User-facing name of the glasses - UTF8.
Definition: types.h:425
@ kT5_GraphicsApi_None
No graphics API (for clients that don't send frames)
Definition: types.h:88
@ kT5_GraphicsApi_D3D11
Direct3D 11 (Windows Only)
Definition: types.h:94
@ kT5_GraphicsApi_GL
OpenGL.
Definition: types.h:91
@ kT5_Hand_Right
Right hand.
Definition: types.h:342
@ kT5_Hand_Unknown
Hand unknown.
Definition: types.h:336
@ kT5_Hand_Left
Left hand.
Definition: types.h:339
@ kT5_ParamSys_Integer_CPL_AttRequired
Non-zero if the control panel requires user interaction (E.g. Important firmware update) - Integer,...
Definition: types.h:435
@ kT5_ParamSys_UTF8_Service_Version
Version of the service software - UTF8.
Definition: types.h:431
@ kT5_GameboardType_LE
An LE gameboard.
Definition: types.h:103
@ kT5_GameboardType_XE
An XE gameboard, flap laid flat.
Definition: types.h:106
@ kT5_GameboardType_None
No gameboard.
Definition: types.h:100
@ kT5_GameboardType_XE_Raised
An XE gameboard, flap raised at an angle on the kickstand.
Definition: types.h:109
@ kT5_WandStreamEventType_Connect
Wand connected.
Definition: types.h:321
@ kT5_WandStreamEventType_Disconnect
Wand disconnected.
Definition: types.h:324
@ kT5_WandStreamEventType_Report
Wand report (Pose, Buttons, Trigger, Stick, Battery)
Definition: types.h:330
@ kT5_WandStreamEventType_Desync
Stream has desynchronized.
Definition: types.h:327
@ kT5_GlassesPoseUsage_GlassesPresentation
The pose will be used to render images to be presented on the glasses.
Definition: types.h:176
@ kT5_GlassesPoseUsage_SpectatorPresentation
The pose will be used to render images to be presented on a device other than the glasses,...
Definition: types.h:183
2D vector
Definition: types.h:47
3D vector
Definition: types.h:53
Quaternion.
Definition: types.h:60
Physical dimensions of a gameboard.
Definition: types.h:113
float viewableExtentNegativeY
The distance in meters from the gameboard origin to the edge of the viewable area in the negative Y d...
Definition: types.h:128
float viewableExtentPositiveZ
The distance in meters above the gameboard origin that the viewable area extends in the positive Z di...
Definition: types.h:132
float viewableExtentPositiveY
The distance in meters from the gameboard origin to the edge of the viewable area in the positive Y d...
Definition: types.h:124
float viewableExtentNegativeX
The distance in meters from the gameboard origin to the edge of the viewable area in the negative X d...
Definition: types.h:120
float viewableExtentPositiveX
The distance in meters from the gameboard origin to the edge of the viewable area in the positive X d...
Definition: types.h:116
Client provided information for use with t5CreateGlasses()
Definition: types.h:136
uint8_t sdkType
The SDK type.
Definition: types.h:146
const char * applicationId
The application ID.
Definition: types.h:138
const char * applicationVersion
The application version.
Definition: types.h:141
uint64_t reserved
RESERVED: Must be set to 0.
Definition: types.h:149
Glasses pose information to be retrieved with t5GetGlassesPose()
Definition: types.h:199
uint64_t timestampNanos
The timestamp of the pose.
Definition: types.h:201
T5_Vec3 posGLS_GBD
The position of the origin of the GLS (glasses) frame relative to the GBD (gameboard) frame.
Definition: types.h:205
T5_Quat rotToGLS_GBD
The rotation that transforms points in the GBD (gameboard) frame orientation to the GLS (glasses) fra...
Definition: types.h:209
T5_GameboardType gameboardType
The type of gameboard visible for this pose.
Definition: types.h:212
Camera stream configuration.
Definition: types.h:216
uint8_t cameraIndex
The index of the camera to be modified.
Definition: types.h:218
bool enabled
Enable or disable the camera stream. True = enabled.
Definition: types.h:221
Render information to be used with t5SendFrameToGlasses()
Definition: types.h:225
T5_Quat rotToLVC_GBD
The rotation from GBD to VC, the virtual camera reference frame for the left eye.
Definition: types.h:261
void * rightTexHandle
Texture handle for the right image.
Definition: types.h:238
T5_Vec3 posLVC_GBD
The position of VC, the virtual camera reference frame, relative to GBD for the left eye.
Definition: types.h:265
bool isUpsideDown
True if the image is 'upside down'.
Definition: types.h:250
bool isSrgb
True if the texture is srgb. This is only relevant for the OpenGL graphics API.
Definition: types.h:247
T5_Vec3 posRVC_GBD
The position of VC, the virtual camera reference frame, relative to GBD for the right eye.
Definition: types.h:272
uint16_t texWidth_PIX
Width of the textures pointed to by leftTexHandle and rightTexHandle.
Definition: types.h:241
uint16_t texHeight_PIX
Height of the textures pointed to by leftTexHandle and rightTexHandle.
Definition: types.h:244
void * leftTexHandle
Texture handle for the left image.
Definition: types.h:231
T5_Quat rotToRVC_GBD
The rotation from GBD to VC, the virtual camera reference frame for the right eye.
Definition: types.h:268
Camera Frame information to be retrieved with t5GetFilledCamImageBuffer()
Definition: types.h:276
T5_Quat rotToCAM_GBD
The rotation of the camera relative to the GBD.
Definition: types.h:308
uint8_t illuminationMode
The illumination mode for incoming frames. 0 for unknown frame. 1 for Light frames....
Definition: types.h:295
uint8_t * pixelData
The image buffer being filled by the Tilt Five service.
Definition: types.h:302
uint16_t imageHeight
The height of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:283
uint16_t imageStride
The stride of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:287
uint32_t bufferSize
The total size of the provided image buffer. Must be at least T5_MIN_CAM_IMAGE_BUFFER_WIDTH * T5_MIN_...
Definition: types.h:299
T5_Vec3 posCAM_GBD
The position of the camera relative to the GBD.
Definition: types.h:305
uint8_t cameraIndex
The index of the desired camera. 0 for tangible tracking camera, 1 for head tracking camera.
Definition: types.h:291
uint16_t imageWidth
The width of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:279
Wand stream configuration.
Definition: types.h:312
bool enabled
Enable or disable the entire stream. True = enabled.
Definition: types.h:314
Contains wand related information (Pose, Buttons, Trigger, Stick, Battery)
Definition: types.h:346
bool poseValid
Validity of pose parameters. True = valid.
Definition: types.h:360
bool batteryValid
Validity of battery parameters. True = valid.
Definition: types.h:354
uint64_t timestampNanos
The timestamp of the wand event in nanoseconds.
Definition: types.h:348
uint8_t battery
Battery.
Definition: types.h:370
T5_Quat rotToWND_GBD
WND/GBD rotation unit quaternion.
Definition: types.h:388
T5_Vec3 posGrip_GBD
Position (Grip) - Vector3f.
Definition: types.h:397
float trigger
Trigger - Analog, Range [0.0 - 1.0], 1.0 = Fully depressed.
Definition: types.h:363
T5_Vec3 posAim_GBD
Position (Aim Point) - Vector3f.
Definition: types.h:391
bool analogValid
Validity of analog parameters. True = valid.
Definition: types.h:351
T5_Hand hand
Wand hand.
Definition: types.h:400
bool buttonsValid
Validity of button parameters. True = valid.
Definition: types.h:357
T5_Vec3 posFingertips_GBD
Position (Fingertips) - Vector3f.
Definition: types.h:394
T5_Vec2 stick
Stick (X/Y) - Analog, Range [-1.0 - 1.0], 0 = Centered, 1.0 = Top/Right.
Definition: types.h:366
Represents an event from the wand stream.
Definition: types.h:404
uint64_t timestampNanos
The timestamp of the wand event in nanoseconds.
Definition: types.h:412
T5_WandReport report
Report (Valid if type = kT5_WandStreamEventType_Report)
Definition: types.h:415
T5_WandStreamEventType type
Type of event.
Definition: types.h:409
T5_WandHandle wandId
Opaque identifier for the wand.
Definition: types.h:406