Prototype definition for EspduTransform which handles network communications for multiple DIS Prototype Data Units (PDUs): EntityState, Collision, Detonate, Fire, CreateEntity and RemoveEntity. Also contains EspduTransformTrace which compatibly adds billboarded text-trace capabilities for run-time debugging inside a scene.
Don Brutzman, Don McGregor, and Duane Davis
under development but mostly complete. need articulationParameters and miscellany fields connected. ROUTE firstFired1/2 to sound node?
unable to run Java classes in modern browsers
X3D Specification issue: ability for Script to use .jar files to access Java classes
DIS Find-It-Fast Guide at Simulation Interoperability Standards Organization (SISO)
available via https://www.sisostds.org/DigitalLibrary.aspx?EntryId=16568
X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit
EspduTransform is a networked Grouping node that can contain most nodes. Prototype definition for EspduTransform which handles network communications for multiple DIS Prototype Data Units (PDUs): EntityState Collision Detonate Fire CreateEntity and RemoveEntity.
Double precision output for 64-bit Espdu translation usable by georeferenced nodes.
Adding a node to the children field will add that node to the EspduTransform's set of children. Warning: adding any node to the EspduTransform's children field that is already in that child list is illegal. Warning: adding any node to the EspduTransform's children that is an ancestor of that grouping is illegal.
The removeChildren event removes nodes from the EspduTransform's children field. Any nodes in the removeChildren event that are not in the EspduTransform's children list are ignored.
Children nodes within translation and rotation coordinate system of EspduTransform. Hint: XML encoding can include child node(s) directly.
Position of children relative to local coordinate system usually read from (or written to) remote networked EspduTransform nodes.
Orientation of children relative to local coordinate system usually read from (or written to) remote networked EspduTransform nodes.
Translation offset from origin of local coordinate system.
Non-uniform x-y-z scale of child coordinate system adjusted by center and scaleOrientation.
Bounding box center: position offset from origin of local coordinate system.
Bounding box size: automatically calculated can be specified as an optimization or constraint.
[065535] EntityID: unique ID for that site.
[065535] EntityID: application ID unique ID for application at that site.
[065535] EntityID: unique ID for entity within that application.
multicast address or else "localhost" listens to local defaultBridge
[065535] multicast port or else listen to local defaultBridge
Host name of multicast relay server to provide alternative connectivity if local native multicast traffic not heard.
Connection port on multicast relay server.
networkMode: standAlone (ignore network but still respond to local events), networkReader (listen to network as ghost entity), networkWriter (output to network as master entity at writeInterval)
Whether networkMode standAlone (ignore network but still respond to local events) is true/false
Whether networkMode 'networkWriter' (output to network as master entity at writeInterval) is true/false
Whether networkMode 'networkReader' (listen to network as ghost entity) is true/false
Indicates if the node has received a DIS message (isActive=true) or not (isActive=false). Since DIS entities can be considered inactive after some period of time (typically five seconds) either event may be received by listening nodes.
whether RTP header is expected to be prepended to DIS packet
whether RTP header was found prepended to DIS packet
Dead reckoning algorithm being used to project position/orientation with velocities/accelerations.
range [078]. Indicates the number of appended parameters that are being used to describe articulation of various segments of the entity model.
range [0255]. The Parameter Type Designator entries in the articulationParameterDesignatorArray indicate if the the parameter record is for an articulated or attached part. It is represented by an 8-bit enumeration.
range [0255]. The Change Indicator entries in the articulationChangeIndicatorArray indicate the change of any parameter for the associated articulated part. This is specified by an 8-bit unsigned integer. The value is initially set to zero for each exercise and is sequentially incremented by one for each change in the articulation parameters. The proper indicator is updated automatically by an X3D DIS implementation upon receipt of a set_articulationParameterValue event.
range [065535]. The ID - Part Attached To entries in the articulationParameterIdPartAttachedToArray identify the articulated part to which this articulation parameter is attached. The value is specified by a 16-bit unsigned integer and is set to zero if the articulated part is attached directly to the entity.
range [0255]. The Parameter Type entries in the articulationParameterTypeArray are specified by 32-bit enumeration values.
The Parameter Value entries in the articulationParameterArray are specified by a 64-bit field. The definition of the 64 bits is determined based on the type of parameter indicated above.
"EspduTransform.class" "dis-java-vrml.jar#EspduTransform.class" "https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/EspduTransform.class"
Double precision outputs for 64-bit Espdu translation.
Used by TimeSensor clocks to trigger processEvents() method.
EspduTransformTrace provides 3D trace values for a corresponding EspduTransorm usually as a child so that it stays local to an entity's position. EspduTransformTrace compatibly adds billboarded text-trace capabilities for run-time debugging inside a scene.
initialize with <EspduTransform USE="NodeToBeTraced"/> so that networked data is passed by reference
whether or not to include verbose trace comments in Java console in order to help debug network connectivity
Whether EspduTransformTrace debug scripting is visible inside the X3D scene
ecmascript: function initialize () { tracePrint('TraceScript initialize() start...'); tracePrint('traceColor=' + traceColor); tracePrint('traceOffset=' + traceOffset); tracePrint('traceFontSize=' + traceFontSize); tracePrint('traceJava=' + traceJava); tracePrint('marking=' + espduTransformNode.marking); tracePrint('address=' + espduTransformNode.address); tracePrint(' port=' + espduTransformNode.port); tracePrint('networkMode=' + espduTransformNode.networkMode); if (espduTransformNode.networkMode == 'networkReader') { readInterval = espduTransformNode.readInterval; writeInterval = 0; } if (espduTransformNode.networkMode == 'networkWriter') { readInterval = 0; writeInterval = espduTransformNode.writeInterval; } tracePrint('readInterval=' + espduTransformNode.readInterval); tracePrint('writeInterval=' + espduTransformNode.writeInterval); prior_marking = espduTransformNode.marking; prior_readInterval = espduTransformNode.readInterval; prior_writeInterval = espduTransformNode.writeInterval; prior_translation = espduTransformNode.translation; prior_geoCoords_changed = espduTransformNode.geoCoords_changed; prior_fired1 = espduTransformNode.fired1; prior_fired2 = espduTransformNode.fired2; outputString1 = espduTransformNode.marking + ' (' + espduTransformNode.siteID + ', ' + espduTransformNode.applicationID + ', ' + espduTransformNode.entityID + ')'; outputString2 = 'awaiting PDUs...'; traceString = new MFString (outputString1, outputString2); tracePrint ('traceString=' + traceString); // if (offsetFollowsEspduTransform) // { // // create ROUTEs to connect parent EspduTransform // } tracePrint('TraceScript initialize() finish.'); } function touched (isActiveValue, timestamp) { tracePrint ('touched=' + isActiveValue + ', no action'); } function update (value, timestamp) { // tracePrint('begin update() ...'); changed = false; // only send output events when changed if (prior_marking != espduTransformNode.marking) { tracePrint('update() changed marking'); marking = espduTransformNode.marking; prior_marking = marking; changed = true; } if (prior_readInterval != espduTransformNode.readInterval) { tracePrint('update() changed readInterval'); readInterval = espduTransformNode.readInterval; prior_readInterval = espduTransformNode.readInterval; changed = true; } if (prior_writeInterval != espduTransformNode.writeInterval) { tracePrint('update() changed writeInterval'); writeInterval = espduTransformNode.writeInterval; prior_writeInterval = espduTransformNode.writeInterval; changed = true; } if ( (prior_translation.x != espduTransformNode.translation.x) || (prior_translation.y != espduTransformNode.translation.y) || (prior_translation.z != espduTransformNode.translation.z)) { tracePrint('update() changed translation'); prior_translation = espduTransformNode.translation; changed = true; } if (prior_geoCoords_changed != espduTransformNode.geoCoords_changed) { tracePrint('update() changed geoCoords_changed'); prior_geoCoords_changed = espduTransformNode.geoCoords_changed; changed = true; } // tracePrint('espduTransformNode.translation=' + espduTransformNode.translation); // tracePrint('prior_translation=' + prior_translation); // tracePrint('prior_geoCoords_changed=' + prior_geoCoords_changed); if (prior_fired1 != espduTransformNode.fired1) { tracePrint('update() changed fired1'); fired1 = espduTransformNode.fired1; fireTime = timestamp; prior_fired1 = espduTransformNode.fired1; changed = true; } if (prior_fired2 != espduTransformNode.fired2) { tracePrint('update() changed fired2'); fired2 = espduTransformNode.fired2; fireTime = timestamp; prior_fired2 = espduTransformNode.fired2; changed = true; } if (changed == true) // produce, then send trace text { tracePrint('update() changed == true'); outputString1 = espduTransformNode.marking + ' (' + espduTransformNode.siteID + ', ' + espduTransformNode.applicationID + ', ' + espduTransformNode.entityID + ')'; outputString2 = prior_geoCoords_changed; traceString = new MFString (outputString1, outputString2); } tracePrint('end update() changed=' + changed); } function roundoff (x) { return Math.round(x * 10) / 10; } function tracePrint(outputString) { if (localTraceEnabled) Browser.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); }
initialize with <EspduTransform USE="NodeToBeTraced"/>
(not passable???) whether or not to include verbose trace comments in Java console in order to help debug network connectivity
Whether EspduTransformTrace debug scripting has verbose output
ecmascript: function initialize ( ) { tracePrint ('DEBUG_JAVASCRIPT initialize() start...'); translation_text[0] = espduTransformNode.marking + ' awaiting DIS'; // rotation_text [0] = 'translation and rotation updates'; // marking_address_text[0] = 'multicast group: ' + address +'/' + port + ', ID:'// + siteID + ',' + applicationID + ',' + entityID; MFmarking[0] = espduTransformNode.marking; tracePrint ('DEBUG_JAVASCRIPT initialize() finish.'); } function set_translation ( translation, ts ) { if (active) { // round to nearest tenth translation.x = Math.round (translation.x * 10.0) / 10.0; translation.y = Math.round (translation.y * 10.0) / 10.0; translation.z = Math.round (translation.z * 10.0) / 10.0; translation_text[0] = marking + ' translation ' + translation; } } function set_rotation ( rotation, ts ) { if (active) { // round terms to nearest thousandth rotation.x = Math.round (rotation.x * 1000.0) / 1000.0; rotation.y = Math.round (rotation.y * 1000.0) / 1000.0; rotation.z = Math.round (rotation.z * 1000.0) / 1000.0; rotation.angle = (rotation.angle * 180.0) / 3.141592653; rotation.angle = Math.round (rotation.angle * 10.0) / 10.0; // rotation_text [0] = 'rotation ' + rotation + ' axis/degrees'; } } function touch (value, time) { active = !active; result = active; if (result) { translation_text[0] = marking + ' awaiting DIS'; // rotation_text [0] = 'translation and rotation updates'; // marking_address_text[0] = 'multicast group: ' + address +'/' + port + ', ID:'// + siteID + ',' + applicationID + ',' + entityID; MFmarking[0] = marking; } else { translation_text[0] = ''; rotation_text [0] = ''; marking_address_text[0] = ''; MFmarking[0] = ''; } } function timestamp ( value, ts ) { tracePrint ('DIS timestamp=' + value + ', event timestamp=' + ts); } function collided ( value, ts ) { tracePrint ('collided=' + value); } function detonated ( value, ts ) { tracePrint ('detonated=' + value); } function articulationParameterCount ( value, ts ) { tracePrint ('articulationParameterCount=' + value); } function articulationParameterValue0 ( value, ts ) { tracePrint ('articulationParameterValue0=' + value); } function articulationParameterValue1 ( value, ts ) { tracePrint ('articulationParameterValue1=' + value); } function articulationParameterValue2 ( value, ts ) { tracePrint ('articulationParameterValue2=' + value); } function articulationParameterValue3 ( value, ts ) { tracePrint ('articulationParameterValue3=' + value); } function articulationParameterValue4 ( value, ts ) { tracePrint ('articulationParameterValue4=' + value); } function articulationParameterValue5 ( value, ts ) { tracePrint ('articulationParameterValue5=' + value); } function articulationParameterValue6 ( value, ts ) { tracePrint ('articulationParameterValue6=' + value); } function articulationParameterValue7 ( value, ts ) { tracePrint ('articulationParameterValue7=' + value); } function articulationParameterValue8 ( value, ts ) { tracePrint ('articulationParameterValue8=' + value); } function articulationParameterValue9 ( value, ts ) { tracePrint ('articulationParameterValue9=' + value); } function articulationParameterValue10 ( value, ts ) { tracePrint ('articulationParameterValue10=' + value); } function articulationParameterValue11 ( value, ts ) { tracePrint ('articulationParameterValue11=' + value); } function articulationParameterValue12 ( value, ts ) { tracePrint ('articulationParameterValue12=' + value); } function articulationParameterValue13 ( value, ts ) { tracePrint ('articulationParameterValue13=' + value); } function articulationParameterValue14 ( value, ts ) { tracePrint ('articulationParameterValue14=' + value); } function munitionStartPoint ( value, ts ) { tracePrint ('munitionStartPoint=' + value); } function munitionEndPoint ( value, ts ) { tracePrint ('munitionEndPoint=' + value); } function rtpHeaderHeard ( value, ts ) { tracePrint ('unexpected RTP header status, rtpHeaderHeard=' + value); } function tracePrint(outputString) { if (localTraceEnabled) Browser.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); }
Touch trace text to toggle simple or verbose
ecmascript: function initialize ( ) { tracePrint ('SetFireLineEndpoints initialize() start...'); holdArray [0] = new SFVec3f (0.0, 0.0, 0.0); holdArray [1] = new SFVec3f (0.0, 0.0, 0.0); pointArray = holdArray; tracePrint ('SetFireLineEndpoints initialize() start...'); } function set_munitionStartPoint ( value, timestamp ) { holdArray [0] = value; } function set_munitionEndPoint ( value, timestamp ) { holdArray [1] = value; pointArray = holdArray; // tracePrint ('fire line endpoints=' + holdArray); } function tracePrint(outputString) { if (localTraceEnabled) Browser.println ('[EspduTransformTrace SetFireLineEndpoints] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace SetFireLineEndpoints] ' + outputString); }
ecmascript: function initialize ( ) { tracePrint ('FireSequenceScript initialize() start...'); firstFired1 = false; firstFired2 = false; tracePrint ('FireSequenceScript initialize() finish.'); } function fireTime (value, timestamp) { // no action } function set_fired1 (value, timestamp) { if ((value == true) && (firstFired1 == false)) { firstFired1 = true; tracePrint ('EspduTransformPROTO.wrl: fired1 FIRE_SEQUENCE_SCRIPT timestamp ' + fireTime); } } function set_fired2 (value, timestamp) { if ((value == true) && (firstFired1 == false)) { firstFired2 = true; tracePrint ('EspduTransformPROTO.wrl: fired2 FIRE_SEQUENCE_SCRIPT timestamp ' + fireTime); } } function tracePrint(outputString) { if (localTraceEnabled) Browser.println ('[EspduTransformTrace FireSequenceScript] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace FireSequenceScript] ' + outputString); }