This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::Plugins::Syncker::Syncker Class

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Sim SDK edition to use it.
Header: #include <plugins/UnigineSyncker.h>

This class represents the base interface of the Syncker, from which Master and Slave interfaces are inherited. It contains all common functions available for both Slave and Master.

Notice
Syncker plugin must be loaded.

Syncker Class

Enums

DELIVERY_METHOD#

Delivery mode to be used by the Syncker.
NameDescription
UNRELIABLE = 0Unreliable delivery mode. Pure UDP. Packets may be lost, duplicated, or received in an order that differs from the one they were sent. Packets are not compressed, fragmented, or merged.
SEQUENCED = 1Sequenced delivery mode. Packets may be lost, but never duplicated, they arrive in the exact order they were sent.
RELIABLE = 2Reliable delivery mode. Reliable and sequenced mode, enabled by default. All packets shall be delivered to the recipient in the exact order they were sent.

ADDRESSING_METHOD#

Addressing mode to be used by the Syncker.
NameDescription
BROADCAST = 0Broadcast addressing mode (one-to-all): hosts have different IP-addresses, but a single port.
UNICAST = 1Unicast addressing mode (one-to-one): hosts have different IP-addresses (some may be the same) and different ports.
MULTICAST = 2Multicast addressing mode (one-to-many): hosts have different IP-addresses, but a single port.

Members


void setInterpolation ( bool enabled ) #

Sets a value indicating if interpolation and extrapolation should be enabled for the computer to tackle the problem of lost packets between the master and slaves.

Arguments

bool isInterpolation ( ) #

Returns a value indicating if interpolation and extrapolation are enabled for the computer to tackle the problem of lost packets between the master and slaves.

Return value

true if interpolation and extrapolation are enabled for the computer; otherwise, false.

bool isInterpolation ( const Ptr<Node> & node ) #

Returns a value indicating if the given node is interpolated by the Syncker.

Arguments

  • const Ptr<Node> & node - Node to be checked.

Return value

true if the given node is interpolated by the Syncker; otherwise, false.

void setInterpolationPeriod ( double period ) #

Sets the interpolation period value for the computer.

Arguments

  • double period - Interpolation period value, in seconds. The default value is 0.04.

double getInterpolationPeriod ( ) #

Returns the current interpolation period value for the computer.

Return value

Interpolation period value, in seconds. The default value is 0.04.

void setExtrapolationPeriod ( double period ) #

Sets the extrapolation period value for the computer.

Arguments

  • double period - Extrapolation period value, in seconds. The default value is 0.04.

double getExtrapolationPeriod ( ) #

Returns the current extrapolation period value for the computer.

Return value

Extrapolation period value, in seconds. The default value is 0.2.

void setView ( int display_num, const char * display_name ) #

Assigns the specified display or projector stored in the configuration file to the specified display of the computer.

Arguments

  • int display_num - Display number to assign the viewport to.
  • const char * display_name - Name of the display or projector stored in the configuration file that represents the viewport.

const char * getView ( int display_num ) #

Returns the current display or projector stored in the configuration file and assigned to the given display of the computer.

Arguments

  • int display_num - Display number.

Return value

Name of the display or projector stored in the configuration file and assigned to the given display.

void clearViews ( ) #

Clears all views assigned to the displays of the computer.

void setDebug ( bool enabled, int x, int y, int align_mask ) #

Enables or disables displaying of debug information at the specified position on the screen.

Arguments

  • bool enabled - true to display the debug information; false - to hide it.
  • int x - Horizontal margin of the debug information block. The default value is 10.
  • int y - Vertical margin of the debug information block. The default value is 10.
  • int align_mask - Alignment mask. One of the Gui::ALIGN_* variables or their combination. The default value is Gui::ALIGN_RIGHT | Gui::ALIGN_BOTTOM.

bool isDebug ( ) #

Returns a value indicating if the debug information is to be displayed.

Return value

true if the debug information is to be displayed; otherwise, false.

Syncker::ADDRESSING_METHOD getAddressingMethod ( ) #

Returns the packet addressing method currently used by the Syncker for communication.

Return value

Packets addressing mode currently used by the Syncker.

bool isAsynchronous ( ) #

Returns a value indicating if Syncker currently operates in the asynchronous mode.

Return value

true if Syncker currently operates in the asynchronous mode; otherwise, false.

void setDisconnectTimeout ( float timeout ) #

Sets the timeout period after which a Slave shall be considered as disconnected.

Arguments

  • float timeout - Duration of the timeout period, in seconds.

float getDisconnectTimeout ( ) #

Returns the current timeout period after which a Slave is considered as disconnected.

Return value

Duration of the timeout period, in seconds.

Projections * getProjections ( ) #

Returns the interface for managing projections configuration via API (see the Projections class).

Return value

Projections class instance.

Math::vec3 getViewOffset ( ) #

Returns the current view offset. The view offset is used in CAVE systems to reflect the current viewer's head position. It can also be used for parallax adjustment insid the cockpit.

Return value

A vec3 vector representing components of the the view offset along X, Y, and Z axes, in meters.

bool sendMessage ( const char * channel, const Ptr<Blob> & message, Syncker::DELIVERY_METHOD delivery_method = DELIVERY_METHOD.RELIABLE ) #

Sends a user message contained in the specified buffer using the given delivery method to the specified named channel via the UDP protocol.

Arguments

  • const char * channel - Channel name. Multiple systems may use Syncker's network simultaneously (e.g. IG and a users App application). For convenience, all messages are sent and received via named channels. If the specified channel does not exist, it shall be created.
  • const Ptr<Blob> & message - Buffer, containing the user message.
  • Syncker::DELIVERY_METHOD delivery_method -

Return value

true if the message was sent successfully; otherwise, false.

void setMessageReceivedCallback ( const char * channel, Unigine::CallbackBase * func ) #

Sets a callback function to be fired when a UDP user message is sent. A callback is executed in the Main Thread, but it is undefined when exactly - either in update(), or postUpdate(), or swap().

Arguments

  • const char * channel - Channel name. Multiple systems may use Syncker's network simultaneously (e.g. IG and a users App application). For convenience, all messages are sent and received via named channels. If the specified channel does not exist, it shall be created.
  • Unigine::CallbackBase * func - Callback pointer.
Last update: 2020-07-31
Build: ()