Represents an instance of Tilt Five™ glasses. More...
#include <TiltFiveNative.hpp>
Public Member Functions | |
auto | getHandle () const -> T5_Glasses |
Obtain the C handle for this glasses object. More... | |
auto | getIdentifier () const -> std::string |
Obtain a hardware (not user facing) identifier for the glasses. More... | |
auto | getConnectionState () -> Result< ConnectionState > |
Get the current connection state of the glasses. More... | |
auto | getProjectionInfo (T5_CartesianCoordinateHandedness handedness, T5_DepthRange depthRange, T5_MatrixOrder matrixOrder, double nearPlane, double farPlane, double worldScale) -> Result< T5_ProjectionInfo > |
Get projection properties for glasses. More... | |
auto | getChangedParams () -> Result< std::vector< T5_ParamGlasses > > |
Get a system-wide list of changed parameters. More... | |
auto | getIpd () -> Result< double > |
Get the current IPD setting for this glasses. More... | |
auto | getFriendlyName () -> Result< std::string > |
Get the user-facing name of the glasses. More... | |
auto | reserve (const std::string &displayName) -> Result< void > |
Reserve glasses for exclusive operations by the client. More... | |
auto | ensureReady () -> Result< void > |
Ensure that reserved glasses are ready for exclusive operations. More... | |
auto | release () -> Result< void > |
Release previously-reserved glasses. More... | |
auto | getLatestGlassesPose (T5_GlassesPoseUsage usage) -> Result< T5_GlassesPose > |
Get the latest pose for this glasses. More... | |
auto | initGraphicsContext (T5_GraphicsApi graphicsApi, void *graphicsContext) -> Result< void > |
Initialize the glasses for graphics operations. More... | |
auto | configureCameraStream (T5_CameraStreamConfig config) -> Result< void > |
Configure the wand event stream. More... | |
auto | getFilledCamImageBuffer () -> Result< T5_CamImage > |
Get the latest camera image for this glasses. More... | |
auto | submitEmptyCamImageBuffer (T5_CamImage *imgBuffer) -> Result< void > |
Submit a buffer to the camera image stream to hold Camera Frame data. More... | |
auto | cancelCamImageBuffer (uint8_t *buffer) -> Result< void > |
Cancel an image buffer in use by the service for freeing. More... | |
auto | sendFrame (const T5_FrameInfo *const frameInfo) -> Result< void > |
Send a frame to display on the glasses. More... | |
auto | sendImpulse (T5_WandHandle handle, float amplitude, uint16_t duration) -> Result< void > |
Send a Haptic Impulse to a wand. More... | |
auto | listWands () -> Result< std::vector< T5_WandHandle > > |
Obtain a list of connected wands. More... | |
auto | configureWandStream (const T5_WandStreamConfig *const config) -> Result< void > |
Configure the wand event stream. More... | |
auto | readWandStream (std::chrono::milliseconds timeout=std::chrono::milliseconds(100)) -> Result< T5_WandStreamEvent > |
Read from the wands event stream. More... | |
auto | getWandStreamHelper () -> std::shared_ptr< WandStreamHelper > |
Get a WandStreamHelper. More... | |
auto | createConnectionHelper (const std::string &displayName, std::chrono::milliseconds connectionPollInterval=std::chrono::milliseconds(100)) -> std::unique_ptr< GlassesConnectionHelper > |
Create a GlassesConnectionHelper. More... | |
Represents an instance of Tilt Five™ glasses.
Definition at line 333 of file TiltFiveNative.hpp.
|
inline |
Cancel an image buffer in use by the service for freeing.
[in] | buffer | - A pointer to the buffer to be canceled and released from use by the service. |
Definition at line 685 of file TiltFiveNative.hpp.
|
inline |
Configure the wand event stream.
[in] | config | - T5_CameraStreamConfig filled by client to detail configuration |
Definition at line 647 of file TiltFiveNative.hpp.
|
inline |
Configure the wand event stream.
[in] | config | - T5_WandStreamConfig filled by client to detail configuration |
Definition at line 754 of file TiltFiveNative.hpp.
|
inline |
Create a GlassesConnectionHelper.
[in] | displayName | - The user facing display name for this instance. |
[in] | connectionPollInterval | - Period between attempts to connect. |
Definition at line 810 of file TiltFiveNative.hpp.
|
inline |
Ensure that reserved glasses are ready for exclusive operations.
Ensure that reserved glasses are ready for exclusive operations, such as the ability to get poses (getLatestGlassesPose()) and send frames (sendFrame()). To reserve glasses for exclusive use, see reserve(). This must be checked for success prior to exclusive operations, otherwise those operations will fail.
In normal operation, this will return successfully or contain the error tiltfive::Error::kTryAgain. This should be called until success or an different error is seen.
If glasses are not reserved before calling, this will return an error.
Definition at line 591 of file TiltFiveNative.hpp.
|
inline |
Get a system-wide list of changed parameters.
This function doesn't return the values of the changed parameters, but vector of the parameters that have changed since this function was last called. Note that as a result, the first call to this function will always result in a count of 0.
Definition at line 488 of file TiltFiveNative.hpp.
|
inline |
Get the current connection state of the glasses.
Definition at line 407 of file TiltFiveNative.hpp.
|
inline |
Get the latest camera image for this glasses.
Definition at line 659 of file TiltFiveNative.hpp.
|
inline |
Get the user-facing name of the glasses.
The value of the friendly name is user specified in the Tilt Five™ UI.
This can be changed by the user during a session, and as such must not be used as any kind of key. Use getIdentifier() instead.
Definition at line 536 of file TiltFiveNative.hpp.
|
inline |
Obtain the C handle for this glasses object.
This is the lower level handle for use with the C interface. In almost all cases, you won't need to use this. If in doubt, don't.
Definition at line 387 of file TiltFiveNative.hpp.
|
inline |
Obtain a hardware (not user facing) identifier for the glasses.
Guaranteed to be stable for the duration of the glasses connection.
Not guaranteed to be stable between sessions. Commonly it will be, however if a user de-registers their glasses and re-registers them the identifier may change. IE - It's a local semi-stable software identifier, not a persistent hardware identifier.
Definition at line 400 of file TiltFiveNative.hpp.
|
inline |
Get the current IPD setting for this glasses.
The value of the IPD is user specified in the Tilt Five™ UI. Clients should query this parameter and adjust their rendering appropriately to provide a comfortable user experience.
Definition at line 518 of file TiltFiveNative.hpp.
|
inline |
Get the latest pose for this glasses.
[in] | usage | T5_GlassesPoseUsage indicating the intended use for the glasses pose. |
Definition at line 621 of file TiltFiveNative.hpp.
|
inline |
Get projection properties for glasses.
┌───────┬──────┬──────┬──────────────────────────────────┐ │ L/RHS │ Near │ Far │ Native Equivalent Function │┌─────────┼───────┼──────┼──────┼──────────────────────────────────│ │ OpenGL │ RHS→ │ -1 │ +1 │ glFrustum │ │ DirectX │ ←LHS │ 0 │ +1 │ D3DXMatrixPerspectiveOffCenterLH │ │ Vulkan │ RHS→ │ 0 │ +1 │ │ │ Metal │ RHS→ │ -1 │ +1 │ │ └─────────┴───────┴──────┴──────┴──────────────────────────────────┘ Note: When referencing D3DXMatrixPerspectiveOffCenterLH, DirectX uses Row-major matrix
[in] | glasses | - T5_Glasses returned by t5CreateGlasses(). |
[in] | handedness | - T5_CartesianCoordinateHandedness specifying handedness. |
[in] | depthRange | - T5_DepthRange to use for matrix creation. |
[in] | matrixOrder | - T5_MatrixOrder representing row or column major ordering. |
[in] | nearPlane | - The near clipping plane in view space |
[in] | farPlane | - The far clipping plane in view space |
[in] | worldScale | - Conversion factor between world space and real-world units. |
Definition at line 457 of file TiltFiveNative.hpp.
|
inline |
Get a WandStreamHelper.
Definition at line 793 of file TiltFiveNative.hpp.
|
inline |
Initialize the glasses for graphics operations.
[in] | graphicsApi | - T5_GraphicsApi specifying the graphics API for the glasses. |
[in] | graphicsContext | - Meaning depends on the graphics API in use. |
Definition at line 636 of file TiltFiveNative.hpp.
|
inline |
Obtain a list of connected wands.
Definition at line 723 of file TiltFiveNative.hpp.
|
inline |
Read from the wands event stream.
The client should repeatedly call this for as long as the wand event stream is enabled. In any polling period, the client should call this in a loop until it returns Error::kTimeout to ensure that the queue is drained.
The server will continuously write events to the stream, and will not block for clients that have fallen behind reading the stream. Wand events that overflow the buffer are discarded. In the event of falling behind the client should do any static query that it needs to do (such as enumerating connected wands), and attempt to read the stream faster.
[in] | timeout | - Timeout in ms to wait before returning without read. |
Definition at line 777 of file TiltFiveNative.hpp.
|
inline |
Release previously-reserved glasses.
Release glasses that were previously reserved for exclusive operations by the client. After calling this, exclusive operations cannot be used with the glasses unless the glasses are again reserved and readied.
Definition at line 607 of file TiltFiveNative.hpp.
|
inline |
Reserve glasses for exclusive operations by the client.
Although several operations can be performed without acquiring an exclusive lock on glasses, there are a few for which an exclusive lock is required. Primarily, the ability to get poses (getLatestGlassesPose()) and send frames (sendFrame()). To reserve glasses for exclusive use, use this function.
Clients may request glasses that aren't fully available yet (e.g. a device that isn't fully booted, or needs to be rebooted to be compatible with the client). That is why there's a two-step approach here requiring a request for exclusive access first. To finish preparing for exclusive operations, use ensureReady().
Repeated calls to this function should be made until a exclusive reservation is successful or an error occurs.
[in] | displayName | - string to display for this program in control panel (localized), e.g. "Awesome Game (Player 1)" |
Definition at line 568 of file TiltFiveNative.hpp.
|
inline |
Send a frame to display on the glasses.
[in] | frameInfo | - T5_FrameInfo detailing the frame to display. |
Definition at line 697 of file TiltFiveNative.hpp.
|
inline |
Send a Haptic Impulse to a wand.
[in] | handle | - A handle for the desired wand to receive an impulse. |
[in] | amplitude | - The amplitude of the impulse, between [0.0 and 1.0]. |
[in] | duration | - The duration of the impulse, between 0 and 320ms. |
Definition at line 711 of file TiltFiveNative.hpp.
|
inline |
Submit a buffer to the camera image stream to hold Camera Frame data.
[in] | imgBuffer | - T5_CamImage representing the buffer to be filled. |
Definition at line 672 of file TiltFiveNative.hpp.