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 | <meta name='title' content=' WheelsFrontExample.x3d '/> |
6 | <meta name='description' content='An animation example of front wheels and axle Prototype. Clicking axle triggers animation for gear up or gear down of wheels and axle performance.'/> |
7 | <meta name='creator' content='Etsuko Lippi'/> |
8 | <meta name='created' content='11 July 2003'/> |
9 | <meta name='modified' content='20 October 2019'/> |
10 | <meta name='generator' content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
11 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontExample.x3d '/> |
12 | <meta name='subject' content='front wheels, gear-up and gear-down example'/> |
13 | <meta name='license' content='../../license.html'/> |
14 | </head> |
15 | <Scene> |
16 | <WorldInfo title='WheelsFrontExample.x3d'/> |
17 | <ExternProtoDeclare name='WheelsFront' url=' "WheelsFrontPrototype.x3d#WheelsFront" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d#WheelsFront" "WheelsFrontPrototype.wrl#WheelsFront" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.wrl#WheelsFront" '> |
18 | <field name='gearup' type='SFBool' accessType='inputOnly'/> |
19 | <field name='gearupOut' type='SFBool' accessType='outputOnly'/> |
20 | <field name='animationStartTime' type='SFTime' accessType='inputOnly'/> |
21 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
22 | </ExternProtoDeclare> |
23 | <Background skyColor='0.7 0.7 0.7'/> |
24 | <Group> |
25 | <Transform DEF='GearUpDown'> |
26 |
<!-- ROUTE information for ExampleSelectionScript node:
[from GearUpDownTouchSensor.isActive to enabled
]
[from status to WP.gearup
]
-->
<Script DEF='ExampleSelectionScript'> |
27 | <field name='landed' type='SFInt32' value='-1' accessType='initializeOnly'/> |
28 | <field name='enabled' type='SFBool' accessType='inputOnly'/> |
29 | <field name='status' type='SFBool' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function tracePrint (outputString) { var traceEnabled = false; if (traceEnabled) Browser.println ('[trace] ' + outputString); } function enabled(value, timeStamp) { tracePrint('enabled = ' + value); if (value == true) { if (landed == -1) { status = false; landed = 0; } if (landed == 0) { if (status) { status = false; } else { status = true; } } else { landed = 0; return; } } //print ('status = ' + status); }
]]>
|
|
31 | </Script> |
32 | </Transform> |
33 |
<!-- ROUTE information for GearUpDownTouchSensor node:
[from touchTime to WP.animationStartTime
]
[from isActive to ExampleSelectionScript.enabled
]
-->
<TouchSensor DEF='GearUpDownTouchSensor' description='click for gears up/down'/> |
34 |
<!-- ROUTE information for WP node:
[from GearUpDownTouchSensor.touchTime to animationStartTime
]
[from ExampleSelectionScript.status to gearup
]
-->
<ProtoInstance name='WheelsFront' DEF='WP'> |
35 | <fieldValue name='traceEnabled' value='true'/> |
36 | </ProtoInstance> |
37 | </Group> |
38 | < ROUTE fromNode='GearUpDownTouchSensor' fromField='touchTime' toNode='WP' toField='animationStartTime'/> |
39 | < ROUTE fromNode='GearUpDownTouchSensor' fromField='isActive' toNode='ExampleSelectionScript' toField='enabled'/> |
40 | < ROUTE fromNode='ExampleSelectionScript' fromField='status' toNode='WP' toField='gearup'/> |
41 | </Scene> |
42 | </X3D> |
Event Graph ROUTE Table entries with 3 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.
GearUpDownTouchSensor
TouchSensor touchTime SFTime |
WP
ProtoInstance animationStartTime SFTime |
|||||
GearUpDownTouchSensor
TouchSensor isActive SFBool |
ExampleSelectionScript
Script enabled SFBool |
then
|
ExampleSelectionScript
Script status SFBool |
WP
ProtoInstance gearup SFBool |
WP
ProtoInstance WheelsFront |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
<!--
Color-coding 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.
-->