<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "http://www.web3d.org/specifications/x3d-3.2.dtd">
<X3D profile='Immersive' version='3.2 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.2.xsd '>
<head>
<meta name='titlecontent='TimeSensorEaseInEaseOutPrototype.x3d'/>
<meta name='descriptioncontent='Time sensor ease-in ease-out design pattern, implemented as a reusable prototype node.'/>
<meta name='creatorcontent='Don Brutzman and MV4204 class'/>
<meta name='createdcontent='4 April 2006'/>
<meta name='modifiedcontent='14 January 2014'/>
<meta name='referencecontent='TimeSensorEaseInEaseOutExample.x3d'/>
<meta name='referencecontent='TimeDelaySensorPrototype.x3d'/>
<meta name='subjectcontent='TimeSensorEaseInEaseOut'/>
<meta name='infocontent='X3D v3.1 or greater'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for ProtoDeclare definition : TimeSensorEaseInEaseOut

Index for DEF nodes : PiecewiseLinearDelayFilter, TimeDelayClock
-->
<Scene>
<ProtoDeclare name='TimeSensorEaseInEaseOutappinfo='TimeSensorEaseInEaseOut is a TimeSensor node with gradual start and stop rates'>
<ProtoInterface>
<field name='enabledtype='SFBoolvalue='trueaccessType='inputOutput'
 appinfo='whether sensor is active'/>

<field name='looptype='SFBoolvalue='falseaccessType='inputOutput'
 appinfo='repeat indefinitely when loop=true, repeat only once when loop=false'/>

<field name='cycleIntervaltype='SFTimevalue='1accessType='inputOutput'
 appinfo='loop duration in seconds'/>

<field name='fraction_changedtype='SFFloataccessType='outputOnly'
 appinfo='fraction_changed sends values in range [0,1] showing time progress in the current cycle'/>

<field name='isActivetype='SFBoolaccessType='outputOnly'
 appinfo='isActive true/false events are sent when TimeSensor starts/stops running'/>

<field name='isPausedtype='SFBoolaccessType='outputOnly'
 appinfo='isPaused true/false events are sent when TimeSensor is paused/resumed'/>

<field name='startTimetype='SFTimevalue='0accessType='inputOutput'
 appinfo='when current time exceeds startTime, isActive becomes true and sensor becomes active'/>

<field name='stopTimetype='SFTimevalue='0accessType='inputOutput'
 appinfo='when current time exceeds stopTime, isActive becomes false and sensor becomes inactive'/>

<field name='pauseTimetype='SFTimevalue='0accessType='inputOutput'
 appinfo='when current time exceeds pauseTime, isPaused becomes false and sensor becomes paused'/>

<field name='resumeTimetype='SFTimevalue='0accessType='inputOutput'
 appinfo='when current time exceeds resumeTime, isPaused becomes false and sensor resumes running'/>

<field name='cycleTimetype='SFTimeaccessType='outputOnly'
 appinfo='cycleTime sends a time event at startTime, and also at the beginning of each new cycle'/>

<field name='elapsedTimetype='SFTimeaccessType='outputOnly'
 appinfo='elapsed time since TimeSensor activated/running, cumulative in seconds, not counting any paused time'/>

<field name='timetype='SFTimeaccessType='outputOnly'
 appinfo='absolute time (since January 1, 1970) for each event loop'/>
</ProtoInterface>
<ProtoBody>
<Group>
<!-- ROUTE information for TimeDelayClock node:  [from fraction_changed to PiecewiseLinearDelayFilter.set_fraction ] -->
<TimeSensor DEF='TimeDelayClock'>
<IS>
<connect nodeField='enabledprotoField='enabled'/>
<connect nodeField='loopprotoField='loop'/>
<connect nodeField='cycleIntervalprotoField='cycleInterval'/>
<!-- fraction_changed is handled by ScalarInterpolator -->
<connect nodeField='isActiveprotoField='isActive'/>
<connect nodeField='isPausedprotoField='isPaused'/>
<connect nodeField='startTimeprotoField='startTime'/>
<connect nodeField='stopTimeprotoField='stopTime'/>
<connect nodeField='pauseTimeprotoField='pauseTime'/>
<connect nodeField='resumeTimeprotoField='resumeTime'/>
<connect nodeField='cycleTimeprotoField='cycleTime'/>
<connect nodeField='elapsedTimeprotoField='elapsedTime'/>
<connect nodeField='timeprotoField='time'/>
</IS>
</TimeSensor>
<!-- ROUTE information for PiecewiseLinearDelayFilter node:  [from TimeDelayClock.fraction_changed to set_fraction ] -->
<ScalarInterpolator DEF='PiecewiseLinearDelayFilterkey='0 0.1 0.9 1keyValue='0 0.03 0.97 1'>
<IS>
<connect nodeField='value_changedprotoField='fraction_changed'/>
</IS>
</ScalarInterpolator>
<ROUTE fromNode='TimeDelayClockfromField='fraction_changedtoNode='PiecewiseLinearDelayFiltertoField='set_fraction'/>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- ====================================== -->
<!-- Example use -->
<Anchor description='TimeSensorEaseInEaseOut Example'
  url=' "TimeSensorEaseInEaseOutExample.x3d" "https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.x3d" "TimeSensorEaseInEaseOutExample.wrl" "https://savage.nps.edu/Savage/Tools/Animation/TimeSensorEaseInEaseOutExample.wrl" '>
<Shape>
<Text string='"TimeSensorEaseInEaseOutPrototype" "defines a prototype" "" "Click text to see" "TimeSensorEaseInEaseOutExample scene"'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='0.7'/>
</Text>
<Appearance>
<Material diffuseColor='1 1 0.2'/>
</Appearance>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : TimeSensorEaseInEaseOut

Index for DEF nodes : PiecewiseLinearDelayFilter, TimeDelayClock
-->

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