next last content

6. NetworkState Nodes

The NetworkState nodes fulfil two functions. One is to monitor events sent out in a VRML world and distribute them to other net nodes in other instances of the VRML world. The second is to receive these events from the network and insert them into their world.

The tag field sets the name of the net node used in the messages sent across the network. It has to be unique in this world and should be short. It must not start with an underscore '_' because this is used internally in DeepMatrix to mark avatar object names.

If a net node receives an event via its set_value eventIn two things happen. It sends it to its value_tonet eventOut which is monitored by the client applet. The applet takes the event, builds a message containing the targets name the net nodes name and the event value and distributes it via the server to other clients. If the localCopy field is set to TRUE a copy is also send out via the value_changed eventOut.

If a client applet receives a message from the server containing an event value it searches for the target net node in the world. If it finds one, it sends the event value to the net nodes value_fromnet eventIn. The net node then sends this event to its value_changed eventOut.

Putting these two behaviours together a net node simulates a VRML ROUTE which works between several instances of the same world. It propagates an event from one source in one instance of a VRML world to all sinks in all instances of this world.

The echo flag tells the server to send back an event from the network. Thus the local world will receive a copy from the event it sends out to the other instances of the same world.

The cont flag is a special extension to the Living Worlds specification. It tells Matrix that this event represents a continously changing value. For example position of some object or interpolator events. In this case Matrix doesn't propagate each change over the network, because a continously changing value is likely to have a lot of updates per second. And this could lead to very heavy network load and big lags.

An example of a PROTO defining a net node was given in the last chapter. The VRML file matrix_protos.wrl contains all existing PROTO definitions used in the Matrix System including the Matrix_Gate and SharedObject node. The next table shows which event types are implemented at the present time and the names of the corresponding net nodes.

SFBool NetworkSFBool
SFColor NetworkSFColor
SFFloat NetworkSFFloat
SFImage NetworkSFImage Not available in Shout3D client !
SFInt32 NetworkSFInt32
SFRotation NetworkSFRotation
SFString NetworkSFString
SFTime NetworkSFTime
SFVec2f NetworkSFVec2f
SFVec3f NetworkSFVec3f
MFColor NetworkMFColor
MFFloat NetworkMFFloat
MFInt32 NetworkMFInt32
MFRotation NetworkMFRotation
MFString NetworkMFString
MFVec2f NetworkMFVec2f
MFVec3f NetworkMFVec3f

Implemented net nodes

The next chapter discusses a little example in detail, to show the use of net nodes and how to program multi-user interaction.

next last content