5.3. The Teleport Core library¶
5.3.1. Introduction¶
Teleport Core is a library of fundamental classes shared by clients and servers.
5.3.2. Commands¶
Commands are sent from the server to the client on a reliable data channel. All commands derive from teleport::core::Command.
-
struct Command¶
Controls what is used as the current time of the animation.
A message from a server to a client. The commandPayloadType specifies the size and interpretation of the packet.
Subclassed by teleport::core::AcknowledgeHandshakeCommand, teleport::core::ApplyAnimationCommand, teleport::core::AssignNodePosePathCommand, teleport::core::NodeStateCommand, teleport::core::NodeVisibilityCommand, teleport::core::PingForLatencyCommand, teleport::core::ReconfigureVideoCommand, teleport::core::SetNodeAnimationSpeedCommand, teleport::core::SetNodeHighlightedCommand, teleport::core::SetStageSpaceOriginNodeCommand, teleport::core::SetupCommand, teleport::core::SetupInputsCommand, teleport::core::SetupLightingCommand, teleport::core::ShutdownCommand, teleport::core::UpdateNodeEnabledStateCommand, teleport::core::UpdateNodeMovementCommand
Public Members
-
CommandPayloadType commandPayloadType¶
What type of command this is, how to interpret it.
-
CommandPayloadType commandPayloadType¶
-
struct SetStageSpaceOriginNodeCommand : public teleport::core::Command¶
Sent from server to client to set the origin of the client’s space.
-
struct AcknowledgeHandshakeCommand : public teleport::core::Command¶
The message sent by a server to a client on receipt of the client’s handshake, confirming that the session can begin. size is variable, as visible node uid’s are appended.
Public Members
-
size_t visibleNodeCount = 0¶
Count of visible node IDs appended to the command payload.
-
size_t visibleNodeCount = 0¶
-
struct SetupCommand : public teleport::core::Command¶
The setup information sent by the server on connection to a given client.
Public Members
-
uint32_t debug_stream = 0¶
13
-
uint32_t do_checksums = 0¶
17
-
uint32_t debug_network_packets = 0¶
21
-
int32_t requiredLatencyMs = 0¶
25
-
uint32_t idle_connection_timeout = 5000¶
29
-
uint64_t session_id = 0¶
The server’s session id changes when the server session changes. 37 bytes.
-
ControlModel control_model = ControlModel::NONE¶
Not in use 41b to here.
-
avs::VideoConfig video_config¶
Video setup structure. 41+89=130 bytes.
-
float draw_distance = 0.0f¶
Maximum distance in metres to render locally. 134.
-
avs::AxesStandard axesStandard = avs::AxesStandard::NotInitialized¶
The axis standard that the server uses, may be different from the client’s. 147.
-
uint8_t audio_input_enabled = 0¶
148 Server accepts audio stream from client.
-
bool using_ssl = true¶
147 Not in use, for later.
-
int64_t startTimestamp_utc_unix_ns = 0¶
157 UTC Unix Timestamp in milliseconds of when the server started streaming to the client.
-
BackgroundMode backgroundMode¶
158 Whether the server supplies a background, and of which type.
-
vec4_packed backgroundColour¶
174 If the background is of the COLOUR type, which colour to use.
-
avs::ClientDynamicLighting clientDynamicLighting¶
Setup for dynamic object lighting. 174+57=231 bytes.
-
uint32_t debug_stream = 0¶
-
struct SetupLightingCommand : public teleport::core::Command¶
Sends GI textures. The packet will be sizeof(SetupLightingCommand) + num_gi_textures uid’s, each 64 bits.
Public Members
-
uint8_t num_gi_textures = 0¶
If this is nonzero, implicitly gi should be enabled.
-
uint8_t num_gi_textures = 0¶
-
struct SetupInputsCommand : public teleport::core::Command¶
Sends Input definitions. The packet will be sizeof(SetupLightingCommand) + num_gi_textures uid’s, each 64 bits.
Public Members
-
uint16_t numInputs = 0¶
The number of inputs to follow the command.
-
uint16_t numInputs = 0¶
-
struct ReconfigureVideoCommand : public teleport::core::Command¶
Instructs the client to accept a new video configuration, e.g. if bandwidth requires a change of resolution.
Public Members
-
avs::VideoConfig video_config¶
The configuration to use.
-
avs::VideoConfig video_config¶
-
struct ShutdownCommand : public teleport::core::Command¶
Instructs the client to close the connection.
-
struct NodeVisibilityCommand : public teleport::core::Command¶
Instructs the client to show or hide the specified nodes.
-
struct UpdateNodeMovementCommand : public teleport::core::Command¶
Instructs the client to modify the motion of the specified nodes.
Public Members
-
size_t updatesCount¶
How many updates are included.
-
size_t updatesCount¶
-
struct UpdateNodeEnabledStateCommand : public teleport::core::Command¶
Instructs the client to modify the enabled state of the specified nodes.
Public Members
-
size_t updatesCount¶
How many updates are included.
-
size_t updatesCount¶
-
struct SetNodeHighlightedCommand : public teleport::core::Command¶
Instructs the client to modify the highlighted state of the specified nodes.
-
struct UpdateNodeStructureCommand : public teleport::core::NodeStateCommand¶
Instructs the client to reparent the specified node.
-
struct AssignNodePosePathCommand : public teleport::core::Command¶
A command to set the locally-tracked pose of a node, for example, a node can here be linked to a regex path for an OpenXR pose control. If pathLength>0, followed by a number of chars given in pathLength for the utf8 regex path. If pathLength==0, control of the node is returned to the server.
Public Members
-
uint16_t pathLength¶
A regular expression that will be used to match the full component path of a client-side pose.
-
uint16_t pathLength¶
5.3.3. Client Messages¶
-
struct ClientMessage¶
A message from a client to a server.
Subclassed by teleport::core::ControllerPosesMessage, teleport::core::DisplayInfoMessage, teleport::core::InputEventsMessage, teleport::core::InputStatesMessage, teleport::core::KeyframeRequestMessage, teleport::core::NodeStatusMessage, teleport::core::OrthogonalAcknowledgementMessage, teleport::core::PongForLatencyMessage, teleport::core::ReceivedResourcesMessage, teleport::core::ResourceRequestMessage
Public Members
-
ClientMessagePayloadType clientMessagePayloadType¶
Specifies what type of client message this is.
-
ClientMessagePayloadType clientMessagePayloadType¶
-
struct DisplayInfo¶
Information on the resolution of a client’s display.
-
struct NodeStatusMessage : public teleport::core::ClientMessage¶
Message info struct containing how many nodes have changed to what state; sent alongside two lists of node UIDs.
-
struct ReceivedResourcesMessage : public teleport::core::ClientMessage¶
Message info struct containing how many resources were received; sent alongside a list of UIDs.
Public Members
-
size_t receivedResourcesCount¶
How many resources were received. The uid’s will be appended in the packet.
-
size_t receivedResourcesCount¶
-
struct ControllerPosesMessage : public teleport::core::ClientMessage¶
Message info struct containing head and other node poses. followed by numPoses NodePose structs.
5.3.4. Animation¶
-
struct Animation¶
An animation, comprising a list of keyframes.
-
struct TransformKeyframeList¶
A list of keyframes to be used in an animation.
5.3.5. Input and control¶
-
class Input¶
A class to store current input states.
Public Functions
-
void clearEvents()¶
Clear the current lists of states and events.
-
void addBinaryEvent(avs::InputId inputID, bool activated)¶
Add a binary (on/off) event for the specified inputID.
-
void addAnalogueEvent(avs::InputId inputID, float strength)¶
Add an analogue [0,1.0] or [-1.0,1.0] event for the specified inputID.
-
void addMotionEvent(avs::InputId inputID, vec2 motion)¶
Add a notion (xy) event for the specified inputID.
-
void setBinaryState(uint16_t inputID, bool activated)¶
Set a binary state for the specified inputID.
-
void setAnalogueState(uint16_t inputID, float strength)¶
Set an analogue state for the specified inputID.
-
const avs::InputEventAnalogue &getLastAnalogueEvent(uint16_t inputID) const¶
For debugging only: get the last event at this id.
-
const avs::InputEventBinary &getLastBinaryEvent(uint16_t inputID) const¶
For debugging only: get the last event at this id.
-
void clearEvents()¶
5.3.6. Text and Fonts¶
-
struct FontAtlas¶
Each font size represented has a FontMap.
Subclassed by clientrender::FontAtlas
-
struct TextCanvas¶
Current state of a TextCanvas component.