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 | 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 323 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 626 of file TiltFiveNative.hpp.
|
inline |
Configure the wand event stream.
[in] | config | - T5_CameraStreamConfig filled by client to detail configuration |
Definition at line 588 of file TiltFiveNative.hpp.
|
inline |
Configure the wand event stream.
[in] | config | - T5_WandStreamConfig filled by client to detail configuration |
Definition at line 695 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 751 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 532 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 429 of file TiltFiveNative.hpp.
|
inline |
Get the current connection state of the glasses.
Definition at line 397 of file TiltFiveNative.hpp.
|
inline |
Get the latest camera image for this glasses.
Definition at line 600 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 477 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 377 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 390 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 459 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 562 of file TiltFiveNative.hpp.
|
inline |
Get a WandStreamHelper.
Definition at line 734 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 577 of file TiltFiveNative.hpp.
|
inline |
Obtain a list of connected wands.
Definition at line 664 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 718 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 548 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 509 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 638 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 652 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 613 of file TiltFiveNative.hpp.