1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
|
3 | <X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'> |
4 | <head> |
5 | <component level='1' name='DIS'/> |
6 | <meta name='title' content='EspduTransformPrototypes.x3d'/> |
7 | <meta name='description' content='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.'/> |
8 | <meta name='creator' content='Don Brutzman, Don McGregor, and Duane Davis'/> |
9 | <meta name='created' content='7 December 2001'/> |
10 | <meta name='modified' content='14 October 2023'/> |
11 | <meta name=' warning ' content=' under development but mostly complete. need articulationParameters and miscellany fields connected. ROUTE firstFired1/2 to sound node? '/> |
12 | <meta name='reference' content='/vrtp/mil/navy/nps/dis/EspduTransformPROTO.wrl'/> |
13 | <meta name='reference' content='/vrtp/mil/navy/nps/dis/EspduTransform.java'/> |
14 | <meta name='reference' content='https://www.web3d.org/WorkingGroups/vrtp/mil/navy/nps/dis/EspduTransform.java'/> |
15 | <meta name='reference' content='https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/ExternProtoDeclareDefinitions.x3d'/> |
16 | <meta name='reference' content='DIS Find-It-Fast Guide at Simulation Interoperability Standards Organization (SISO)'/> |
17 | <meta name='reference' content='available via https://www.sisostds.org/DigitalLibrary.aspx?EntryId=16568'/> |
18 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/EspduTransformPrototypes.x3d'/> |
19 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
20 | <meta name='license' content='../license.html'/> |
21 | </head> |
22 | <Scene> |
23 | <!-- ============================================================ --> |
24 | <!-- 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. --> |
25 | <!-- ============================================================ --> |
26 | <ProtoDeclare name='EspduTransform' appinfo='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.'> |
27 | <ProtoInterface> |
28 |
<field name='geoCoords_changed' type='SFVec3d' accessType='outputOnly'
appinfo='Double precision output for 64-bit Espdu translation usable by georeferenced nodes.'/> |
29 | <!-- Standard Transform fields --> |
30 |
<field name='addChildren' type='MFNode' accessType='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."/> |
31 |
<field name='removeChildren' type='MFNode' accessType='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."/> |
32 |
<field name='children' type='MFNode' accessType='inputOutput'
appinfo='Children nodes within translation and rotation coordinate system of EspduTransform. Hint: XML encoding can include child node(s) directly.'> |
33 | <!-- default initialization is NULL node array --> |
34 | </field> |
35 |
<field name='translation' type='SFVec3f' value='0 0 0' accessType='inputOutput'
appinfo='Position of children relative to local coordinate system usually read from (or written to) remote networked EspduTransform nodes.'/> |
36 |
<field name='rotation' type='SFRotation' value='0 0 1 0' accessType='inputOutput'
appinfo='Orientation of children relative to local coordinate system usually read from (or written to) remote networked EspduTransform nodes.'/> |
37 |
<field name='center' type='SFVec3f' value='0 0 0' accessType='inputOutput'
appinfo='Translation offset from origin of local coordinate system.'/> |
38 |
<field name='scale' type='SFVec3f' value='1 1 1' accessType='inputOutput'
appinfo='Non-uniform x-y-z scale of child coordinate system adjusted by center and scaleOrientation.'/> |
39 |
<field name='scaleOrientation' type='SFRotation' value='0 0 1 0' accessType='inputOutput'
appinfo='Non-uniform x-y-z scale of child coordinate system adjusted by center and scaleOrientation.'/> |
40 |
<field name='bboxCenter' type='SFVec3f' value='0 0 0' accessType='initializeOnly'
appinfo='Bounding box center: position offset from origin of local coordinate system.'/> |
41 |
<field name='bboxSize' type='SFVec3f' value='-1 -1 -1' accessType='initializeOnly'
appinfo='Bounding box size: automatically calculated can be specified as an optimization or constraint.'/> |
42 | <!-- Entity identity --> |
43 |
<field name='marking' type='SFString' accessType='inputOutput'
appinfo='0-to-11 character label for entity.'/> |
44 |
<field name='siteID' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535] EntityID: unique ID for that site.'/> |
45 |
<field name='applicationID' type='SFInt32' value='1' accessType='inputOutput'
appinfo='[065535] EntityID: application ID unique ID for application at that site.'/> |
46 |
<field name='entityID' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535] EntityID: unique ID for entity within that application.'/> |
47 | <!-- Networking configuration parameters --> |
48 |
<field name='address' type='SFString' value='localhost' accessType='inputOutput'
appinfo='multicast address or else "localhost" listens to local defaultBridge'/> |
49 |
<field name='port' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535] multicast port or else listen to local defaultBridge'/> |
50 |
<field name='multicastRelayHost' type='SFString' accessType='inputOutput'
appinfo='Host name of multicast relay server to provide alternative connectivity if local native multicast traffic not heard.'/> |
51 |
<field name='multicastRelayPort' type='SFInt32' value='0' accessType='inputOutput'
appinfo='Connection port on multicast relay server.'/> |
52 |
<field name='networkMode' type='SFString' value='standAlone' accessType='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)'/> |
53 |
<field name='isStandAlone' type='SFBool' accessType='outputOnly'
appinfo='Whether networkMode standAlone (ignore network but still respond to local events) is true/false'/> |
54 |
<field name='isMaster' type='SFBool' accessType='outputOnly'
appinfo="Whether networkMode 'networkWriter' (output to network as master entity at writeInterval) is true/false"/> |
55 |
<field name='isRemote' type='SFBool' accessType='outputOnly'
appinfo="Whether networkMode 'networkReader' (listen to network as ghost entity) is true/false"/> |
56 |
<field name='readInterval' type='SFTime' value='0.1' accessType='inputOutput'
appinfo='seconds between read updates'/> |
57 |
<field name='writeInterval' type='SFTime' value='1.0' accessType='inputOutput'
appinfo='seconds between write updates'/> |
58 |
<field name='isActive' type='SFBool' accessType='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.'/> |
59 |
<field name='timestamp' type='SFTime' accessType='outputOnly'
appinfo='DIS timestamp in VRML units'/> |
60 |
<field name='rtpHeaderExpected' type='SFBool' value='false' accessType='initializeOnly'
appinfo='whether RTP header is expected to be prepended to DIS packet'/> |
61 |
<field name='isRtpHeaderHeard' type='SFBool' accessType='outputOnly'
appinfo='whether RTP header was found prepended to DIS packet'/> |
62 | <!-- Further identification --> |
63 |
<field name='forceID' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
64 |
<field name='entityKind' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
65 |
<field name='entityDomain' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
66 |
<field name='entityCountry' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
67 |
<field name='entityCategory' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
68 |
<field name='entitySubCategory' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
69 |
<field name='entitySpecific' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
70 |
<field name='entityExtra' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[0255]'/> |
71 | <field name='linearVelocity' type='SFVec3f' value='0 0 0' accessType='inputOutput'/> |
72 | <field name='linearAcceleration' type='SFVec3f' value='0 0 0' accessType='inputOutput'/> |
73 |
<field name='deadReckoning' type='SFInt32' value='0' accessType='inputOutput'
appinfo='Dead reckoning algorithm being used to project position/orientation with velocities/accelerations.'/> |
74 | <!-- Collision PDU events --> |
75 | <field name='isCollided' type='SFBool' accessType='outputOnly'/> |
76 | <field name='collideTime' type='SFTime' accessType='outputOnly'/> |
77 |
<field name='eventApplicationID' type='SFInt32' accessType='outputOnly'
appinfo='[065535]'/> |
78 |
<field name='eventSiteID' type='SFInt32' accessType='outputOnly'
appinfo='[065535]'/> |
79 |
<field name='eventEntityID' type='SFInt32' accessType='outputOnly'
appinfo='[065535]'/> |
80 |
<field name='collisionType' type='SFInt32' accessType='outputOnly'
appinfo='[0255]'/> |
81 |
<field name='eventNumber' type='SFInt32' accessType='outputOnly'
appinfo='[065535]'/> |
82 | <!-- Fire, Detonate PDU events --> |
83 | <field name='fired1' type='SFBool' value='false' accessType='inputOutput'/> |
84 | <field name='fired2' type='SFBool' value='false' accessType='inputOutput'/> |
85 | <field name='firedTime' type='SFTime' accessType='outputOnly'/> |
86 | <field name='munitionStartPoint' type='SFVec3f' value='0 0 0' accessType='inputOutput'/> |
87 | <field name='munitionEndPoint' type='SFVec3f' value='0 0 0' accessType='inputOutput'/> |
88 |
<field name='munitionApplicationID' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
89 |
<field name='munitionSiteID' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
90 |
<field name='munitionEntityID' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
91 |
<field name='fireMissionIndex' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
92 |
<field name='warhead' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
93 |
<field name='fuse' type='SFInt32' value='0' accessType='inputOutput'
appinfo='[065535]'/> |
94 |
<field name='munitionQuantity' type='SFInt32' value='1' accessType='inputOutput'
appinfo='[065535]'/> |
95 |
<field name='firingRate' type='SFInt32' value='1' accessType='inputOutput'
appinfo='[065535]'/> |
96 | <field name='firingRange' type='SFFloat' value='0' accessType='inputOutput'/> |
97 | <field name='isDetonated' type='SFBool' accessType='outputOnly'/> |
98 | <field name='detonateTime' type='SFTime' accessType='outputOnly'/> |
99 | <field name='detonationLocation' type='SFVec3f' accessType='outputOnly'/> |
100 | <field name='detonationRelativeLocation' type='SFVec3f' accessType='outputOnly'/> |
101 | <field name='detonationResult' type='SFInt32' accessType='outputOnly'/> |
102 | <!-- Articulation parameters are extra blocks of information, appended one by one to end of regular Espdu. --> |
103 |
<field name='articulationParameterCount' type='SFInt32' value='0' accessType='inputOutput'
appinfo='range [078]. Indicates the number of appended parameters that are being used to describe articulation of various segments of the entity model.'/> |
104 |
<field name='articulationParameterDesignatorArray' type='MFInt32' accessType='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.'> |
105 | <!-- default initialization is NULL node array --> |
106 | </field> |
107 |
<field name='articulationParameterChangeIndicatorArray' type='MFInt32' accessType='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.'> |
108 | <!-- default initialization is NULL node array --> |
109 | </field> |
110 |
<field name='articulationParameterIdPartAttachedToArray' type='MFInt32' accessType='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.'> |
111 | <!-- default initialization is NULL node array --> |
112 | </field> |
113 |
<field name='articulationParameterTypeArray' type='MFInt32' accessType='inputOutput'
appinfo='range [0255]. The Parameter Type entries in the articulationParameterTypeArray are specified by 32-bit enumeration values.'> |
114 | <!-- default initialization is NULL node array --> |
115 | </field> |
116 |
<field name='articulationParameterArray' type='MFFloat' accessType='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.'> |
117 | <!-- default initialization is NULL node array --> |
118 | </field> |
119 | <field name='set_articulationParameterValue0' type='SFFloat' accessType='inputOnly'/> |
120 | <field name='set_articulationParameterValue1' type='SFFloat' accessType='inputOnly'/> |
121 | <field name='set_articulationParameterValue2' type='SFFloat' accessType='inputOnly'/> |
122 | <field name='set_articulationParameterValue3' type='SFFloat' accessType='inputOnly'/> |
123 | <field name='set_articulationParameterValue4' type='SFFloat' accessType='inputOnly'/> |
124 | <field name='set_articulationParameterValue5' type='SFFloat' accessType='inputOnly'/> |
125 | <field name='set_articulationParameterValue6' type='SFFloat' accessType='inputOnly'/> |
126 | <field name='set_articulationParameterValue7' type='SFFloat' accessType='inputOnly'/> |
127 | <field name='articulationParameterValue0_changed' type='SFFloat' accessType='outputOnly'/> |
128 | <field name='articulationParameterValue1_changed' type='SFFloat' accessType='outputOnly'/> |
129 | <field name='articulationParameterValue2_changed' type='SFFloat' accessType='outputOnly'/> |
130 | <field name='articulationParameterValue3_changed' type='SFFloat' accessType='outputOnly'/> |
131 | <field name='articulationParameterValue4_changed' type='SFFloat' accessType='outputOnly'/> |
132 | <field name='articulationParameterValue5_changed' type='SFFloat' accessType='outputOnly'/> |
133 | <field name='articulationParameterValue6_changed' type='SFFloat' accessType='outputOnly'/> |
134 | <field name='articulationParameterValue7_changed' type='SFFloat' accessType='outputOnly'/> |
135 | </ProtoInterface> |
136 | <ProtoBody> |
137 | <!-- First node inside a PrototypeDeclaration is the node type of the ProtoInstance --> |
138 |
<!-- Transform
DisTransformNode is a DEF node that has 1 USE node: USE_1 -->
<Transform DEF='DisTransformNode'> |
139 | <IS> |
140 | <connect nodeField='addChildren' protoField='addChildren'/> |
141 | <connect nodeField='removeChildren' protoField='removeChildren'/> |
142 | <connect nodeField='children' protoField='children'/> |
143 | <connect nodeField='translation' protoField='translation'/> |
144 | <connect nodeField='rotation' protoField='rotation'/> |
145 | <connect nodeField='center' protoField='center'/> |
146 | <connect nodeField='scale' protoField='scale'/> |
147 | <connect nodeField='scaleOrientation' protoField='scaleOrientation'/> |
148 | <connect nodeField='bboxCenter' protoField='bboxCenter'/> |
149 | <connect nodeField='bboxSize' protoField='bboxSize'/> |
150 | </IS> |
151 | </Transform> |
152 | <Group DEF='CacheExposedFieldNodes'> |
153 | <!-- 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. --> |
154 |
<!-- Anchor
MarkingState is a DEF node that has 1 USE node: USE_1 -->
<Anchor DEF='MarkingState'> |
155 | <IS> |
156 | <connect nodeField='description' protoField='marking'/> |
157 | </IS> |
158 | </Anchor> |
159 |
<!-- Switch
SiteIdState is a DEF node that has 1 USE node: USE_1 -->
<Switch DEF='SiteIdState' whichChoice='-1'> |
160 | <IS> |
161 | <connect nodeField='whichChoice' protoField='siteID'/> |
162 | </IS> |
163 | </Switch> |
164 |
<!-- Switch
ApplicationIdState is a DEF node that has 1 USE node: USE_1 -->
<Switch DEF='ApplicationIdState' whichChoice='-1'> |
165 | <IS> |
166 | <connect nodeField='whichChoice' protoField='applicationID'/> |
167 | </IS> |
168 | </Switch> |
169 |
<!-- Switch
EntityIdState is a DEF node that has 1 USE node: USE_1 -->
<Switch DEF='EntityIdState' whichChoice='-1'> |
170 | <IS> |
171 | <connect nodeField='whichChoice' protoField='entityID'/> |
172 | </IS> |
173 | </Switch> |
174 |
<!-- Anchor
NetworkModeState is a DEF node that has 1 USE node: USE_1 -->
<Anchor DEF='NetworkModeState'> |
175 | <IS> |
176 | <connect nodeField='description' protoField='networkMode'/> |
177 | </IS> |
178 | </Anchor> |
179 | <NavigationInfo DEF='ReaderState'> |
180 | <IS> |
181 | <connect nodeField='headlight' protoField='isRemote'/> |
182 | </IS> |
183 | </NavigationInfo> |
184 | <NavigationInfo DEF='MasterState'> |
185 | <IS> |
186 | <connect nodeField='headlight' protoField='isMaster'/> |
187 | </IS> |
188 | </NavigationInfo> |
189 | <NavigationInfo DEF='LocalState'> |
190 | <IS> |
191 | <connect nodeField='headlight' protoField='isStandAlone'/> |
192 | </IS> |
193 | </NavigationInfo> |
194 |
<!-- TimeSensor
ReadWriteIntervalState is a DEF node that has 1 USE node: USE_1 -->
<TimeSensor DEF='ReadWriteIntervalState'> |
195 | <IS> |
196 | <connect nodeField='startTime' protoField='readInterval'/> |
197 | <connect nodeField='stopTime' protoField='writeInterval'/> |
198 | </IS> |
199 | </TimeSensor> |
200 |
<!-- Transform
MunitionPointNode is a DEF node that has 1 USE node: USE_1 -->
<Transform DEF='MunitionPointNode'> |
201 | <IS> |
202 | <connect nodeField='translation' protoField='munitionStartPoint'/> |
203 | <connect nodeField='center' protoField='munitionEndPoint'/> |
204 | </IS> |
205 | </Transform> |
206 | <Switch whichChoice='-1'> |
207 |
<!-- Anchor
AddressHolder is a DEF node that has 1 USE node: USE_1 -->
<Anchor DEF='AddressHolder'> |
208 | <IS> |
209 | <connect nodeField='description' protoField='address'/> |
210 | </IS> |
211 | </Anchor> |
212 |
<!-- Anchor
MulticastAddressHolder is a DEF node that has 1 USE node: USE_1 -->
<Anchor DEF='MulticastAddressHolder'> |
213 | <IS> |
214 | <connect nodeField='description' protoField='multicastRelayHost'/> |
215 | </IS> |
216 | </Anchor> |
217 |
<!-- Switch
PortHolder is a DEF node that has 1 USE node: USE_1 -->
<Switch DEF='PortHolder' whichChoice='-1'> |
218 | <IS> |
219 | <connect nodeField='whichChoice' protoField='port'/> |
220 | </IS> |
221 | </Switch> |
222 |
<!-- Switch
MulticastPortHolder is a DEF node that has 1 USE node: USE_1 -->
<Switch DEF='MulticastPortHolder' whichChoice='-1'> |
223 | <IS> |
224 | <connect nodeField='whichChoice' protoField='multicastRelayPort'/> |
225 | </IS> |
226 | </Switch> |
227 |
<!-- Switch
ArticulationParameterCountHolder is a DEF node that has 1 USE node: USE_1 -->
<Switch DEF='ArticulationParameterCountHolder' whichChoice='-1'> |
228 | <IS> |
229 | <connect nodeField='whichChoice' protoField='articulationParameterCount'/> |
230 | </IS> |
231 | </Switch> |
232 |
<!-- ScalarInterpolator
ArticulationParameterArrayHolder is a DEF node that has 1 USE node: USE_1 -->
<ScalarInterpolator DEF='ArticulationParameterArrayHolder'> |
233 | <IS> |
234 | <connect nodeField='keyValue' protoField='articulationParameterArray'/> |
235 | </IS> |
236 | </ScalarInterpolator> |
237 | </Switch> |
238 | </Group> |
239 | <!-- Nonrendering Script that connects network communications to interfaces --> |
240 | <Group DEF='NetworkingScriptAndReadWriteClocks'> |
241 | <!-- Fields in the Script are directly mapped to the PrototypeDeclare field-tag interfaces by using the IS construct --> |
242 | <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) --> |
243 |
<!-- ROUTE information for EspduScriptNode node:
[from ReadIntervalClock.cycleTime to update
]
[from WriteIntervalClock.cycleTime to update
]
-->
<Script DEF='EspduScriptNode' directOutput='true' mustEvaluate='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" "https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/EspduTransform.class" '> |
244 | <!-- Generic events --> |
245 |
<field name='geoCoords_changed' type='SFVec3d' accessType='outputOnly'
appinfo='Double precision outputs for 64-bit Espdu translation.'/> |
246 | <field name='traceJava' type='SFBool' value='false' accessType='initializeOnly'/> |
247 |
<field name='update' type='SFTime' accessType='inputOnly'
appinfo='Used by TimeSensor clocks to trigger processEvents() method.'/> |
248 | <field name='transformNode' type='SFNode' accessType='initializeOnly'> |
249 | <Transform USE='DisTransformNode'/> |
250 | </field> |
251 | <field name='markingNode' type='SFNode' accessType='initializeOnly'> |
252 | <Anchor USE='MarkingState'/> |
253 | </field> |
254 | <!-- Initialization fields --> |
255 | <field name='siteIdNode' type='SFNode' accessType='initializeOnly'> |
256 | <Switch USE='SiteIdState'/> |
257 | </field> |
258 | <field name='applicationIdNode' type='SFNode' accessType='initializeOnly'> |
259 | <Switch USE='ApplicationIdState'/> |
260 | </field> |
261 | <field name='entityIdNode' type='SFNode' accessType='initializeOnly'> |
262 | <Switch USE='EntityIdState'/> |
263 | </field> |
264 | <field name='addressNode' type='SFNode' accessType='initializeOnly'> |
265 | <Anchor USE='AddressHolder'/> |
266 | </field> |
267 | <field name='multicastAddressNode' type='SFNode' accessType='initializeOnly'> |
268 | <Anchor USE='MulticastAddressHolder'/> |
269 | </field> |
270 | <field name='portNode' type='SFNode' accessType='initializeOnly'> |
271 | <Switch USE='PortHolder'/> |
272 | </field> |
273 | <field name='multicastPortNode' type='SFNode' accessType='initializeOnly'> |
274 | <Switch USE='MulticastPortHolder'/> |
275 | </field> |
276 | <field name='networkModeNode' type='SFNode' accessType='initializeOnly'> |
277 | <Anchor USE='NetworkModeState'/> |
278 | </field> |
279 | <field name='readWriteIntervalNode' type='SFNode' accessType='initializeOnly'> |
280 | <TimeSensor USE='ReadWriteIntervalState'/> |
281 | </field> |
282 | <field name='isActive' type='SFBool' accessType='outputOnly'/> |
283 | <field name='timestamp' type='SFTime' accessType='outputOnly'/> |
284 | <field name='rtpHeaderExpected' type='SFBool' accessType='initializeOnly'/> |
285 | <field name='isRtpHeaderHeard' type='SFBool' accessType='outputOnly'/> |
286 | <field name='isCollided' type='SFBool' accessType='outputOnly'/> |
287 | <field name='collideTime' type='SFTime' accessType='outputOnly'/> |
288 | <field name='isDetonated' type='SFBool' accessType='outputOnly'/> |
289 | <field name='detonateTime' type='SFTime' accessType='outputOnly'/> |
290 | <field name='firedTime' type='SFTime' accessType='outputOnly'/> |
291 | <field name='munitionPointNode' type='SFNode' accessType='initializeOnly'> |
292 | <Transform USE='MunitionPointNode'/> |
293 | </field> |
294 | <field name='articulationParameterCountNode' type='SFNode' accessType='initializeOnly'> |
295 | <Switch USE='ArticulationParameterCountHolder'/> |
296 | </field> |
297 | <field name='articulationParameterArrayNode' type='SFNode' accessType='initializeOnly'> |
298 | <ScalarInterpolator USE='ArticulationParameterArrayHolder'/> |
299 | </field> |
300 | <field name='set_articulationParameterValue0' type='SFFloat' accessType='inputOnly'/> |
301 | <field name='set_articulationParameterValue1' type='SFFloat' accessType='inputOnly'/> |
302 | <field name='set_articulationParameterValue2' type='SFFloat' accessType='inputOnly'/> |
303 | <field name='set_articulationParameterValue3' type='SFFloat' accessType='inputOnly'/> |
304 | <field name='set_articulationParameterValue4' type='SFFloat' accessType='inputOnly'/> |
305 | <field name='set_articulationParameterValue5' type='SFFloat' accessType='inputOnly'/> |
306 | <field name='set_articulationParameterValue6' type='SFFloat' accessType='inputOnly'/> |
307 | <field name='set_articulationParameterValue7' type='SFFloat' accessType='inputOnly'/> |
308 | <field name='articulationParameterValue0_changed' type='SFFloat' accessType='outputOnly'/> |
309 | <field name='articulationParameterValue1_changed' type='SFFloat' accessType='outputOnly'/> |
310 | <field name='articulationParameterValue2_changed' type='SFFloat' accessType='outputOnly'/> |
311 | <field name='articulationParameterValue3_changed' type='SFFloat' accessType='outputOnly'/> |
312 | <field name='articulationParameterValue4_changed' type='SFFloat' accessType='outputOnly'/> |
313 | <field name='articulationParameterValue5_changed' type='SFFloat' accessType='outputOnly'/> |
314 | <field name='articulationParameterValue6_changed' type='SFFloat' accessType='outputOnly'/> |
315 | <field name='articulationParameterValue7_changed' type='SFFloat' accessType='outputOnly'/> |
316 | <IS> |
317 | <connect nodeField='geoCoords_changed' protoField='geoCoords_changed'/> |
318 | <connect nodeField='isActive' protoField='isActive'/> |
319 | <connect nodeField='timestamp' protoField='timestamp'/> |
320 | <connect nodeField='rtpHeaderExpected' protoField='rtpHeaderExpected'/> |
321 | <connect nodeField='isRtpHeaderHeard' protoField='isRtpHeaderHeard'/> |
322 | <connect nodeField='isCollided' protoField='isCollided'/> |
323 | <connect nodeField='collideTime' protoField='collideTime'/> |
324 | <connect nodeField='isDetonated' protoField='isDetonated'/> |
325 | <connect nodeField='detonateTime' protoField='detonateTime'/> |
326 | <connect nodeField='firedTime' protoField='firedTime'/> |
327 | <connect nodeField='set_articulationParameterValue0' protoField='set_articulationParameterValue0'/> |
328 | <connect nodeField='set_articulationParameterValue1' protoField='set_articulationParameterValue1'/> |
329 | <connect nodeField='set_articulationParameterValue2' protoField='set_articulationParameterValue2'/> |
330 | <connect nodeField='set_articulationParameterValue3' protoField='set_articulationParameterValue3'/> |
331 | <connect nodeField='set_articulationParameterValue4' protoField='set_articulationParameterValue4'/> |
332 | <connect nodeField='set_articulationParameterValue5' protoField='set_articulationParameterValue5'/> |
333 | <connect nodeField='set_articulationParameterValue6' protoField='set_articulationParameterValue6'/> |
334 | <connect nodeField='set_articulationParameterValue7' protoField='set_articulationParameterValue7'/> |
335 | <connect nodeField='articulationParameterValue0_changed' protoField='articulationParameterValue0_changed'/> |
336 | <connect nodeField='articulationParameterValue1_changed' protoField='articulationParameterValue1_changed'/> |
337 | <connect nodeField='articulationParameterValue2_changed' protoField='articulationParameterValue2_changed'/> |
338 | <connect nodeField='articulationParameterValue3_changed' protoField='articulationParameterValue3_changed'/> |
339 | <connect nodeField='articulationParameterValue4_changed' protoField='articulationParameterValue4_changed'/> |
340 | <connect nodeField='articulationParameterValue5_changed' protoField='articulationParameterValue5_changed'/> |
341 | <connect nodeField='articulationParameterValue6_changed' protoField='articulationParameterValue6_changed'/> |
342 | <connect nodeField='articulationParameterValue7_changed' protoField='articulationParameterValue7_changed'/> |
343 | </IS> |
344 | </Script> |
345 | <!-- 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). --> |
346 |
<!-- ROUTE information for ReadIntervalClock node:
[from cycleTime to EspduScriptNode.update
]
-->
<TimeSensor DEF='ReadIntervalClock' loop='true'> |
347 | <IS> |
348 | <connect nodeField='cycleInterval' protoField='readInterval'/> |
349 | </IS> |
350 | </TimeSensor> |
351 |
<!-- ROUTE information for WriteIntervalClock node:
[from cycleTime to EspduScriptNode.update
]
-->
<TimeSensor DEF='WriteIntervalClock' loop='true'> |
352 | <IS> |
353 | <connect nodeField='cycleInterval' protoField='writeInterval'/> |
354 | </IS> |
355 | </TimeSensor> |
356 | < ROUTE fromNode='ReadIntervalClock' fromField='cycleTime' toNode='EspduScriptNode' toField='update'/> |
357 | < ROUTE fromNode='WriteIntervalClock' fromField='cycleTime' toNode='EspduScriptNode' toField='update'/> |
358 | </Group> |
359 | </ProtoBody> |
360 | </ProtoDeclare> |
361 | <!-- ============================================================ --> |
362 | <ProtoDeclare name='EspduTransformTrace' appinfo="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."> |
363 | <ProtoInterface> |
364 | <!-- Special trace fields (beyond regular EspduTransform signature) --> |
365 |
<field name='espduTransformNode' type='SFNode' accessType='initializeOnly'
appinfo='initialize with <EspduTransform USE="NodeToBeTraced"/> so that networked data is passed by reference'> |
366 | <!-- provide <EspduTransform USE="nodeName"/> i.e. copy-by=reference node to initialize --> |
367 | </field> |
368 |
<field name='traceColor' type='SFColor' value='1 0.4 0.05' accessType='initializeOnly'
appinfo='Trace text color'/> |
369 |
<field name='traceOffset' type='SFVec3f' value='0 2.5 0' accessType='initializeOnly'
appinfo='Trace text position relative to entity'/> |
370 |
<field name='traceFontSize' type='SFFloat' value='0.8' accessType='initializeOnly'
appinfo='Trace text scale'/> |
371 |
<field name='traceJava' type='SFBool' value='false' accessType='initializeOnly'
appinfo='whether or not to include verbose trace comments in Java console in order to help debug network connectivity'/> |
372 |
<field name='localTraceEnabled' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Whether EspduTransformTrace debug scripting is visible inside the X3D scene'/> |
373 | </ProtoInterface> |
374 | <ProtoBody> |
375 | <Group> |
376 | <Group DEF='PrimaryControlScripts'> |
377 | <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) --> |
378 | <!-- OverriddenDefaultEspduTransformNode --> |
379 |
<!-- 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='TraceScript' directOutput='true' mustEvaluate='true'> |
380 |
<field name='espduTransformNode' type='SFNode' accessType='initializeOnly'
appinfo='initialize with <EspduTransform USE="NodeToBeTraced"/>'/> |
381 |
<field name='traceColor' type='SFColor' accessType='initializeOnly'
appinfo='Trace text color'/> |
382 |
<field name='traceOffset' type='SFVec3f' accessType='initializeOnly'
appinfo='Trace text position relative to entity'/> |
383 |
<field name='traceFontSize' type='SFFloat' accessType='initializeOnly'
appinfo='Trace text scale'/> |
384 |
<field name='traceJava' type='SFBool' accessType='initializeOnly'
appinfo='(not passable???) whether or not to include verbose trace comments in Java console in order to help debug network connectivity'/> |
385 |
<field name='localTraceEnabled' type='SFBool' accessType='initializeOnly'
appinfo='Whether EspduTransformTrace debug scripting has verbose output'/> |
386 | <field name='touched' type='SFBool' accessType='inputOnly'/> |
387 |
<field name='update' type='SFTime' accessType='inputOnly'
appinfo='Used by TimeSensor clocks to trigger processEvents() method.'/> |
388 | <!-- Changed-value outputs --> |
389 | <field name='marking' type='SFString' accessType='outputOnly'/> |
390 | <field name='readInterval' type='SFTime' accessType='outputOnly'/> |
391 | <field name='writeInterval' type='SFTime' accessType='outputOnly'/> |
392 | <field name='fired1' type='SFBool' accessType='outputOnly'/> |
393 | <field name='fired2' type='SFBool' accessType='outputOnly'/> |
394 | <field name='fireTime' type='SFTime' accessType='outputOnly'/> |
395 | <field name='traceString' type='MFString' accessType='outputOnly'/> |
396 | <!-- other internal state variables --> |
397 | <field name='prior_marking' type='SFString' accessType='initializeOnly'/> |
398 | <field name='prior_readInterval' type='SFTime' value='-1' accessType='initializeOnly'/> |
399 | <field name='prior_writeInterval' type='SFTime' value='-1' accessType='initializeOnly'/> |
400 | <field name='prior_fired1' type='SFBool' value='false' accessType='initializeOnly'/> |
401 | <field name='prior_fired2' type='SFBool' value='false' accessType='initializeOnly'/> |
402 | <field name='prior_translation' type='SFVec3f' value='0 0 0' accessType='initializeOnly'/> |
403 | <field name='prior_geoCoords_changed' type='SFVec3d' value='0 0 0' accessType='initializeOnly'/> |
404 | <IS> |
405 | <connect nodeField='espduTransformNode' protoField='espduTransformNode'/> |
406 | <connect nodeField='traceColor' protoField='traceColor'/> |
407 | <connect nodeField='traceOffset' protoField='traceOffset'/> |
408 | <connect nodeField='traceFontSize' protoField='traceFontSize'/> |
409 | <connect nodeField='traceJava' protoField='traceJava'/> |
410 | <connect nodeField='localTraceEnabled' protoField='localTraceEnabled'/> |
411 | </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.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); }
]]>
|
|
413 | </Script> |
414 | <!-- Clocks stimulate the processEvents() method --> |
415 |
<!-- ROUTE information for ReadIntervalTraceClock node:
[from TraceScript.readInterval to cycleInterval
]
[from cycleTime to TraceScript.update
]
-->
<TimeSensor DEF='ReadIntervalTraceClock' loop='true'/> |
416 | < ROUTE fromNode='TraceScript' fromField='readInterval' toNode='ReadIntervalTraceClock' toField='cycleInterval'/> |
417 | < ROUTE fromNode='ReadIntervalTraceClock' fromField='cycleTime' toNode='TraceScript' toField='update'/> |
418 |
<!-- ROUTE information for WriteIntervalTraceClock node:
[from TraceScript.writeInterval to cycleInterval
]
[from cycleTime to TraceScript.update
]
-->
<TimeSensor DEF='WriteIntervalTraceClock' loop='true'/> |
419 | < ROUTE fromNode='TraceScript' fromField='writeInterval' toNode='WriteIntervalTraceClock' toField='cycleInterval'/> |
420 | < ROUTE fromNode='WriteIntervalTraceClock' fromField='cycleTime' toNode='TraceScript' toField='update'/> |
421 | <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) --> |
422 | <Script DEF='DEBUG_JAVASCRIPT' directOutput='true'> |
423 |
<field name='espduTransformNode' type='SFNode' accessType='initializeOnly'
appinfo='initialize with <EspduTransform USE="NodeToBeTraced"/>'/> |
424 |
<field name='localTraceEnabled' type='SFBool' accessType='initializeOnly'
appinfo='Whether EspduTransformTrace debug scripting has verbose output'/> |
425 | <field name='articulationParameterCount' type='SFInt32' accessType='inputOnly'/> |
426 | <field name='MFmarking' type='MFString' accessType='outputOnly'/> |
427 | <field name='set_rotation' type='SFRotation' accessType='inputOnly'/> |
428 | <field name='timestamp' type='SFTime' accessType='inputOnly'/> |
429 | <field name='set_translation' type='SFVec3f' accessType='inputOnly'/> |
430 | <field name='detonated' type='SFBool' accessType='inputOnly'/> |
431 | <field name='marking_address_text' type='MFString' accessType='outputOnly'/> |
432 | <field name='result' type='SFBool' accessType='outputOnly'/> |
433 | <field name='entityID' type='SFInt32' value='0' accessType='initializeOnly'/> |
434 | <field name='translation_text' type='MFString' accessType='outputOnly'/> |
435 | <field name='port' type='SFInt32' value='0' accessType='initializeOnly'/> |
436 | <field name='collided' type='SFBool' accessType='inputOnly'/> |
437 | <field name='rtpHeaderHeard' type='SFBool' accessType='inputOnly'/> |
438 | <field name='rotation_text' type='MFString' accessType='outputOnly'/> |
439 | <field name='applicationID' type='SFInt32' value='0' accessType='initializeOnly'/> |
440 | <field name='address' type='SFString' accessType='initializeOnly'/> |
441 | <field name='active' type='SFBool' value='true' accessType='initializeOnly'/> |
442 | <field name='touch' type='SFTime' accessType='inputOnly'/> |
443 | <field name='marking' type='SFString' accessType='initializeOnly'/> |
444 | <field name='siteID' type='SFInt32' value='0' accessType='initializeOnly'/> |
445 | <IS> |
446 | <connect nodeField='espduTransformNode' protoField='espduTransformNode'/> |
447 | <connect nodeField='localTraceEnabled' protoField='localTraceEnabled'/> |
448 | </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.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace ' + espduTransformNode.marking + '] ' + outputString); }
]]>
|
|
450 | </Script> |
451 | </Group> |
452 | <Group DEF='TouchToActivateGroup'> |
453 |
<!-- ROUTE information for ActivationTouchSensor node:
[from isActive to TraceScript.touched
]
-->
<TouchSensor DEF='ActivationTouchSensor' description='Touch trace text to toggle simple or verbose'/> |
454 | < ROUTE fromNode='ActivationTouchSensor' fromField='isActive' toNode='TraceScript' toField='touched'/> |
455 | <LOD range='300.0 3000.0 40000.0'> |
456 | <Transform> |
457 | <IS> |
458 | <connect nodeField='translation' protoField='traceOffset'/> |
459 | </IS> |
460 | <Billboard> |
461 | <Shape> |
462 | <Appearance> |
463 | |
464 | <IS> |
465 | <connect nodeField='emissiveColor' protoField='traceColor'/> |
466 | </IS> |
467 | </Material> |
468 | </Appearance> |
469 |
<!-- ROUTE information for TraceText node:
[from TraceScript.traceString to string
]
-->
<Text DEF='TraceText'> |
470 | |
471 | <IS> |
472 | <connect nodeField='size' protoField='traceFontSize'/> |
473 | </IS> |
474 | </FontStyle> |
475 | </Text> |
476 | </Shape> |
477 | < ROUTE fromNode='TraceScript' fromField='traceString' toNode='TraceText' toField='string'/> |
478 | <Transform translation='0.0 -0.25 0.0'> |
479 | <Shape> |
480 | <Appearance> |
481 | <Material USE='TextColor'/> |
482 | </Appearance> |
483 | <Text DEF='DEBUG_ROTATION'> |
484 | <FontStyle USE='TraceFont'/> |
485 | </Text> |
486 | </Shape> |
487 | </Transform> |
488 | <Transform translation='0.0 -0.5 0.0'> |
489 | <Shape> |
490 | <Appearance> |
491 | <Material USE='TextColor'/> |
492 | </Appearance> |
493 | <Text DEF='DEBUG_MARKING_ADDRESS'> |
494 | <FontStyle USE='TraceFont'/> |
495 | </Text> |
496 | </Shape> |
497 | </Transform> |
498 | </Billboard> |
499 | </Transform> |
500 | <WorldInfo/> |
501 | <Billboard axisOfRotation='0.0 0.0 0.0'> |
502 | <Transform translation='0.0 800.0 0.0'> |
503 | <Shape> |
504 | <Appearance> |
505 | <Material USE='TextColor'/> |
506 | </Appearance> |
507 | <Text DEF='LONG_RANGE_MARKING'> |
508 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='125.0' style='BOLD'/> |
509 | </Text> |
510 | </Shape> |
511 | </Transform> |
512 | <Transform translation='0.0 40.0 0.0'> |
513 | <Shape> |
514 | <Appearance> |
515 | <Material USE='TextColor'/> |
516 | </Appearance> |
517 | <Box size='50.0 50.0 50.0'/> |
518 | </Shape> |
519 | </Transform> |
520 | </Billboard> |
521 | <WorldInfo/> |
522 | </LOD> |
523 | </Group> |
524 | <Group DEF='LineOfFireGroup'> |
525 | <Shape> |
526 | <Appearance> |
527 | <Material emissiveColor='0.3 0.15 0.15'/> |
528 | </Appearance> |
529 | <IndexedLineSet colorIndex='0 1 -1' coordIndex='0 1 -1'> |
530 | <Color color='0.0 1.0 0.0 1.0 0.0 0.0'/> |
531 |
<!-- ROUTE information for LineOfFireCoordinateNode node:
[from SetFireLineEndpoints.pointArray to set_point
]
-->
<Coordinate DEF='LineOfFireCoordinateNode' point='0.0 0.0 0.0 0.0 0.0 20.0'/> |
532 | </IndexedLineSet> |
533 | </Shape> |
534 | <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) --> |
535 |
<!-- ROUTE information for SetFireLineEndpoints node:
[from pointArray to LineOfFireCoordinateNode.set_point
]
-->
<Script DEF='SetFireLineEndpoints'> |
536 | <field name='set_munitionStartPoint' type='SFVec3f' accessType='inputOnly'/> |
537 | <field name='set_munitionEndPoint' type='SFVec3f' accessType='inputOnly'/> |
538 | <field name='holdArray' type='MFVec3f' accessType='initializeOnly'> |
539 | <!-- default initialization is NULL node array --> |
540 | </field> |
541 | <field name='pointArray' type='MFVec3f' accessType='outputOnly'> |
542 | <!-- default initialization is NULL node array --> |
543 | </field> |
544 |
<field name='localTraceEnabled' type='SFBool' accessType='initializeOnly'
appinfo='Whether EspduTransformTrace debug scripting has verbose output'/> |
545 | <IS> |
546 | <connect nodeField='localTraceEnabled' protoField='localTraceEnabled'/> |
547 | </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.println ('[EspduTransformTrace SetFireLineEndpoints] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace SetFireLineEndpoints] ' + outputString); }
]]>
|
|
549 | </Script> |
550 | < ROUTE fromNode='SetFireLineEndpoints' fromField='pointArray' toNode='LineOfFireCoordinateNode' toField='set_point'/> |
551 | <!-- Needed? --> |
552 | <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) --> |
553 |
<!-- ROUTE information for FireSequenceScript node:
[from TraceScript.fired1 to set_fired1
]
[from TraceScript.fired2 to set_fired2
]
[from TraceScript.fireTime to fireTime
]
-->
<Script DEF='FireSequenceScript' mustEvaluate='true'> |
554 | <field name='set_fired1' type='SFBool' accessType='inputOnly'/> |
555 | <field name='set_fired2' type='SFBool' accessType='inputOnly'/> |
556 | <field name='fireTime' type='SFTime' accessType='inputOnly'/> |
557 | <field name='firstFired1' type='SFBool' accessType='outputOnly'/> |
558 | <field name='firstFired2' type='SFBool' accessType='outputOnly'/> |
559 |
<field name='localTraceEnabled' type='SFBool' accessType='initializeOnly'
appinfo='Whether EspduTransformTrace debug scripting has verbose output'/> |
560 | <IS> |
561 | <connect nodeField='localTraceEnabled' protoField='localTraceEnabled'/> |
562 | </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.println ('[EspduTransformTrace FireSequenceScript] ' + outputString); } function alwaysPrint(outputString) { Browser.println ('[EspduTransformTrace FireSequenceScript] ' + outputString); }
]]>
|
|
564 | </Script> |
565 | < ROUTE fromNode='TraceScript' fromField='fired1' toNode='FireSequenceScript' toField='set_fired1'/> |
566 | < ROUTE fromNode='TraceScript' fromField='fired2' toNode='FireSequenceScript' toField='set_fired2'/> |
567 | < ROUTE fromNode='TraceScript' fromField='fireTime' toNode='FireSequenceScript' toField='fireTime'/> |
568 | <!-- ROUTE firstFired1/2 to sound node? --> |
569 | </Group> |
570 | </Group> |
571 | </ProtoBody> |
572 | </ProtoDeclare> |
573 | <!-- ============================================================ --> |
574 | <!-- Begin rendered scene --> |
575 | <!-- Ensure that instances of this node are placed at the top-most level and are not translated away from the local world coordinates origin. --> |
576 |
<!-- EspduTransform
EspduTrans is a DEF node that has 1 USE node: USE_1
<!-- ROUTE information for EspduTrans node: [from translation to TraceTransform.set_translation ] [from rotation to TraceTransform.set_rotation ] --> <EspduTransform DEF='EspduTrans' address='224.2.181.145' marking='Example PDU' networkMode='networkReader' port='62040' readInterval='10' writeInterval='10' containerField='children'> |
577 | <Viewpoint description='moving viewpoint'/> |
578 | <Shape> |
579 | <Text string='"EspduTransform body goes here"'> |
580 | <FontStyle DEF='FontJustifyMiddle' justify='"MIDDLE" "MIDDLE"'/> |
581 | </Text> |
582 | <Appearance> |
583 | <Material diffuseColor='0 0.6 0.6'/> |
584 | </Appearance> |
585 | </Shape> |
586 | <!-- Typically place EspduTransformTrace as a child of corresponding EspduTransform so that outputs are positioned relatively. --> |
587 | </EspduTransform> |
588 |
<!-- ROUTE information for TraceTransform node:
[from EspduTrans.translation to set_translation
]
[from EspduTrans.rotation to set_rotation
]
-->
<Transform DEF='TraceTransform'> |
589 | <!-- EspduTransformTrace cannot be a direct child of EspduTransform or a directed-acyclic graph (DAG) error occurs --> |
590 | <!-- EspduTransformTrace must be translated for trace text to stay local to parent EspduTransform --> |
591 | <ProtoInstance name='EspduTransformTrace'> |
592 | <fieldValue name='espduTransformNode'> |
593 | <EspduTransform USE='EspduTrans' containerField='children'/> |
594 | </fieldValue> |
595 | <fieldValue name='traceColor' value='0.9 0.4 0.2'/> |
596 | <fieldValue name='traceFontSize' value='0.8'/> |
597 | <fieldValue name='traceJava' value='true'/> |
598 | <fieldValue name='localTraceEnabled' value='true'/> |
599 | </ProtoInstance> |
600 | < ROUTE fromNode='EspduTrans' fromField='translation' toNode='TraceTransform' toField='set_translation'/> |
601 | < ROUTE fromNode='EspduTrans' fromField='rotation' toNode='TraceTransform' toField='set_rotation'/> |
602 | </Transform> |
603 | </Scene> |
604 | </X3D> |
Event Graph ROUTE Table entries with 14 ROUTE connections total, showing X3D event-model relationships for this scene.
Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.
ReadIntervalClock
TimeSensor cycleTime SFTime |
EspduScriptNode
Script update SFTime |
WriteIntervalClock
TimeSensor cycleTime SFTime |
EspduScriptNode
Script update SFTime |
SetFireLineEndpoints
Script pointArray MFVec3f |
LineOfFireCoordinateNode
Coordinate set_point MFVec3f |
ProtoInstance EspduTransformTrace |
No ROUTE connection found for output events from this node. This ProtoInstance contains SFNode/MFNode fieldValue declaration with direct access to other nodes, and thus has potential to produce run-time animation. |
EspduTrans
EspduTransform translation SFVec3f |
TraceTransform
Transform set_translation SFVec3f |
|
EspduTrans
EspduTransform rotation SFRotation |
TraceTransform
Transform set_rotation SFRotation |
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->