<?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>
<meta name='titlecontent='TimeDelaySensorExample.x3d'/>
<meta name='descriptioncontent='Time delay sensor design pattern: example use.'/>
<meta name='creatorcontent='Don Brutzman and MV4204 class'/>
<meta name='createdcontent='18 August 2003'/>
<meta name='modifiedcontent='14 January 2014'/>
<meta name='referencecontent='TimeDelaySensorPrototype.x3d'/>
<meta name='referencecontent=' http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/time.html '/>
<meta name='referencecontent=' http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/utils.html '/>
<meta name='subjectcontent='TimeDelaySensor'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for ExternProtoDeclare definition : TimeDelaySensor

Index for DEF nodes : AnimationClock, ColorChangerRGB, DelayTimer, TextAnimationGroup, TextColor, TextTouchGroup, TouchSensorActive
-->
<Scene>
<ExternProtoDeclare name='TimeDelaySensorappinfo='TimeSensor functionality commences after delayInterval pause'
  url=' "TimeDelaySensorPrototype.x3d#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor" "TimeDelaySensorPrototype.wrl#TimeDelaySensor" "https://savage.nps.edu/Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor" '>
<field name='descriptiontype='SFStringaccessType='inputOutput'
 appinfo='describe the purpose of this sensor'/>

<field name='startTimetype='SFTimeaccessType='inputOutput'/>
<field name='enabledtype='SFBoolaccessType='inputOutput'/>
<field name='delayIntervaltype='SFTimeaccessType='inputOutput'
 appinfo='seconds'/>

<field name='delayCompleteTimetype='SFTimeaccessType='outputOnly'/>
<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
</ExternProtoDeclare>
<!-- ==================== -->
<Group DEF='TextTouchGroup'>
<Shape>
<Text string='"click text then wait for" "3 second time delay" "before color changes"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<!-- ROUTE information for TextColor node:  [from ColorChangerRGB.value_changed to diffuseColor ] -->
<Material DEF='TextColor'/>
</Appearance>
</Shape>
<!-- ROUTE information for TouchSensorActive node:  [from touchTime to DelayTimer.set_startTime ] -->
<TouchSensor DEF='TouchSensorActivedescription='click to initiate time delay and color change'/>
</Group>
<!-- ==================== -->
<Group DEF='TextAnimationGroup'>
<!-- ROUTE information for DelayTimer node:  [from TouchSensorActive.touchTime to set_startTime ] [from delayCompleteTime to AnimationClock.set_startTime ] -->
<ProtoInstance name='TimeDelaySensorDEF='DelayTimer'>
<fieldValue name='delayIntervalvalue='3'/>
<fieldValue name='traceEnabledvalue='true'/>
</ProtoInstance>
<!-- ROUTE information for AnimationClock node:  [from DelayTimer.delayCompleteTime to set_startTime ] [from fraction_changed to ColorChangerRGB.set_fraction ] -->
<TimeSensor DEF='AnimationClockcycleInterval='2'/>
<ROUTE fromNode='TouchSensorActivefromField='touchTimetoNode='DelayTimertoField='set_startTime'/>
<ROUTE fromNode='DelayTimerfromField='delayCompleteTimetoNode='AnimationClocktoField='set_startTime'/>
<!-- ROUTE information for ColorChangerRGB node:  [from AnimationClock.fraction_changed to set_fraction ] [from value_changed to TextColor.diffuseColor ] -->
<ColorInterpolator DEF='ColorChangerRGBkey='0 0.5 1keyValue='1 0 0 0 1 0 0 0 1'/>
<ROUTE fromNode='AnimationClockfromField='fraction_changedtoNode='ColorChangerRGBtoField='set_fraction'/>
<ROUTE fromNode='ColorChangerRGBfromField='value_changedtoNode='TextColortoField='diffuseColor'/>
</Group>
</Scene>
</X3D>
<!--

Index for ExternProtoDeclare definition : TimeDelaySensor

Index for DEF nodes : AnimationClock, ColorChangerRGB, DelayTimer, TextAnimationGroup, TextColor, TextTouchGroup, TouchSensorActive
-->

<!-- 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 -->