Tilt Five NDK
types.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020-2023 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
47#define T5_MAX_GAMEBOARD_POSES (1)
48
50typedef struct {
51 float x;
52 float y;
53} T5_Vec2;
54
56typedef struct {
57 uint32_t x;
58 uint32_t y;
59} T5_Offset;
60
62typedef struct {
63 uint32_t width;
64 uint32_t height;
65} T5_Extent;
66
68typedef struct {
69 T5_Offset offset;
70 T5_Extent extent;
71} T5_Rect;
72
74typedef struct {
75 float x;
76 float y;
78
80typedef struct {
81 float width;
82 float height;
84
86typedef struct {
87 T5_Offsetf offset;
88 T5_Extentf extent;
89} T5_Rectf;
90
92typedef struct {
93 float x;
94 float y;
95 float z;
96} T5_Vec3;
97
99typedef struct {
100 float w;
101 float x;
102 float y;
103 float z;
104} T5_Quat;
105
107typedef enum {
108 kT5_MatrixOrder_RowMajor = 1,
109 kT5_MatrixOrder_ColumnMajor = 2,
111
113typedef enum {
114 kT5_DepthRange_MinusOneToOne = 1,
115 kT5_DepthRange_ZeroToOne = 2,
117
122typedef enum {
123 kT5_CartesianCoordinateHandedness_Left = 1,
124 kT5_CartesianCoordinateHandedness_Right = 2,
126
131typedef struct T5_ContextImpl* T5_Context;
132
137typedef struct T5_GlassesImpl* T5_Glasses;
138
143typedef uint8_t T5_WandHandle;
144
146typedef enum {
149
152
155
158
161
166
171
174
179
183
186typedef enum {
190
198
201typedef struct {
204
207
211
214typedef enum {
218
223
224typedef struct {
226 void* instance;
227
230
232 void* device;
233
238 void* queue;
239
242
247
248typedef struct {
250 void* device;
251
253 void* queue;
255
257typedef enum {
260
263
266
270
272typedef struct {
276
280
284
288
293
295typedef struct {
297 const char* applicationId;
298
301
305 uint8_t sdkType;
306
308 uint64_t reserved;
310
312typedef enum {
315
318
321
325
327typedef enum {
336
344
358typedef struct {
361
365
369
373
392typedef struct {
395
399
403
406
408 uint64_t id;
410
412typedef struct {
414 uint8_t cameraIndex;
415
419
421typedef struct {
428
435
437 uint16_t texWidth_PIX;
438
441
443 bool isSrgb;
444
447
449 struct {
450 float startX_VCI;
451 float startY_VCI;
452 float width_VCI;
453 float height_VCI;
454 } vci;
455
458
462
465
470
471typedef struct {
472 struct {
478 void* texture;
479
485
487 uint16_t arraySize;
488 } texture;
489
490 struct {
495
499 uint16_t arrayIndex;
500 } subImage;
501
506 int64_t format;
507
511
513typedef struct {
516 uint16_t imageWidth;
517
520 uint16_t imageHeight;
521
524 uint16_t imageStride;
525
528 uint8_t cameraIndex;
529
533
536 uint32_t bufferSize;
537
539 uint8_t* pixelData;
540
543
547
548typedef struct {
553
559
562 uint8_t cameraIndex;
564
566typedef struct {
569
571
573typedef enum {
576
579
582
586
588typedef enum {
591
594
597} T5_Hand;
598
600typedef struct {
603
606
609
612
615
617 float trigger;
618
621
622 // TODO(khunt) : Determine units
624 uint8_t battery;
625
627 struct {
628 bool t5;
629 bool one;
630 bool two;
631 bool three;
632 bool a;
633 bool b;
634 bool x;
635 bool y;
636 } buttons;
637
643
646
649
652
656
658typedef struct {
661
664
667
671
673typedef enum {
677
681
683typedef enum {
686
691
693typedef struct {
695 double matrix[16];
696
699
702
705
709
T5_GraphicsApi_GL_TextureMode
Used by T5_GraphicsContextGL to specify interpretation of texture handles Note that this is not used ...
Definition: types.h:186
T5_ConnectionState
Glasses connection state.
Definition: types.h:312
T5_MatrixOrder
Matrix order.
Definition: types.h:107
T5_ParamGlasses
Possible parameters that can be retrieved for glasses.
Definition: types.h:673
uint8_t T5_WandHandle
Opaque handle used with wands.
Definition: types.h:143
T5_DepthRange
Z Depth range.
Definition: types.h:113
struct T5_ContextImpl * T5_Context
Opaque handle used with system-wide functions.
Definition: types.h:131
T5_GraphicsApi
Graphics API types.
Definition: types.h:146
T5_Hand
Wand hand.
Definition: types.h:588
T5_GraphicsApi_Vulkan_TextureMode
Used by T5_GraphicsApi_Vulkan_TextureMode to specify interpretation of texture handles Note that this...
Definition: types.h:214
T5_ParamSys
Possible parameters that can be retrieved with System-wide parameters.
Definition: types.h:683
T5_GameboardType
Possible gameboard types.
Definition: types.h:257
T5_WandStreamEventType
Wand stream event type.
Definition: types.h:573
struct T5_GlassesImpl * T5_Glasses
Opaque handle used with glasses.
Definition: types.h:137
T5_GlassesPoseUsage
Glasses pose usage indicator.
Definition: types.h:327
T5_CartesianCoordinateHandedness
Handedness of a cartesian coordinate system.
Definition: types.h:122
@ kT5_GraphicsApi_GL_TextureMode_Pair
Treat T5_FrameInfo.leftTexHandle and T5_FrameInfo.rightTexHandle as a pair of GL_TEXTURE_2D.
Definition: types.h:189
@ kT5_GraphicsApi_GL_TextureMode_Array
Treat T5_FrameInfo.leftTexHandle as a GL_TEXTURE_2D_ARRAY. T5_FrameInfo.rightTexHandle is unused.
Definition: types.h:196
@ kT5_ConnectionState_Disconnected
Glasses were previously exclusively connected, but the device has disconnected.
Definition: types.h:323
@ kT5_ConnectionState_ExclusiveConnection
Glasses are connected for exclusive use.
Definition: types.h:314
@ kT5_ConnectionState_NotExclusivelyConnected
Glasses have not been exclusively connected or reserved.
Definition: types.h:320
@ kT5_ConnectionState_ExclusiveReservation
Glasses are reserved for exclusive use.
Definition: types.h:317
@ kT5_ParamGlasses_Float_IPD
Interpupillary distance - Float, millimeters
Definition: types.h:676
@ kT5_ParamGlasses_UTF8_FriendlyName
User-facing name of the glasses - UTF8.
Definition: types.h:679
@ kT5_GraphicsApi_Vulkan
Vulkan.
Definition: types.h:157
@ kT5_GraphicsApi_None
No graphics API (for clients that don't send frames)
Definition: types.h:148
@ kT5_GraphicsApi_GL_TI
OpenGL (With T5_TextureInfo textures)
Definition: types.h:170
@ kT5_GraphicsApi_Vulkan_TI
Vulkan (With T5_TextureInfo textures)
Definition: types.h:178
@ kT5_GraphicsApi_D3D12
Direct3D 12 (Windows Only)
Definition: types.h:160
@ kT5_GraphicsApi_D3D11
Direct3D 11 (Windows Only)
Definition: types.h:154
@ kT5_GraphicsApi_D3D12_TI
Direct3D 12 (With T5_TextureInfo textures) (Windows Only)
Definition: types.h:181
@ kT5_GraphicsApi_GL
OpenGL.
Definition: types.h:151
@ kT5_GraphicsApi_D3D11_TI
Direct3D 11 (With T5_TextureInfo textures) (Windows Only)
Definition: types.h:173
@ kT5_Hand_Right
Right hand.
Definition: types.h:596
@ kT5_Hand_Unknown
Hand unknown.
Definition: types.h:590
@ kT5_Hand_Left
Left hand.
Definition: types.h:593
@ kT5_GraphicsApi_Vulkan_TextureMode_Image
Treat T5_FrameInfo.leftTexHandle and T5_FrameInfo.rightTexHandle as a pair of pointers to VkImage han...
Definition: types.h:217
@ kT5_GraphicsApi_Vulkan_TextureMode_ImageView
Treat T5_FrameInfo.leftTexHandle and T5_FrameInfo.rightTexHandle as a pair of pointers to VkImageView...
Definition: types.h:221
@ kT5_ParamSys_Integer_CPL_AttRequired
Non-zero if the control panel requires user interaction (E.g. Important firmware update) - Integer,...
Definition: types.h:689
@ kT5_ParamSys_UTF8_Service_Version
Version of the service software - UTF8.
Definition: types.h:685
@ kT5_GameboardType_LE
An LE gameboard.
Definition: types.h:262
@ kT5_GameboardType_XE
An XE gameboard, flap laid flat.
Definition: types.h:265
@ kT5_GameboardType_None
No gameboard.
Definition: types.h:259
@ kT5_GameboardType_XE_Raised
An XE gameboard, flap raised at an angle on the kickstand.
Definition: types.h:268
@ kT5_WandStreamEventType_Connect
Wand connected.
Definition: types.h:575
@ kT5_WandStreamEventType_Disconnect
Wand disconnected.
Definition: types.h:578
@ kT5_WandStreamEventType_Report
Wand report (Pose, Buttons, Trigger, Stick, Battery)
Definition: types.h:584
@ kT5_WandStreamEventType_Desync
Stream has desynchronized.
Definition: types.h:581
@ kT5_GlassesPoseUsage_GlassesPresentation
The pose will be used to render images to be presented on the glasses.
Definition: types.h:335
@ kT5_GlassesPoseUsage_SpectatorPresentation
The pose will be used to render images to be presented on a device other than the glasses,...
Definition: types.h:342
2D vector
Definition: types.h:50
An integer cartesian offset.
Definition: types.h:56
An integer width and height.
Definition: types.h:62
A rectangle in integer cartesian coordinates.
Definition: types.h:68
An integer cartesian offset.
Definition: types.h:74
An integer width and height.
Definition: types.h:80
A rectangle in floating point cartesian coordinates.
Definition: types.h:86
3D vector
Definition: types.h:92
Quaternion.
Definition: types.h:99
Context for use with kT5_GraphicsApi_GL Note that this is not used by kT5_GraphicsApi_GL_TI.
Definition: types.h:201
T5_GraphicsApi_GL_TextureMode textureMode
Specify the interpretation of the texture handles in T5_FrameInfo.
Definition: types.h:203
uint32_t rightEyeArrayIndex
In kT5_GraphicsApi_GL_TextureMode_Array, specify the array index of the right eye.
Definition: types.h:209
uint32_t leftEyeArrayIndex
In kT5_GraphicsApi_GL_TextureMode_Array, specify the array index of the left eye.
Definition: types.h:206
void * physicalDevice
VkPhysicalDevice handle.
Definition: types.h:229
T5_GraphicsApi_Vulkan_TextureMode textureMode
Specify the interpretation of the texture handles in T5_FrameInfo Note that this is not used by kT5_G...
Definition: types.h:245
void * queue
VkQueue handle.
Definition: types.h:238
void * device
VkDevice handle.
Definition: types.h:232
void * instance
VkInstance handle.
Definition: types.h:226
uint32_t queueFamilyIndex
The queue family index used to create the queue.
Definition: types.h:241
void * queue
A pointer to a ID3D12CommandQueue.
Definition: types.h:253
void * device
A pointer to a ID3D12Device.
Definition: types.h:250
Physical dimensions of a gameboard.
Definition: types.h:272
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:287
float viewableExtentPositiveZ
The distance in meters above the gameboard origin that the viewable area extends in the positive Z di...
Definition: types.h:291
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:283
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:279
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:275
Client provided information for use with t5CreateGlasses()
Definition: types.h:295
uint8_t sdkType
The SDK type.
Definition: types.h:305
const char * applicationId
The application ID.
Definition: types.h:297
const char * applicationVersion
The application version.
Definition: types.h:300
uint64_t reserved
RESERVED: Must be set to 0.
Definition: types.h:308
Glasses pose information to be retrieved with t5GetGlassesPose()
Definition: types.h:358
uint64_t timestampNanos
The timestamp of the pose.
Definition: types.h:360
T5_GameboardType gameboardType
The type of gameboard visible for this pose.
Definition: types.h:371
T5_Quat rotToGLS_STAGE
The rotation that transforms points in the STAGE frame orientation to the GLS (glasses) frame orienta...
Definition: types.h:368
T5_Vec3 posGLS_STAGE
The position of the origin of the GLS (glasses) frame relative to the STAGE frame.
Definition: types.h:364
Gameboard pose information to be retrieved by enumerating the output of t5GetGameboardPoses()
Definition: types.h:392
T5_Vec3 posBOARD_STAGE
The position of the origin of the BOARD (gameboard) frame relative to the STAGE frame.
Definition: types.h:398
uint64_t id
The id of this gameboard pose.
Definition: types.h:408
T5_Quat rotToBOARD_STAGE
The rotation that transforms points in the STAGE frame orientation to the BOARD (gameboard) frame ori...
Definition: types.h:402
T5_GameboardType gameboardType
The type of gameboard represented by this pose.
Definition: types.h:405
uint64_t timestampNanos
The timestamp of the pose.
Definition: types.h:394
Camera stream configuration.
Definition: types.h:412
uint8_t cameraIndex
The index of the camera to be modified.
Definition: types.h:414
bool enabled
Enable or disable the camera stream. True = enabled.
Definition: types.h:417
Render information to be used with t5SendFrameToGlasses()
Definition: types.h:421
void * rightTexHandle
Texture handle for the right image.
Definition: types.h:434
T5_Vec3 posLVC_STAGE
The position of VC, the virtual camera reference frame, relative to STAGE for the left eye.
Definition: types.h:461
T5_Quat rotToLVC_STAGE
The rotation from STAGE to VC, the virtual camera reference frame for the left eye.
Definition: types.h:457
bool isUpsideDown
True if the image is 'upside down'.
Definition: types.h:446
bool isSrgb
True if the texture is srgb. This is only relevant for the OpenGL graphics API.
Definition: types.h:443
T5_Quat rotToRVC_STAGE
The rotation from STAGE to VC, the virtual camera reference frame for the right eye.
Definition: types.h:464
T5_Vec3 posRVC_STAGE
The position of VC, the virtual camera reference frame, relative to STAGE for the right eye.
Definition: types.h:468
uint16_t texWidth_PIX
Width of the textures pointed to by leftTexHandle and rightTexHandle.
Definition: types.h:437
uint16_t texHeight_PIX
Height of the textures pointed to by leftTexHandle and rightTexHandle.
Definition: types.h:440
void * leftTexHandle
Texture handle for the left image.
Definition: types.h:427
void * texture
Texture handle.
Definition: types.h:478
int64_t format
The graphics API specific format used to create this texture.
Definition: types.h:506
T5_Rect rect
A rectangle defining which part of the texture is used.
Definition: types.h:494
uint16_t arraySize
The array size of array based textures.
Definition: types.h:487
uint16_t arrayIndex
For array textures, the index of the array to use.
Definition: types.h:499
T5_Extent dimensions
The dimensions of the texture.
Definition: types.h:484
T5_Rectf vci
The image rectangle in the normalized (z=1) image space of the virtual cameras.
Definition: types.h:509
Camera Frame information to be retrieved with t5GetFilledCamImageBuffer()
Definition: types.h:513
uint8_t illuminationMode
The illumination mode for incoming frames. 0 for unknown frame. 1 for Light frames....
Definition: types.h:532
uint8_t * pixelData
The image buffer being filled by the Tilt Five service.
Definition: types.h:539
uint16_t imageHeight
The height of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:520
uint16_t imageStride
The stride of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:524
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:536
T5_Quat rotToCAM_STAGE
The rotation of the camera relative to the STAGE.
Definition: types.h:545
uint8_t cameraIndex
The index of the desired camera. 0 for tangible tracking camera, 1 for head tracking camera.
Definition: types.h:528
T5_Vec3 posCAM_STAGE
The position of the camera relative to the STAGE.
Definition: types.h:542
uint16_t imageWidth
The width of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:516
T5_Vec2 pixelCoord_PIX
The position of the pixel in PIX space. This space is defined as the warped image space that comes as...
Definition: types.h:552
uint8_t cameraIndex
The index of the camera the pixel coordinate came from. 0 for tangible tracking camera,...
Definition: types.h:562
T5_Vec2 pixelCoord_IMG
The dewarped position of the pixel in IMG space. This space is defined as the dewarped imaged space a...
Definition: types.h:558
Wand stream configuration.
Definition: types.h:566
bool enabled
Enable or disable the entire stream. True = enabled.
Definition: types.h:568
Contains wand related information (Pose, Buttons, Trigger, Stick, Battery)
Definition: types.h:600
bool poseValid
Validity of pose parameters. True = valid.
Definition: types.h:614
bool batteryValid
Validity of battery parameters. True = valid.
Definition: types.h:608
uint64_t timestampNanos
The timestamp of the wand event in nanoseconds.
Definition: types.h:602
uint8_t battery
Battery.
Definition: types.h:624
T5_Vec3 posGrip_STAGE
Position (Grip) - Vector3f.
Definition: types.h:651
float trigger
Trigger - Analog, Range [0.0 - 1.0], 1.0 = Fully depressed.
Definition: types.h:617
bool analogValid
Validity of analog parameters. True = valid.
Definition: types.h:605
T5_Hand hand
Wand hand.
Definition: types.h:654
bool buttonsValid
Validity of button parameters. True = valid.
Definition: types.h:611
T5_Quat rotToWND_STAGE
WND/STAGE rotation unit quaternion.
Definition: types.h:642
T5_Vec2 stick
Stick (X/Y) - Analog, Range [-1.0 - 1.0], 0 = Centered, 1.0 = Top/Right.
Definition: types.h:620
T5_Vec3 posAim_STAGE
Position (Aim Point) - Vector3f.
Definition: types.h:645
T5_Vec3 posFingertips_STAGE
Position (Fingertips) - Vector3f.
Definition: types.h:648
Represents an event from the wand stream.
Definition: types.h:658
uint64_t timestampNanos
The timestamp of the wand event in nanoseconds.
Definition: types.h:666
T5_WandReport report
Report (Valid if type = kT5_WandStreamEventType_Report)
Definition: types.h:669
T5_WandStreamEventType type
Type of event.
Definition: types.h:663
T5_WandHandle wandId
Opaque identifier for the wand.
Definition: types.h:660
Projection parameters.
Definition: types.h:693
uint16_t framebufferWidth
Framebuffer Width.
Definition: types.h:704
uint16_t framebufferHeight
Framebuffer Height.
Definition: types.h:707
double fieldOfView
Field of View (Y Axis in Degrees)
Definition: types.h:698
double aspectRatio
Aspect Ratio.
Definition: types.h:701