UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
应用程序接口
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
CIGI Client Plugin
Rendering-Related Classes

Unigine::Syncker::MasterInterface Class

Header: #include <SynckerInterface.h>
Inherits: SynckerInterface

This class represents the master interface of the Syncker.

Notice
Syncker plugin must be loaded.

MasterInterface Class

Members


void setUdpSendSize ( int size ) #

Sets the maximum size of a UDP packet to be sent.

Arguments

  • int size - UDP packet size, in bytes. The default value is 1432.

int getUdpSendSize ( ) #

Sets the maximum size of a UDP packet to be sent.

Return value

UDP packet size, in bytes. The default value is 1432.

int getNumSlaves ( ) #

Returns the total number of the slaves connected to the master.

Return value

Total number of slaves connected to the master.

const char * getSlaveName ( int num ) #

Returns the name of the given slave computer. The default name is unknown (if not set).

Arguments

  • int num - Slave number.

Return value

Slave name.

getSlaveAddress ( int num ) #

Returns the network address of the given slave computer.

Arguments

  • int num - Slave number.

Return value

Network address of the slave computer.

getSlavePort ( int num ) #

Returns the TCP port of the given slave computer.

Arguments

  • int num - Slave number.

Return value

TCP port of the slave computer.

String getSlaveWorldName ( int num ) #

Returns the name of the world file currently loaded on the specified slave.

Arguments

  • int num - Slave number.

Return value

Name of the world file currently loaded on the specified slave.

const char * getSlaveView ( int num, int display_num ) #

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

Arguments

  • int num - Slave number.
  • int display_num - Display number.

Return value

Name of the display or projector.

void setSyncPlayer ( int enabled ) #

Enables synchronization of the current player's parameters via the UDP protocol:
  • Its transformation
  • Projection matrix
  • Viewport mask
  • Mask for reflections
  • Applied post-materials (if any)
Notice
Current player synchronization is used only when all slaves use the same camera.

Arguments

  • int enabled - 1 to enable synchronization; 0 - to disable it.

void setSyncCAVE ( int enabled, Math::vec3 position ) #

Enables synchronization of the viewer's head position via the UDP protocol.
Notice
If viewer's head position is tracked, this method must me called every update().

Arguments

  • int enabled - 1 to enable synchronization; 0 - to disable it.
  • Math::vec3 position - Viewer's head position coordinates.

void setSyncRender ( int enabled ) #

Enables synchronization of all render parameters via the UDP protocol: light scattering, occlusion, etc.
Notice
When all slaves use the same rendering settings, synchronization of render parameters can be disabled.

Arguments

  • int enabled - 1 to enable synchronization; 0 - to disable it.

int isSyncPlayer ( ) #

Returns a value indicating if synchronization of the current player is enabled.
Notice
Current player synchronization is used only when all slaves use the same camera.

Return value

1 if synchronization of the current player is enabled; otherwise, 0.

int isSyncCAVE ( ) #

Returns a value indicating if synchronization of the viewer's head position is enabled.

Return value

1 if synchronization of the viewer's head position is enabled; otherwise, 0.

int isSyncRender ( ) #

Returns a value indicating if synchronization of all render parameters is enabled.
Notice
When all slaves use the same rendering settings, synchronization of render parameters can be disabled.

Return value

1 if synchronization of all render parameters is enabled; otherwise, 0.

void addSyncNode ( const NodePtr & node, unsigned char sync_mask = ~0 ) #

Enables synchronization of parameters of the given node via the UDP protocol.
Notice
Scene nodes are not synchronized by default, this method is used to add a particular node to the synchronization queue.

Arguments

  • const NodePtr & node - Node to synchronize.
  • unsigned char sync_mask - Synchronization mask.

void addSyncNodes ( Vector< NodePtr > & nodes, unsigned char sync_mask = ~0 ) #

Enables synchronization of parameters of given nodes via the UDP protocol.
Notice
Scene nodes are not synchronized by default, this method is used to add particular nodes to the synchronization queue.

Arguments

  • Vector< NodePtr > & nodes - Array of nodes to synchronize.
  • unsigned char sync_mask - Synchronization mask.

unsigned char getSyncNodeMask ( const NodePtr & node ) #

Returns the synchronization mask for the specified node.

Arguments

  • const NodePtr & node - Node, for which a syncronization mask is to be found.

Return value

Synchronization mask of the specified node.

int isSyncNode ( const NodePtr & node ) #

Returns a value indicating if synchronization of the given node is enabled. Using this method you can quickly check if a node is monitored by the Syncker (node's states are dispatched to Slaves over the network).

Arguments

  • const NodePtr & node - Node to be checked.

Return value

1 if synchronization of the given node is enabled; otherwise, 0.

int getNumSyncNodes ( ) #

Returns the total number of nodes in the synchronization queue.

Return value

Total number of nodes in the synchronization queue.

NodePtr getSyncNode ( int num ) #

Returns the synchronized node with the given number.

Arguments

  • int num - Node number in the synchronization queue.

Return value

Synchronized node.

int removeSyncNode ( const NodePtr & num ) #

Removes the specified node from the synchronization queue.

Arguments

  • const NodePtr & num - Node to be removed.

Return value

1 if the node was successfully removed from the synchronization queue; otherwise, 0.

void clearSyncNodes ( ) #

Removes all nodes from the synchronization queue.

void addSyncMaterial ( const MaterialPtr & material ) #

Enables synchronization of the given material via the UDP protocol.
Notice
Scene materials are not synchronized by default, this method is used to add a particular material to the synchronization queue.

Arguments

  • const MaterialPtr & material - Material to synchronize.

void addSyncMaterials ( const Vector< MaterialPtr > & nodes ) #

Enables synchronization of given materials via the UDP protocol.
Notice
Scene materials are not synchronized by default, this method is used to add particular materials to the synchronization queue.

Arguments

  • const Vector< MaterialPtr > & nodes - Array of materials to synchronize.

int isSyncMaterial ( const MaterialPtr & mat ) #

Returns a value indicating if synchronization of the given material is enabled. Using this method you can quickly check if a material is monitored by the Syncker (material's states are dispatched to Slaves over the network).

Arguments

  • const MaterialPtr & mat - Material to be checked.

Return value

1 if synchronization of the given material is enabled; otherwise, 0.

int getNumSyncMaterials ( ) #

Returns the total number of materials in the synchronization queue.

Return value

Total number of materials in the synchronization queue.

MaterialPtr getSyncMaterial ( int num ) #

Returns the synchronized material with the given number.

Arguments

  • int num - Material number in the synchronization queue.

Return value

Synchronized material.

void removeSyncMaterial ( int num ) #

Removes the material with the given number from the synchronization queue.

Arguments

  • int num - Material number in the synchronization queue.

void clearSyncMaterials ( ) #

Removes all materials from the synchronization queue.

int createNode ( const NodePtr & node, int include_children = 1, int add_to_sync = 1, unsigned char sync_mask = ~0 ) #

Synchronizes creation of the given node on all slaves via the TCP protocol.
Notice
This method is to be called after node creation on the master.

Arguments

  • const NodePtr & node - Node to create.
  • int include_children - 1 to create the given node with all its children; 0 - to create the given node only. The default value is 1.Create all child nodes.
  • int add_to_sync - 1 to add the created node(s) to the synchronization queue; 0 - not to add. The default value is 1.
    Notice
    Use 0 if a static node is to be created.
  • unsigned char sync_mask - Synchronization mask.

Return value

1 if the node is successfully created on all slaves; otherwise, 0.

int isNodeCreated ( const NodePtr & node ) #

Returns a value indicating if the given node was created via the createNode() method. Using this method you can quickly check if a node is in the run-time objects creation buffer.

Arguments

  • const NodePtr & node - Node to be checked.

Return value

1 if if the given node was created via the createNode() method; otherwise, 0.

void deleteNode ( const NodePtr & node, int include_children = 1 ) #

Synchronizes deletion of the given node on all slaves via the TCP protocol.

Arguments

  • const NodePtr & node - Node to delete.
  • int include_children - 1 to delete the given node with all its children; 0 - to delete the given node only. The default value is 1.

void editorSet ( int mask, const String & name, int value ) #

Sets an editor script variable value for slaves defined in a mask.

Arguments

  • int mask - Bit mask, that defines slaves, for which variables should be set. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the variable in the editor script.
  • int value - Value to be set.

void editorCall ( int mask, const String & name, Vector< Variable > & args ) #

Calls an editor script function on slaves defined in a mask.

Arguments

  • int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the function in the editor script.
  • Vector< Variable > & args - Array of arguments to be passed (passing up to 6 arguments is supported).

void editorStream ( int mask, const String & name, const BlobPtr & buffer ) #

Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.

Arguments

  • int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the function.
  • const BlobPtr & buffer - Buffer with states of the displays that need to be passed to the function.

void systemSet ( int mask, const String & name, int value ) #

Sets a system script variable value for slaves defined in a mask.

Arguments

  • int mask - Bit mask, that defines slaves, for which a variable should be set. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the variable in the system script.
  • int value - Value to be set.

void systemCall ( int mask, const String & name, Vector< Variable > & args ) #

Calls a system script function on slaves defined in a mask.

Arguments

  • int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the function in the system script.
  • Vector< Variable > & args - Array of arguments to be passed (passing up to 6 arguments is supported).

void systemStream ( int mask, const String & name, const BlobPtr & buffer ) #

Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.

Arguments

  • int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the function.
  • const BlobPtr & buffer - Buffer with states of the displays that need to be passed to the function.

void worldSet ( int mask, const String & name, int value ) #

Sets a world script variable value for slaves defined in a mask.

Arguments

  • int mask - Bit mask, that defines slaves, for which a variable should be set. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the variable in the world script.
  • int value - Value to be set.

void worldCall ( int mask, const String & name, Vector< Variable > & args ) #

Calls a world script function on slaves defined in a mask.

Arguments

  • int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the function in the world script.
  • Vector< Variable > & args - Array of arguments to be passed (passing up to 6 arguments is supported).

void worldStream ( int mask, const String & name, const BlobPtr & buffer ) #

Calls a function that receives a buffer as an argument on the slaves specified by the mask. The buffer contains the states of the slave displays.

Arguments

  • int mask - Bit mask, that defines slaves, on which a function should be called. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const String & name - Name of the function.
  • const BlobPtr & buffer - Buffer with states of the displays that need to be passed to the function.

void waitSlaves ( int slaves_count, float timeout = 10.0f ) #

Sets Syncker to standby mode, for the specified minimum number of slaves to connect.
Notice
Synchronization is suspended until the specified number of slaves are connected. If some of the connected slaves have a world, that differs from the one loaded by the master, they are forced to load the same. Synchronization resumes as the last slave reports that the world was loaded.

Arguments

  • int slaves_count - Minimum number of slaves to be connected.
  • float timeout - Timeout value for loading the world on all slaves, in seconds. The default value is 10.0.

void setSlavePlayer ( int mask, const PlayerPtr & player ) #

Sets the specified player for all slave computers specified by the mask.
Notice
Syncronization of the main master camera is disabled.

Arguments

  • int mask - Bit mask, that defines slaves, on which the specified player is to be set. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const PlayerPtr & player - Player to be set.

void sendTCPUser ( int mask, const BlobPtr & message ) #

Sends a user message contained in the specified buffer to the specified slave(s) via the TCP protocol.

Arguments

  • int mask - Bit mask, that defines slaves, to which a message is to be sent. Use ~0 for all slaves.
    Notice
    Each bit of the mask corresponds to a slave. To specify certain slave use: 1 << slave_number
  • const BlobPtr & message - Buffer, containing a user message.
Last update: 2019-08-16