IG::CIGI::Connector Class
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Sim
SDK edition to use it.
You should upgrade to
Header: | #include <UnigineCIGIConnector.h> |
IG::CIGI::Connector Class
Members
int init ( int version, const char * host, int send, int recv, int size = 1432 ) #
Initializes the CIGI Connector using the given parameters.Arguments
- int version - CIGI protocol version. One of the CIGI_VERSION_* values.
- const char * host - CIGI Host address.
- int send - TCP port number to be used for sending packets to the CIGI Host.
- int recv - TCP port number to be used for receiving packets from the CIGI Host.
- int size - Packet size. The default value is 1432.
Return value
1 if the CIGI Connector was initialized successfully; otherwise, 0.int shutdown ( ) #
Returns a value indicating if the CIGI Connector was shutdown successfully.Return value
1 if the CIGI Connector was shutdown successfully; otherwise, 0.int isInitialized ( ) #
Returns a value indicating if the CIGI Connector was initialized successfully.Return value
1 if the CIGI Connector was initialized successfully; otherwise, 0.void setIGMode ( int mode ) #
Sets the current IG mode.Arguments
- int mode - IG mode. One of the CIGI_MODE_* values.
int getIGMode ( ) #
Returns the current IG mode.Return value
IG mode. One of the CIGI_MODE_* values.void setIGStatus ( int status ) #
Sets the current IG status.Arguments
- int status - IG status. The following values are supported:
- 0 - normal
- 1-255 - an error has occurred
int getIGStatus ( ) #
Returns the current IG status.Return value
IG status. The following values are supported:- 0 - normal
- 1-255 - an error has occurred
int getInterpolation ( ) #
Returns a value indicating if interpolation and extrapolation are enabled.Return value
1 if interpolation and extrapolation are enabled; otherwise, 0.unsigned int getIGFrame ( ) #
Returns the number of the current frame for the IG.Return value
Current IG frame number.unsigned int getHostFrame ( ) #
Returns the number of the current frame for the Host.Return value
Current Host frame number.double getHostTime ( ) #
Returns the current Host time (with latency corrections).Return value
Current Host time, in seconds.double getLastReceivedHostTime ( ) #
Returns the last received Host time.Return value
Last received Host time, in seconds.void setConnectCallback ( Unigine::CallbackBase * func ) #
Sets a callback function to be fired when the Host has connected.Arguments
- Unigine::CallbackBase * func - Callback pointer.
Unigine::CallbackBase * getConnectCallback ( ) #
Returns a callback to be fired when the Host has connected.Return value
Callback pointer.void setReceivePacketCallback ( int cigi_opcode, Unigine::CallbackBase * func ) #
Sets a callback function to be fired when a packet of the specified type has been received from the Host.Arguments
- int cigi_opcode - CIGI data packet opcode. One of the CIGI_OPCODE_* values.
- Unigine::CallbackBase * func - Callback pointer.
Unigine::CallbackBase * getReceivePacketCallback ( int cigi_opcode ) #
Returns a callback to be fired when a packet of the specified type has been received from the Host.Arguments
- int cigi_opcode - CIGI data packet opcode. One of the CIGI_OPCODE_* values.
Return value
Callback pointer.int getNumHostPackets ( ) #
Returns the total number of packets received from the Host.Return value
Total number of packets received from the Host.CigiHostPacket * getHostPacket ( int num ) #
Returns the specified CIGI Host packet.Arguments
- int num - ID of the Host packet.
Return value
CIGI Host packet.CigiIGPacket * createIGPacket ( int ig_opcode ) #
Creates IG Packet to be sent to the Host.Arguments
- int ig_opcode - IG opcode, one of CIGI_OPCODE_* values.
Return value
IG Packet to be sent to the Host.void addIGPacket ( CigiIGPacket * packet ) #
Sends the specified IG packet to the Host.Arguments
- CigiIGPacket * packet - IG Packet to be sent to the Host.
void showDebug ( ) #
Displays the debug information.Last update:
10.04.2020
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter