<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<component level='1name='DIS'/>
<meta name='titlecontent='EspduTransformPrototypes.x3d'/>
<meta name='descriptioncontent='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.'/>
<meta name='creatorcontent='Don Brutzman, Don McGregor, and Duane Davis'/>
<meta name='createdcontent='7 December 2001'/>
<meta name='modifiedcontent='14 November 2015'/>
<meta name=' warning content=' under development but mostly complete. need articulationParameters and miscellany fields connected. ROUTE firstFired1/2 to sound node? '/>
<meta name='referencecontent='/vrtp/mil/navy/nps/dis/EspduTransformPROTO.wrl'/>
<meta name='referencecontent='/vrtp/mil/navy/nps/dis/EspduTransform.java'/>
<meta name='referencecontent=' http://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/EspduTransform.java '/>
<meta name='referencecontent=' http://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/ExternProtoDeclareDefinitions.x3d '/>
<meta name='referencecontent='DIS Find-It-Fast Guide at Simulation Interoperability Standards Organization (SISO)'/>
<meta name='referencecontent=' available via http://discussions.sisostds.org/default.asp?action=9&boardid=2&read=40321&fid=32 '/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/EspduTransformPrototypes.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<!-- ============================================================ -->
<!-- Why a prototype rather than an Inline file? Prototyping allows replacement of standard VRML nodes (e.g. Transform) and can also expose events and fields to the encapsulating top-level scene. -->
<!-- ============================================================ -->
<ProtoDeclare name='EspduTransformappinfo='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.'>
<ProtoInterface>
<field name='geoCoords_changedtype='SFVec3daccessType='outputOnly'
 appinfo='Double precision output for 64-bit Espdu translation usable by georeferenced nodes.'/>

<!-- Standard Transform fields -->
<field name='addChildrentype='MFNodeaccessType='inputOnly'
 appinfo="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."/>

<field name='removeChildrentype='MFNodeaccessType='inputOnly'
 appinfo="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."/>

<field name='childrentype='MFNodeaccessType='inputOutput'
 appinfo='Children nodes within translation and rotation coordinate system of EspduTransform. Hint: XML encoding can include child node(s) directly.'>
<!-- default initialization is NULL node array -->
</field>
<field name='translationtype='SFVec3fvalue='0 0 0accessType='inputOutput'
 appinfo='Position of children relative to local coordinate system usually read from (or written to) remote networked EspduTransform nodes.'/>

<field name='rotationtype='SFRotationvalue='0 0 1 0accessType='inputOutput'
 appinfo='Orientation of children relative to local coordinate system usually read from (or written to) remote networked EspduTransform nodes.'/>

<field name='centertype='SFVec3fvalue='0 0 0accessType='inputOutput'
 appinfo='Translation offset from origin of local coordinate system.'/>

<field name='scaletype='SFVec3fvalue='1 1 1accessType='inputOutput'
 appinfo='Non-uniform x-y-z scale of child coordinate system adjusted by center and scaleOrientation.'/>

<field name='scaleOrientationtype='SFRotationvalue='0 0 1 0accessType='inputOutput'
 appinfo='Non-uniform x-y-z scale of child coordinate system adjusted by center and scaleOrientation.'/>

<field name='bboxCentertype='SFVec3fvalue='0 0 0accessType='initializeOnly'
 appinfo='Bounding box center: position offset from origin of local coordinate system.'/>

<field name='bboxSizetype='SFVec3fvalue='-1 -1 -1accessType='initializeOnly'
 appinfo='Bounding box size: automatically calculated can be specified as an optimization or constraint.'/>

<!-- Entity identity -->
<field name='markingtype='SFStringaccessType='inputOutput'
 appinfo='0-to-11 character label for entity.'/>

<field name='siteIDtype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535] EntityID: unique ID for that site.'/>

<field name='applicationIDtype='SFInt32value='1accessType='inputOutput'
 appinfo='[065535] EntityID: application ID unique ID for application at that site.'/>

<field name='entityIDtype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535] EntityID: unique ID for entity within that application.'/>

<!-- Networking configuration parameters -->
<field name='addresstype='SFStringvalue='localhostaccessType='inputOutput'
 appinfo='multicast address or else "localhost" listens to local defaultBridge'/>

<field name='porttype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535] multicast port or else listen to local defaultBridge'/>

<field name='multicastRelayHosttype='SFStringaccessType='inputOutput'
 appinfo='Host name of multicast relay server to provide alternative connectivity if local native multicast traffic not heard.'/>

<field name='multicastRelayPorttype='SFInt32value='0accessType='inputOutput'
 appinfo='Connection port on multicast relay server.'/>

<field name='networkModetype='SFStringvalue='standAloneaccessType='inputOutput'
 appinfo='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)'/>

<field name='isStandAlonetype='SFBoolaccessType='outputOnly'
 appinfo='Whether networkMode standAlone (ignore network but still respond to local events) is true/false'/>

<field name='isMastertype='SFBoolaccessType='outputOnly'
 appinfo="Whether networkMode 'networkWriter' (output to network as master entity at writeInterval) is true/false"/>

<field name='isRemotetype='SFBoolaccessType='outputOnly'
 appinfo="Whether networkMode 'networkReader' (listen to network as ghost entity) is true/false"/>

<field name='readIntervaltype='SFTimevalue='0.1accessType='inputOutput'
 appinfo='seconds between read updates'/>

<field name='writeIntervaltype='SFTimevalue='1.0accessType='inputOutput'
 appinfo='seconds between write updates'/>

<field name='isActivetype='SFBoolaccessType='outputOnly'
 appinfo='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.'/>

<field name='timestamptype='SFTimeaccessType='outputOnly'
 appinfo='DIS timestamp in VRML units'/>

<field name='rtpHeaderExpectedtype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='whether RTP header is expected to be prepended to DIS packet'/>

<field name='isRtpHeaderHeardtype='SFBoolaccessType='outputOnly'
 appinfo='whether RTP header was found prepended to DIS packet'/>

<!-- Further identification -->
<field name='forceIDtype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='entityKindtype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='entityDomaintype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='entityCountrytype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='entityCategorytype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='entitySubCategorytype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='entitySpecifictype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='entityExtratype='SFInt32value='0accessType='inputOutput'
 appinfo='[0255]'/>

<field name='linearVelocitytype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
<field name='linearAccelerationtype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
<field name='deadReckoningtype='SFInt32value='0accessType='inputOutput'
 appinfo='Dead reckoning algorithm being used to project position/orientation with velocities/accelerations.'/>

<!-- Collision PDU events -->
<field name='isCollidedtype='SFBoolaccessType='outputOnly'/>
<field name='collideTimetype='SFTimeaccessType='outputOnly'/>
<field name='eventApplicationIDtype='SFInt32accessType='outputOnly'
 appinfo='[065535]'/>

<field name='eventSiteIDtype='SFInt32accessType='outputOnly'
 appinfo='[065535]'/>

<field name='eventEntityIDtype='SFInt32accessType='outputOnly'
 appinfo='[065535]'/>

<field name='collisionTypetype='SFInt32accessType='outputOnly'
 appinfo='[0255]'/>

<field name='eventNumbertype='SFInt32accessType='outputOnly'
 appinfo='[065535]'/>

<!-- Fire, Detonate PDU events -->
<field name='fired1type='SFBoolvalue='falseaccessType='inputOutput'/>
<field name='fired2type='SFBoolvalue='falseaccessType='inputOutput'/>
<field name='firedTimetype='SFTimeaccessType='outputOnly'/>
<field name='munitionStartPointtype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
<field name='munitionEndPointtype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
<field name='munitionApplicationIDtype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='munitionSiteIDtype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='munitionEntityIDtype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='fireMissionIndextype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='warheadtype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='fusetype='SFInt32value='0accessType='inputOutput'
 appinfo='[065535]'/>

<field name='munitionQuantitytype='SFInt32value='1accessType='inputOutput'
 appinfo='[065535]'/>

<field name='firingRatetype='SFInt32value='1accessType='inputOutput'
 appinfo='[065535]'/>

<field name='firingRangetype='SFFloatvalue='0accessType='inputOutput'/>
<field name='isDetonatedtype='SFBoolaccessType='outputOnly'/>
<field name='detonateTimetype='SFTimeaccessType='outputOnly'/>
<field name='detonationLocationtype='SFVec3faccessType='outputOnly'/>
<field name='detonationRelativeLocationtype='SFVec3faccessType='outputOnly'/>
<field name='detonationResulttype='SFInt32accessType='outputOnly'/>
<!-- Articulation parameters are extra blocks of information, appended one by one to end of regular Espdu. -->
<field name='articulationParameterCounttype='SFInt32value='0accessType='inputOutput'
 appinfo='range [078]. Indicates the number of appended parameters that are being used to describe articulation of various segments of the entity model.'/>

<field name='articulationParameterDesignatorArraytype='MFInt32accessType='inputOutput'
 appinfo='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.'>
<!-- default initialization is NULL node array -->
</field>
<field name='articulationParameterChangeIndicatorArraytype='MFInt32accessType='inputOutput'
 appinfo='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.'>
<!-- default initialization is NULL node array -->
</field>
<field name='articulationParameterIdPartAttachedToArraytype='MFInt32accessType='inputOutput'
 appinfo='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.'>
<!-- default initialization is NULL node array -->
</field>
<field name='articulationParameterTypeArraytype='MFInt32accessType='inputOutput'
 appinfo='range [0255]. The Parameter Type entries in the articulationParameterTypeArray are specified by 32-bit enumeration values.'>
<!-- default initialization is NULL node array -->
</field>
<field name='articulationParameterArraytype='MFFloataccessType='inputOutput'
 appinfo='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.'>
<!-- default initialization is NULL node array -->
</field>
<field name='set_articulationParameterValue0type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue1type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue2type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue3type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue4type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue5type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue6type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue7type='SFFloataccessType='inputOnly'/>
<field name='articulationParameterValue0_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue1_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue2_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue3_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue4_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue5_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue6_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue7_changedtype='SFFloataccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<!-- First node inside a PrototypeDeclaration is the node type of the ProtoInstance -->
<Transform DEF='DisTransformNode'>
<IS>
<connect nodeField='addChildrenprotoField='addChildren'/>
<connect nodeField='removeChildrenprotoField='removeChildren'/>
<connect nodeField='childrenprotoField='children'/>
<connect nodeField='translationprotoField='translation'/>
<connect nodeField='rotationprotoField='rotation'/>
<connect nodeField='centerprotoField='center'/>
<connect nodeField='scaleprotoField='scale'/>
<connect nodeField='scaleOrientationprotoField='scaleOrientation'/>
<connect nodeField='bboxCenterprotoField='bboxCenter'/>
<connect nodeField='bboxSizeprotoField='bboxSize'/>
</IS>
</Transform>
<Group DEF='CacheExposedFieldNodes'>
<!-- This first set of nodes are not rendered and only hold exposedField state. This hack is necessary to work around the restriction on exposedFields directly in Script nodes. -->
<Anchor DEF='MarkingState'>
<IS>
<connect nodeField='descriptionprotoField='marking'/>
</IS>
</Anchor>
<Switch DEF='SiteIdStatewhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='siteID'/>
</IS>
</Switch>
<Switch DEF='ApplicationIdStatewhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='applicationID'/>
</IS>
</Switch>
<Switch DEF='EntityIdStatewhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='entityID'/>
</IS>
</Switch>
<Anchor DEF='NetworkModeState'>
<IS>
<connect nodeField='descriptionprotoField='networkMode'/>
</IS>
</Anchor>
<NavigationInfo DEF='ReaderState'>
<IS>
<connect nodeField='headlightprotoField='isRemote'/>
</IS>
</NavigationInfo>
<NavigationInfo DEF='MasterState'>
<IS>
<connect nodeField='headlightprotoField='isMaster'/>
</IS>
</NavigationInfo>
<NavigationInfo DEF='LocalState'>
<IS>
<connect nodeField='headlightprotoField='isStandAlone'/>
</IS>
</NavigationInfo>
<TimeSensor DEF='ReadWriteIntervalState'>
<IS>
<connect nodeField='startTimeprotoField='readInterval'/>
<connect nodeField='stopTimeprotoField='writeInterval'/>
</IS>
</TimeSensor>
<Transform DEF='MunitionPointNode'>
<IS>
<connect nodeField='translationprotoField='munitionStartPoint'/>
<connect nodeField='centerprotoField='munitionEndPoint'/>
</IS>
</Transform>
<Switch whichChoice='-1'>
<Anchor DEF='AddressHolder'>
<IS>
<connect nodeField='descriptionprotoField='address'/>
</IS>
</Anchor>
<Anchor DEF='MulticastAddressHolder'>
<IS>
<connect nodeField='descriptionprotoField='multicastRelayHost'/>
</IS>
</Anchor>
<Switch DEF='PortHolderwhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='port'/>
</IS>
</Switch>
<Switch DEF='MulticastPortHolderwhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='multicastRelayPort'/>
</IS>
</Switch>
<Switch DEF='ArticulationParameterCountHolderwhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='articulationParameterCount'/>
</IS>
</Switch>
<ScalarInterpolator DEF='ArticulationParameterArrayHolder'>
<IS>
<connect nodeField='keyValueprotoField='articulationParameterArray'/>
</IS>
</ScalarInterpolator>
</Switch>
</Group>
<!-- Nonrendering Script that connects network communications to interfaces -->
<Group DEF='NetworkingScriptAndReadWriteClocks'>
<!-- Fields in the Script are directly mapped to the PrototypeDeclare field-tag interfaces by using the IS construct -->
<!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
<!-- ROUTE information for EspduScriptNode node:  [from ReadIntervalClock.cycleTime to update ] [from WriteIntervalClock.cycleTime to update ] -->
<Script DEF='EspduScriptNodedirectOutput='truemustEvaluate='true'
  url=' "EspduTransform.class" "/vrtp/mil/navy/nps/dis/EspduTransform.class" "dis-java-vrml.jar#EspduTransform.class" "/vrtp/dis-java-vrml.jar#EspduTransform.class" "file:///c:/vrtp/mil/navy/nps/dis/EspduTransform.class" "http://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/EspduTransform.class" '>
<!-- Generic events -->
<field name='geoCoords_changedtype='SFVec3daccessType='outputOnly'
 appinfo='Double precision outputs for 64-bit Espdu translation.'/>

<field name='traceJavatype='SFBoolvalue='falseaccessType='initializeOnly'/>
<field name='updatetype='SFTimeaccessType='inputOnly'
 appinfo='Used by TimeSensor clocks to trigger processEvents() method.'/>

<field name='transformNodetype='SFNodeaccessType='initializeOnly'>
<Transform USE='DisTransformNode'/>
</field>
<field name='markingNodetype='SFNodeaccessType='initializeOnly'>
<Anchor USE='MarkingState'/>
</field>
<!-- Initialization fields -->
<field name='siteIdNodetype='SFNodeaccessType='initializeOnly'>
<Switch USE='SiteIdStatewhichChoice='-1'/>
</field>
<field name='applicationIdNodetype='SFNodeaccessType='initializeOnly'>
<Switch USE='ApplicationIdStatewhichChoice='-1'/>
</field>
<field name='entityIdNodetype='SFNodeaccessType='initializeOnly'>
<Switch USE='EntityIdStatewhichChoice='-1'/>
</field>
<field name='addressNodetype='SFNodeaccessType='initializeOnly'>
<Anchor USE='AddressHolder'/>
</field>
<field name='multicastAddressNodetype='SFNodeaccessType='initializeOnly'>
<Anchor USE='MulticastAddressHolder'/>
</field>
<field name='portNodetype='SFNodeaccessType='initializeOnly'>
<Switch USE='PortHolderwhichChoice='-1'/>
</field>
<field name='multicastPortNodetype='SFNodeaccessType='initializeOnly'>
<Switch USE='MulticastPortHolderwhichChoice='-1'/>
</field>
<field name='networkModeNodetype='SFNodeaccessType='initializeOnly'>
<Anchor USE='NetworkModeState'/>
</field>
<field name='readWriteIntervalNodetype='SFNodeaccessType='initializeOnly'>
<TimeSensor USE='ReadWriteIntervalState'/>
</field>
<field name='isActivetype='SFBoolaccessType='outputOnly'/>
<field name='timestamptype='SFTimeaccessType='outputOnly'/>
<field name='rtpHeaderExpectedtype='SFBoolaccessType='initializeOnly'/>
<field name='isRtpHeaderHeardtype='SFBoolaccessType='outputOnly'/>
<field name='isCollidedtype='SFBoolaccessType='outputOnly'/>
<field name='collideTimetype='SFTimeaccessType='outputOnly'/>
<field name='isDetonatedtype='SFBoolaccessType='outputOnly'/>
<field name='detonateTimetype='SFTimeaccessType='outputOnly'/>
<field name='firedTimetype='SFTimeaccessType='outputOnly'/>
<field name='munitionPointNodetype='SFNodeaccessType='initializeOnly'>
<Transform USE='MunitionPointNode'/>
</field>
<field name='articulationParameterCountNodetype='SFNodeaccessType='initializeOnly'>
<Switch USE='ArticulationParameterCountHolderwhichChoice='-1'/>
</field>
<field name='articulationParameterArrayNodetype='SFNodeaccessType='initializeOnly'>
<ScalarInterpolator USE='ArticulationParameterArrayHolder'/>
</field>
<field name='set_articulationParameterValue0type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue1type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue2type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue3type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue4type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue5type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue6type='SFFloataccessType='inputOnly'/>
<field name='set_articulationParameterValue7type='SFFloataccessType='inputOnly'/>
<field name='articulationParameterValue0_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue1_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue2_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue3_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue4_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue5_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue6_changedtype='SFFloataccessType='outputOnly'/>
<field name='articulationParameterValue7_changedtype='SFFloataccessType='outputOnly'/>
<IS>
<connect nodeField='geoCoords_changedprotoField='geoCoords_changed'/>
<connect nodeField='isActiveprotoField='isActive'/>
<connect nodeField='timestampprotoField='timestamp'/>
<connect nodeField='rtpHeaderExpectedprotoField='rtpHeaderExpected'/>
<connect nodeField='isRtpHeaderHeardprotoField='isRtpHeaderHeard'/>
<connect nodeField='isCollidedprotoField='isCollided'/>
<connect nodeField='collideTimeprotoField='collideTime'/>
<connect nodeField='isDetonatedprotoField='isDetonated'/>
<connect nodeField='detonateTimeprotoField='detonateTime'/>
<connect nodeField='firedTimeprotoField='firedTime'/>
<connect nodeField='set_articulationParameterValue0protoField='set_articulationParameterValue0'/>
<connect nodeField='set_articulationParameterValue1protoField='set_articulationParameterValue1'/>
<connect nodeField='set_articulationParameterValue2protoField='set_articulationParameterValue2'/>
<connect nodeField='set_articulationParameterValue3protoField='set_articulationParameterValue3'/>
<connect nodeField='set_articulationParameterValue4protoField='set_articulationParameterValue4'/>
<connect nodeField='set_articulationParameterValue5protoField='set_articulationParameterValue5'/>
<connect nodeField='set_articulationParameterValue6protoField='set_articulationParameterValue6'/>
<connect nodeField='set_articulationParameterValue7protoField='set_articulationParameterValue7'/>
<connect nodeField='articulationParameterValue0_changedprotoField='articulationParameterValue0_changed'/>
<connect nodeField='articulationParameterValue1_changedprotoField='articulationParameterValue1_changed'/>
<connect nodeField='articulationParameterValue2_changedprotoField='articulationParameterValue2_changed'/>
<connect nodeField='articulationParameterValue3_changedprotoField='articulationParameterValue3_changed'/>
<connect nodeField='articulationParameterValue4_changedprotoField='articulationParameterValue4_changed'/>
<connect nodeField='articulationParameterValue5_changedprotoField='articulationParameterValue5_changed'/>
<connect nodeField='articulationParameterValue6_changedprotoField='articulationParameterValue6_changed'/>
<connect nodeField='articulationParameterValue7_changedprotoField='articulationParameterValue7_changed'/>
</IS>
</Script>
<!-- Clocks stimulate the processEvents() method in the Script code, resulting in DIS PDU reads/writes. The 'update' eventIn is implicit (i.e. no corresponding Java method is needed). -->
<!-- ROUTE information for ReadIntervalClock node:  [from cycleTime to EspduScriptNode.update ] -->
<TimeSensor DEF='ReadIntervalClockloop='true'>
<IS>
<connect nodeField='cycleIntervalprotoField='readInterval'/>
</IS>
</TimeSensor>
<!-- ROUTE information for WriteIntervalClock node:  [from cycleTime to EspduScriptNode.update ] -->
<TimeSensor DEF='WriteIntervalClockloop='true'>
<IS>
<connect nodeField='cycleIntervalprotoField='writeInterval'/>
</IS>
</TimeSensor>
<ROUTE fromNode='ReadIntervalClockfromField='cycleTimetoNode='EspduScriptNodetoField='update'/>
<ROUTE fromNode='WriteIntervalClockfromField='cycleTimetoNode='EspduScriptNodetoField='update'/>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- ============================================================ -->
<ProtoDeclare name='EspduTransformTraceappinfo="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.">
<ProtoInterface>
<!-- Special trace fields (beyond regular EspduTransform signature) -->
<field name='espduTransformNodetype='SFNodeaccessType='initializeOnly'
 appinfo='initialize with <EspduTransform USE="NodeToBeTraced"/> so that networked data is passed by reference'>
<!-- provide <EspduTransform USE="nodeName"/> i.e. copy-by=reference node to initialize -->
</field>
<field name='traceColortype='SFColorvalue='1 0.4 0.05accessType='initializeOnly'
 appinfo='Trace text color'/>

<field name='traceOffsettype='SFVec3fvalue='0 2.5 0accessType='initializeOnly'
 appinfo='Trace text position relative to entity'/>

<field name='traceFontSizetype='SFFloatvalue='0.8accessType='initializeOnly'
 appinfo='Trace text scale'/>

<field name='traceJavatype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='whether or not to include verbose trace comments in Java console in order to help debug network connectivity'/>

<field name='localTraceEnabledtype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='Whether EspduTransformTrace debug scripting is visible inside the X3D scene'/>
</ProtoInterface>
<ProtoBody>
<Group>
<Group DEF='PrimaryControlScripts'>
<!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
<!-- OverriddenDefaultEspduTransformNode -->
<!-- ROUTE information for TraceScript node:  [from ReadIntervalTraceClock.cycleTime to update ] [from WriteIntervalTraceClock.cycleTime to update ] [from ActivationTouchSensor.isActive to touched ] [from readInterval to ReadIntervalTraceClock.cycleInterval ] [from writeInterval to WriteIntervalTraceClock.cycleInterval ] [from traceString to TraceText.string ] [from fired1 to FireSequenceScript.set_fired1 ] [from fired2 to FireSequenceScript.set_fired2 ] [from fireTime to FireSequenceScript.fireTime ] -->
<Script DEF='TraceScriptdirectOutput='truemustEvaluate='true'>
<field name='espduTransformNodetype='SFNodeaccessType='initializeOnly'
 appinfo='initialize with <EspduTransform USE="NodeToBeTraced"/>'/>

<field name='traceColortype='SFColoraccessType='initializeOnly'
 appinfo='Trace text color'/>

<field name='traceOffsettype='SFVec3faccessType='initializeOnly'
 appinfo='Trace text position relative to entity'/>

<field name='traceFontSizetype='SFFloataccessType='initializeOnly'
 appinfo='Trace text scale'/>

<field name='traceJavatype='SFBoolaccessType='initializeOnly'
 appinfo='(not passable???) whether or not to include verbose trace comments in Java console in order to help debug network connectivity'/>

<field name='localTraceEnabledtype='SFBoolaccessType='initializeOnly'
 appinfo='Whether EspduTransformTrace debug scripting has verbose output'/>

<field name='touchedtype='SFBoolaccessType='inputOnly'/>
<field name='updatetype='SFTimeaccessType='inputOnly'
 appinfo='Used by TimeSensor clocks to trigger processEvents() method.'/>

<!-- Changed-value outputs -->
<field name='markingtype='SFStringaccessType='outputOnly'/>
<field name='readIntervaltype='SFTimeaccessType='outputOnly'/>
<field name='writeIntervaltype='SFTimeaccessType='outputOnly'/>
<field name='fired1type='SFBoolaccessType='outputOnly'/>
<field name='fired2type='SFBoolaccessType='outputOnly'/>
<field name='fireTimetype='SFTimeaccessType='outputOnly'/>
<field name='traceStringtype='MFStringaccessType='outputOnly'/>
<!-- other internal state variables -->
<field name='prior_markingtype='SFStringaccessType='initializeOnly'/>
<field name='prior_readIntervaltype='SFTimevalue='-1accessType='initializeOnly'/>
<field name='prior_writeIntervaltype='SFTimevalue='-1accessType='initializeOnly'/>
<field name='prior_fired1type='SFBoolvalue='falseaccessType='initializeOnly'/>
<field name='prior_fired2type='SFBoolvalue='falseaccessType='initializeOnly'/>
<field name='prior_translationtype='SFVec3fvalue='0 0 0accessType='initializeOnly'/>
<field name='prior_geoCoords_changedtype='SFVec3dvalue='0 0 0accessType='initializeOnly'/>
<IS>
<connect nodeField='espduTransformNodeprotoField='espduTransformNode'/>
<connect nodeField='traceColorprotoField='traceColor'/>
<connect nodeField='traceOffsetprotoField='traceOffset'/>
<connect nodeField='traceFontSizeprotoField='traceFontSize'/>
<connect nodeField='traceJavaprotoField='traceJava'/>
<connect nodeField='localTraceEnabledprotoField='localTraceEnabled'/>
</IS>
<![CDATA[
              
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.print ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString);
}
function alwaysPrint(outputString)
{
	Browser.print ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString);
}

            
]]>
</Script>
<!-- Clocks stimulate the processEvents() method -->
<!-- ROUTE information for ReadIntervalTraceClock node:  [from TraceScript.readInterval to cycleInterval ] [from cycleTime to TraceScript.update ] -->
<TimeSensor DEF='ReadIntervalTraceClockloop='true'/>
<ROUTE fromNode='TraceScriptfromField='readIntervaltoNode='ReadIntervalTraceClocktoField='cycleInterval'/>
<ROUTE fromNode='ReadIntervalTraceClockfromField='cycleTimetoNode='TraceScripttoField='update'/>
<!-- ROUTE information for WriteIntervalTraceClock node:  [from TraceScript.writeInterval to cycleInterval ] [from cycleTime to TraceScript.update ] -->
<TimeSensor DEF='WriteIntervalTraceClockloop='true'/>
<ROUTE fromNode='TraceScriptfromField='writeIntervaltoNode='WriteIntervalTraceClocktoField='cycleInterval'/>
<ROUTE fromNode='WriteIntervalTraceClockfromField='cycleTimetoNode='TraceScripttoField='update'/>
<!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
<Script DEF='DEBUG_JAVASCRIPTdirectOutput='true'>
<field name='espduTransformNodetype='SFNodeaccessType='initializeOnly'
 appinfo='initialize with <EspduTransform USE="NodeToBeTraced"/>'/>

<field name='localTraceEnabledtype='SFBoolaccessType='initializeOnly'
 appinfo='Whether EspduTransformTrace debug scripting has verbose output'/>

<field name='articulationParameterCounttype='SFInt32accessType='inputOnly'/>
<field name='MFmarkingtype='MFStringaccessType='outputOnly'/>
<field name='set_rotationtype='SFRotationaccessType='inputOnly'/>
<field name='timestamptype='SFTimeaccessType='inputOnly'/>
<field name='set_translationtype='SFVec3faccessType='inputOnly'/>
<field name='detonatedtype='SFBoolaccessType='inputOnly'/>
<field name='marking_address_texttype='MFStringaccessType='outputOnly'/>
<field name='resulttype='SFBoolaccessType='outputOnly'/>
<field name='entityIDtype='SFInt32value='0accessType='initializeOnly'/>
<field name='translation_texttype='MFStringaccessType='outputOnly'/>
<field name='porttype='SFInt32value='0accessType='initializeOnly'/>
<field name='collidedtype='SFBoolaccessType='inputOnly'/>
<field name='rtpHeaderHeardtype='SFBoolaccessType='inputOnly'/>
<field name='rotation_texttype='MFStringaccessType='outputOnly'/>
<field name='applicationIDtype='SFInt32value='0accessType='initializeOnly'/>
<field name='addresstype='SFStringaccessType='initializeOnly'/>
<field name='activetype='SFBoolvalue='trueaccessType='initializeOnly'/>
<field name='touchtype='SFTimeaccessType='inputOnly'/>
<field name='markingtype='SFStringaccessType='initializeOnly'/>
<field name='siteIDtype='SFInt32value='0accessType='initializeOnly'/>
<IS>
<connect nodeField='espduTransformNodeprotoField='espduTransformNode'/>
<connect nodeField='localTraceEnabledprotoField='localTraceEnabled'/>
</IS>
<![CDATA[
              
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.print ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString);
}
function alwaysPrint(outputString)
{
	Browser.print ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString);
}

            
]]>
</Script>
</Group>
<Group DEF='TouchToActivateGroup'>
<!-- ROUTE information for ActivationTouchSensor node:  [from isActive to TraceScript.touched ] -->
<TouchSensor DEF='ActivationTouchSensordescription='Touch trace text to toggle simple or verbose'/>
<ROUTE fromNode='ActivationTouchSensorfromField='isActivetoNode='TraceScripttoField='touched'/>
<LOD range='300.0 3000.0 40000.0'>
<Transform>
<IS>
<connect nodeField='translationprotoField='traceOffset'/>
</IS>
<Billboard>
<Shape>
<Appearance>
<Material DEF='TextColordiffuseColor='0 0 0'>
<IS>
<connect nodeField='emissiveColorprotoField='traceColor'/>
</IS>
</Material>
</Appearance>
<!-- ROUTE information for TraceText node:  [from TraceScript.traceString to string ] -->
<Text DEF='TraceText'>
<FontStyle DEF='TraceFontjustify='"MIDDLE" "MIDDLE"'>
<IS>
<connect nodeField='sizeprotoField='traceFontSize'/>
</IS>
</FontStyle>
</Text>
</Shape>
<ROUTE fromNode='TraceScriptfromField='traceStringtoNode='TraceTexttoField='string'/>
<Transform translation='0.0 -0.25 0.0'>
<Shape>
<Appearance>
<Material USE='TextColor'/>
</Appearance>
<Text DEF='DEBUG_ROTATION'>
<FontStyle USE='TraceFont'/>
</Text>
</Shape>
</Transform>
<Transform translation='0.0 -0.5 0.0'>
<Shape>
<Appearance>
<Material USE='TextColor'/>
</Appearance>
<Text DEF='DEBUG_MARKING_ADDRESS'>
<FontStyle USE='TraceFont'/>
</Text>
</Shape>
</Transform>
</Billboard>
</Transform>
<WorldInfo/>
<Billboard axisOfRotation='0.0 0.0 0.0'>
<Transform translation='0.0 800.0 0.0'>
<Shape>
<Appearance>
<Material USE='TextColor'/>
</Appearance>
<Text DEF='LONG_RANGE_MARKING'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='125.0style='BOLD'/>
</Text>
</Shape>
</Transform>
<Transform translation='0.0 40.0 0.0'>
<Shape>
<Appearance>
<Material USE='TextColor'/>
</Appearance>
<Box size='50.0 50.0 50.0'/>
</Shape>
</Transform>
</Billboard>
<WorldInfo/>
</LOD>
</Group>
<Group DEF='LineOfFireGroup'>
<Shape>
<Appearance>
<Material emissiveColor='0.3 0.15 0.15'/>
</Appearance>
<IndexedLineSet colorIndex='0 1 -1coordIndex='0 1 -1'>
<Color color='0.0 1.0 0.0 1.0 0.0 0.0'/>
<!-- ROUTE information for LineOfFireCoordinateNode node:  [from SetFireLineEndpoints.pointArray to set_point ] -->
<Coordinate DEF='LineOfFireCoordinateNodepoint='0.0 0.0 0.0 0.0 0.0 20.0'/>
</IndexedLineSet>
</Shape>
<!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
<!-- ROUTE information for SetFireLineEndpoints node:  [from pointArray to LineOfFireCoordinateNode.set_point ] -->
<Script DEF='SetFireLineEndpoints'>
<field name='set_munitionStartPointtype='SFVec3faccessType='inputOnly'/>
<field name='set_munitionEndPointtype='SFVec3faccessType='inputOnly'/>
<field name='holdArraytype='MFVec3faccessType='initializeOnly'>
<!-- default initialization is NULL node array -->
</field>
<field name='pointArraytype='MFVec3faccessType='outputOnly'>
<!-- default initialization is NULL node array -->
</field>
<field name='localTraceEnabledtype='SFBoolaccessType='initializeOnly'
 appinfo='Whether EspduTransformTrace debug scripting has verbose output'/>

<IS>
<connect nodeField='localTraceEnabledprotoField='localTraceEnabled'/>
</IS>
<![CDATA[
              
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.print ('[EspduTransformTrace SetFireLineEndpoints] ' + outputString);
}
function alwaysPrint(outputString)
{
	Browser.print ('[EspduTransformTrace SetFireLineEndpoints] ' + outputString);
}

            
]]>
</Script>
<ROUTE fromNode='SetFireLineEndpointsfromField='pointArraytoNode='LineOfFireCoordinateNodetoField='set_point'/>
<!-- Needed? -->
<!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
<!-- ROUTE information for FireSequenceScript node:  [from TraceScript.fired1 to set_fired1 ] [from TraceScript.fired2 to set_fired2 ] [from TraceScript.fireTime to fireTime ] -->
<Script DEF='FireSequenceScriptmustEvaluate='true'>
<field name='set_fired1type='SFBoolaccessType='inputOnly'/>
<field name='set_fired2type='SFBoolaccessType='inputOnly'/>
<field name='fireTimetype='SFTimeaccessType='inputOnly'/>
<field name='firstFired1type='SFBoolaccessType='outputOnly'/>
<field name='firstFired2type='SFBoolaccessType='outputOnly'/>
<field name='localTraceEnabledtype='SFBoolaccessType='initializeOnly'
 appinfo='Whether EspduTransformTrace debug scripting has verbose output'/>

<IS>
<connect nodeField='localTraceEnabledprotoField='localTraceEnabled'/>
</IS>
<![CDATA[
              
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.print ('[EspduTransformTrace FireSequenceScript] ' + outputString);
}
function alwaysPrint(outputString)
{
	Browser.print ('[EspduTransformTrace FireSequenceScript] ' + outputString);
}

            
]]>
</Script>
<ROUTE fromNode='TraceScriptfromField='fired1toNode='FireSequenceScripttoField='set_fired1'/>
<ROUTE fromNode='TraceScriptfromField='fired2toNode='FireSequenceScripttoField='set_fired2'/>
<ROUTE fromNode='TraceScriptfromField='fireTimetoNode='FireSequenceScripttoField='fireTime'/>
<!-- ROUTE firstFired1/2 to sound node? -->
</Group>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- ============================================================ -->
<!-- Begin rendered scene -->
<!-- Ensure that instances of this node are placed at the top-most level and are not translated away from the local world coordinates origin. -->
<!-- ROUTE information for EspduTrans node:  [from translation to TraceTransform.set_translation ] [from rotation to TraceTransform.set_rotation ] -->
<EspduTransform DEF='EspduTransaddress='224.2.181.145marking='Example PDUnetworkMode='networkReaderport='62040readInterval='10writeInterval='10containerField='children'>
<Viewpoint description='moving viewpoint'/>
<Shape>
<Text string='"EspduTransform body goes here"'>
<FontStyle DEF='FontJustifyMiddlejustify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='0 0.6 0.6'/>
</Appearance>
</Shape>
<!-- Typically place EspduTransformTrace as a child of corresponding EspduTransform so that outputs are positioned relatively. -->
</EspduTransform>
<!-- ROUTE information for TraceTransform node:  [from EspduTrans.translation to set_translation ] [from EspduTrans.rotation to set_rotation ] -->
<Transform DEF='TraceTransform'>
<!-- EspduTransformTrace cannot be a direct child of EspduTransform or a directed-acyclic graph (DAG) error occurs -->
<!-- EspduTransformTrace must be translated for trace text to stay local to parent EspduTransform -->
<ProtoInstance name='EspduTransformTrace'>
<fieldValue name='espduTransformNode'>
<EspduTransform USE='EspduTranscontainerField='children'/>
</fieldValue>
<fieldValue name='traceColorvalue='0.9 0.4 0.2'/>
<fieldValue name='traceFontSizevalue='0.8'/>
<fieldValue name='traceJavavalue='true'/>
<fieldValue name='localTraceEnabledvalue='true'/>
</ProtoInstance>
<ROUTE fromNode='EspduTransfromField='translationtoNode='TraceTransformtoField='set_translation'/>
<ROUTE fromNode='EspduTransfromField='rotationtoNode='TraceTransformtoField='set_rotation'/>
</Transform>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definitions : EspduTransform, EspduTransformTrace

Index for DEF nodes : ActivationTouchSensor, AddressHolder, ApplicationIdState, ArticulationParameterArrayHolder, ArticulationParameterCountHolder, CacheExposedFieldNodes, DEBUG_JAVASCRIPT, DEBUG_MARKING_ADDRESS, DEBUG_ROTATION, DisTransformNode, EntityIdState, EspduScriptNode, EspduTrans, FireSequenceScript, FontJustifyMiddle, LineOfFireCoordinateNode, LineOfFireGroup, LocalState, LONG_RANGE_MARKING, MarkingState, MasterState, MulticastAddressHolder, MulticastPortHolder, MunitionPointNode, NetworkingScriptAndReadWriteClocks, NetworkModeState, PortHolder, PrimaryControlScripts, ReaderState, ReadIntervalClock, ReadIntervalTraceClock, ReadWriteIntervalState, SetFireLineEndpoints, SiteIdState, TextColor, TouchToActivateGroup, TraceFont, TraceScript, TraceText, TraceTransform, WriteIntervalClock, WriteIntervalTraceClock

Index for Viewpoint image : Viewpoint_1
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->