Tilt Five NDK  1.4.1
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
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
68typedef enum {
69 kT5_MatrixOrder_RowMajor = 1,
70 kT5_MatrixOrder_ColumnMajor = 2,
72
74typedef enum {
75 kT5_DepthRange_MinusOneToOne = 1,
76 kT5_DepthRange_ZeroToOne = 2,
78
83typedef enum {
84 kT5_CartesianCoordinateHandedness_Left = 1,
85 kT5_CartesianCoordinateHandedness_Right = 2,
87
92typedef struct T5_ContextImpl* T5_Context;
93
98typedef struct T5_GlassesImpl* T5_Glasses;
99
104typedef uint8_t T5_WandHandle;
105
107typedef enum {
110
113
116
120
121typedef enum {
125
133
134typedef struct {
137
140
144
145typedef enum {
149
154
155typedef struct {
157 void* instance;
158
161
163 void* device;
164
169 void* queue;
170
173
177
179typedef enum {
182
185
188
192
194typedef struct {
198
202
206
210
215
217typedef struct {
219 const char* applicationId;
220
223
227 uint8_t sdkType;
228
230 uint64_t reserved;
232
234typedef enum {
237
240
243
247
249typedef enum {
258
266
280typedef struct {
283
287
291
295
297typedef struct {
299 uint8_t cameraIndex;
300
304
306typedef struct {
313
320
322 uint16_t texWidth_PIX;
323
326
328 bool isSrgb;
329
332
334 struct {
335 float startX_VCI;
336 float startY_VCI;
337 float width_VCI;
338 float height_VCI;
339 } vci;
340
343
347
350
355
357typedef struct {
360 uint16_t imageWidth;
361
364 uint16_t imageHeight;
365
368 uint16_t imageStride;
369
372 uint8_t cameraIndex;
373
377
380 uint32_t bufferSize;
381
383 uint8_t* pixelData;
384
387
391
393typedef struct {
396
398
400typedef enum {
403
406
409
413
415typedef enum {
418
421
424} T5_Hand;
425
427typedef struct {
430
433
436
439
442
444 float trigger;
445
448
449 // TODO(khunt) : Determine units
451 uint8_t battery;
452
454 struct {
455 bool t5;
456 bool one;
457 bool two;
458 bool three;
459 bool a;
460 bool b;
461 bool x;
462 bool y;
463 } buttons;
464
466 //
470
473
476
479
483
485typedef struct {
488
491
494
498
500typedef enum {
504
508
510typedef enum {
513
518
520typedef struct {
522 double matrix[16];
523
526
529
532
536
T5_GraphicsApi_GL_TextureMode
Definition: types.h:121
T5_ConnectionState
Glasses connection state.
Definition: types.h:234
T5_MatrixOrder
Matrix order.
Definition: types.h:68
T5_ParamGlasses
Possible parameters that can be retrieved for glasses.
Definition: types.h:500
uint8_t T5_WandHandle
Opaque handle used with wands.
Definition: types.h:104
T5_DepthRange
Z Depth range.
Definition: types.h:74
struct T5_ContextImpl * T5_Context
Opaque handle used with system-wide functions.
Definition: types.h:92
T5_GraphicsApi
Graphics API types.
Definition: types.h:107
T5_Hand
Wand hand.
Definition: types.h:415
T5_GraphicsApi_Vulkan_TextureMode
Definition: types.h:145
T5_ParamSys
Possible parameters that can be retrieved with System-wide parameters.
Definition: types.h:510
T5_GameboardType
Possible gameboard types.
Definition: types.h:179
T5_WandStreamEventType
Wand stream event type.
Definition: types.h:400
struct T5_GlassesImpl * T5_Glasses
Opaque handle used with glasses.
Definition: types.h:98
T5_GlassesPoseUsage
Glasses pose usage indicator.
Definition: types.h:249
T5_CartesianCoordinateHandedness
Handedness of a cartesian coordinate system.
Definition: types.h:83
@ kT5_GraphicsApi_GL_TextureMode_Pair
Treat T5_FrameInfo.leftTexHandle and T5_FrameInfo.rightTexHandle as a pair of GL_TEXTURE_2D.
Definition: types.h:124
@ kT5_GraphicsApi_GL_TextureMode_Array
Treat T5_FrameInfo.leftTexHandle as a GL_TEXTURE_2D_ARRAY. T5_FrameInfo.rightTexHandle is unused.
Definition: types.h:131
@ kT5_ConnectionState_Disconnected
Glasses were previously exclusively connected, but the device has disconnected.
Definition: types.h:245
@ kT5_ConnectionState_ExclusiveConnection
Glasses are connected for exclusive use.
Definition: types.h:236
@ kT5_ConnectionState_NotExclusivelyConnected
Glasses have not been exclusively connected or reserved.
Definition: types.h:242
@ kT5_ConnectionState_ExclusiveReservation
Glasses are reserved for exclusive use.
Definition: types.h:239
@ kT5_ParamGlasses_Float_IPD
Interpupillary distance - Float, millimeters
Definition: types.h:503
@ kT5_ParamGlasses_UTF8_FriendlyName
User-facing name of the glasses - UTF8.
Definition: types.h:506
@ kT5_GraphicsApi_Vulkan
Vulkan.
Definition: types.h:118
@ kT5_GraphicsApi_None
No graphics API (for clients that don't send frames)
Definition: types.h:109
@ kT5_GraphicsApi_D3D11
Direct3D 11 (Windows Only)
Definition: types.h:115
@ kT5_GraphicsApi_GL
OpenGL.
Definition: types.h:112
@ kT5_Hand_Right
Right hand.
Definition: types.h:423
@ kT5_Hand_Unknown
Hand unknown.
Definition: types.h:417
@ kT5_Hand_Left
Left hand.
Definition: types.h:420
@ kT5_GraphicsApi_Vulkan_TextureMode_Image
Treat T5_FrameInfo.leftTexHandle and T5_FrameInfo.rightTexHandle as a pair of pointers to VkImage han...
Definition: types.h:148
@ kT5_GraphicsApi_Vulkan_TextureMode_ImageView
Treat T5_FrameInfo.leftTexHandle and T5_FrameInfo.rightTexHandle as a pair of pointers to VkImageView...
Definition: types.h:152
@ kT5_ParamSys_Integer_CPL_AttRequired
Non-zero if the control panel requires user interaction (E.g. Important firmware update) - Integer,...
Definition: types.h:516
@ kT5_ParamSys_UTF8_Service_Version
Version of the service software - UTF8.
Definition: types.h:512
@ kT5_GameboardType_LE
An LE gameboard.
Definition: types.h:184
@ kT5_GameboardType_XE
An XE gameboard, flap laid flat.
Definition: types.h:187
@ kT5_GameboardType_None
No gameboard.
Definition: types.h:181
@ kT5_GameboardType_XE_Raised
An XE gameboard, flap raised at an angle on the kickstand.
Definition: types.h:190
@ kT5_WandStreamEventType_Connect
Wand connected.
Definition: types.h:402
@ kT5_WandStreamEventType_Disconnect
Wand disconnected.
Definition: types.h:405
@ kT5_WandStreamEventType_Report
Wand report (Pose, Buttons, Trigger, Stick, Battery)
Definition: types.h:411
@ kT5_WandStreamEventType_Desync
Stream has desynchronized.
Definition: types.h:408
@ kT5_GlassesPoseUsage_GlassesPresentation
The pose will be used to render images to be presented on the glasses.
Definition: types.h:257
@ kT5_GlassesPoseUsage_SpectatorPresentation
The pose will be used to render images to be presented on a device other than the glasses,...
Definition: types.h:264
Camera Frame information to be retrieved with t5GetFilledCamImageBuffer()
Definition: types.h:357
T5_Quat rotToCAM_GBD
The rotation of the camera relative to the GBD.
Definition: types.h:389
uint8_t illuminationMode
The illumination mode for incoming frames. 0 for unknown frame. 1 for Light frames....
Definition: types.h:376
uint8_t * pixelData
The image buffer being filled by the Tilt Five service.
Definition: types.h:383
uint16_t imageHeight
The height of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:364
uint16_t imageStride
The stride of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:368
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:380
T5_Vec3 posCAM_GBD
The position of the camera relative to the GBD.
Definition: types.h:386
uint8_t cameraIndex
The index of the desired camera. 0 for tangible tracking camera, 1 for head tracking camera.
Definition: types.h:372
uint16_t imageWidth
The width of the image in the image buffer. Empty buffers should set these parameters to 0.
Definition: types.h:360
Camera stream configuration.
Definition: types.h:297
uint8_t cameraIndex
The index of the camera to be modified.
Definition: types.h:299
bool enabled
Enable or disable the camera stream. True = enabled.
Definition: types.h:302
Client provided information for use with t5CreateGlasses()
Definition: types.h:217
uint8_t sdkType
The SDK type.
Definition: types.h:227
const char * applicationId
The application ID.
Definition: types.h:219
const char * applicationVersion
The application version.
Definition: types.h:222
uint64_t reserved
RESERVED: Must be set to 0.
Definition: types.h:230
Render information to be used with t5SendFrameToGlasses()
Definition: types.h:306
T5_Quat rotToLVC_GBD
The rotation from GBD to VC, the virtual camera reference frame for the left eye.
Definition: types.h:342
void * rightTexHandle
Texture handle for the right image.
Definition: types.h:319
T5_Vec3 posLVC_GBD
The position of VC, the virtual camera reference frame, relative to GBD for the left eye.
Definition: types.h:346
bool isUpsideDown
True if the image is 'upside down'.
Definition: types.h:331
bool isSrgb
True if the texture is srgb. This is only relevant for the OpenGL graphics API.
Definition: types.h:328
T5_Vec3 posRVC_GBD
The position of VC, the virtual camera reference frame, relative to GBD for the right eye.
Definition: types.h:353
uint16_t texWidth_PIX
Width of the textures pointed to by leftTexHandle and rightTexHandle.
Definition: types.h:322
uint16_t texHeight_PIX
Height of the textures pointed to by leftTexHandle and rightTexHandle.
Definition: types.h:325
void * leftTexHandle
Texture handle for the left image.
Definition: types.h:312
T5_Quat rotToRVC_GBD
The rotation from GBD to VC, the virtual camera reference frame for the right eye.
Definition: types.h:349
Physical dimensions of a gameboard.
Definition: types.h:194
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:209
float viewableExtentPositiveZ
The distance in meters above the gameboard origin that the viewable area extends in the positive Z di...
Definition: types.h:213
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:205
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:201
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:197
Glasses pose information to be retrieved with t5GetGlassesPose()
Definition: types.h:280
uint64_t timestampNanos
The timestamp of the pose.
Definition: types.h:282
T5_Vec3 posGLS_GBD
The position of the origin of the GLS (glasses) frame relative to the GBD (gameboard) frame.
Definition: types.h:286
T5_Quat rotToGLS_GBD
The rotation that transforms points in the GBD (gameboard) frame orientation to the GLS (glasses) fra...
Definition: types.h:290
T5_GameboardType gameboardType
The type of gameboard visible for this pose.
Definition: types.h:293
T5_GraphicsApi_GL_TextureMode textureMode
Specify the interpretation of the texture handles in T5_FrameInfo.
Definition: types.h:136
uint32_t rightEyeArrayIndex
In kT5_GraphicsApi_GL_TextureMode_Array, specify the array index of the right eye.
Definition: types.h:142
uint32_t leftEyeArrayIndex
In kT5_GraphicsApi_GL_TextureMode_Array, specify the array index of the left eye.
Definition: types.h:139
void * physicalDevice
A pointer to a VkPhysicalDevice.
Definition: types.h:160
T5_GraphicsApi_Vulkan_TextureMode textureMode
Specify the interpretation of the texture handles in T5_FrameInfo.
Definition: types.h:175
void * queue
A pointer to a VkQueue.
Definition: types.h:169
void * device
A pointer to a VkDevice.
Definition: types.h:163
void * instance
A pointer to a VkInstance.
Definition: types.h:157
uint32_t queueFamilyIndex
The queue family index used to create the queue.
Definition: types.h:172
Projection parameters.
Definition: types.h:520
uint16_t framebufferWidth
Framebuffer Width.
Definition: types.h:531
uint16_t framebufferHeight
Framebuffer Height.
Definition: types.h:534
double fieldOfView
Field of View (Y Axis in Degrees)
Definition: types.h:525
double aspectRatio
Aspect Ratio.
Definition: types.h:528
Quaternion.
Definition: types.h:60
2D vector
Definition: types.h:47
3D vector
Definition: types.h:53
Contains wand related information (Pose, Buttons, Trigger, Stick, Battery)
Definition: types.h:427
bool poseValid
Validity of pose parameters. True = valid.
Definition: types.h:441
bool batteryValid
Validity of battery parameters. True = valid.
Definition: types.h:435
uint64_t timestampNanos
The timestamp of the wand event in nanoseconds.
Definition: types.h:429
uint8_t battery
Battery.
Definition: types.h:451
T5_Quat rotToWND_GBD
WND/GBD rotation unit quaternion.
Definition: types.h:469
T5_Vec3 posGrip_GBD
Position (Grip) - Vector3f.
Definition: types.h:478
float trigger
Trigger - Analog, Range [0.0 - 1.0], 1.0 = Fully depressed.
Definition: types.h:444
T5_Vec3 posAim_GBD
Position (Aim Point) - Vector3f.
Definition: types.h:472
bool analogValid
Validity of analog parameters. True = valid.
Definition: types.h:432
T5_Hand hand
Wand hand.
Definition: types.h:481
bool buttonsValid
Validity of button parameters. True = valid.
Definition: types.h:438
T5_Vec3 posFingertips_GBD
Position (Fingertips) - Vector3f.
Definition: types.h:475
T5_Vec2 stick
Stick (X/Y) - Analog, Range [-1.0 - 1.0], 0 = Centered, 1.0 = Top/Right.
Definition: types.h:447
Wand stream configuration.
Definition: types.h:393
bool enabled
Enable or disable the entire stream. True = enabled.
Definition: types.h:395
Represents an event from the wand stream.
Definition: types.h:485
uint64_t timestampNanos
The timestamp of the wand event in nanoseconds.
Definition: types.h:493
T5_WandReport report
Report (Valid if type = kT5_WandStreamEventType_Report)
Definition: types.h:496
T5_WandStreamEventType type
Type of event.
Definition: types.h:490
T5_WandHandle wandId
Opaque identifier for the wand.
Definition: types.h:487