<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Interactive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.3.xsd '>
<head>
<meta name='titlecontent='BooleanToggleExample.x3d'/>
<meta name='descriptioncontent='A BooleanToggle button determines whether an animated Cone is jittery or not.'/>
<meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
<meta name='createdcontent='9 October 2006'/>
<meta name='modifiedcontent='28 April 2023'/>
<meta name=' TODO content=' BS Contact BitManagement Bug Report submitted 28 November 2014 http://www.bitmanagement.de/en/contact '/>
<meta name='referencecontent=' https://X3dGraphics.com '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='rightscontent='Copyright 2006, Daly Realism and Don Brutzman'/>
<meta name='subjectcontent=' X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com '/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanToggleExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for DEF nodes : PauseOff, PauseOn, Shaker, ShakingCone, Tee, Timer, Toggler, TouchButton

Index for Viewpoint image : Viewpoint_1
-->
<Scene>
<WorldInfo title='Boolean Toggle Example'/>
<Viewpoint description='Select red button to toggle cone jitter'/>
<Transform rotation='1 0 0 1.57'>
<Shape>
<Appearance>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Cylinder height='.5radius='.5'/>
</Shape>
<!-- ROUTE information for TouchButton node:  [from isActive to Toggler.set_boolean ] -->
<TouchSensor DEF='TouchButtondescription='touch to activate'/>
</Transform>
<Transform translation='2 0 0'>
<!-- ROUTE information for ShakingCone node:  [from Shaker.value_changed to translation ] -->
<Transform DEF='ShakingCone'>
<Shape>
<Appearance>
<Material diffuseColor='0 .8 0'/>
</Appearance>
<Cone/>
</Shape>
</Transform>
</Transform>
<!-- ROUTE information for Toggler node:  [from TouchButton.isActive to set_boolean ] [from toggle_changed to Tee.set_boolean ] -->
<BooleanToggle DEF='TogglercontainerField='children'/>
<ROUTE fromNode='TouchButtonfromField='isActivetoNode='TogglertoField='set_boolean'/>
<!-- ROUTE information for Tee node:  [from Toggler.toggle_changed to set_boolean ] [from inputTrue to PauseOn.set_boolean ] [from inputFalse to PauseOff.set_boolean ] -->
<BooleanFilter DEF='TeecontainerField='children'/>
<ROUTE fromNode='TogglerfromField='toggle_changedtoNode='TeetoField='set_boolean'/>
<!-- ROUTE information for PauseOn node:  [from Tee.inputTrue to set_boolean ] [from triggerTime to Timer.pauseTime ] -->
<TimeTrigger DEF='PauseOncontainerField='children'/>
<ROUTE fromNode='TeefromField='inputTruetoNode='PauseOntoField='set_boolean'/>
<!-- ROUTE information for PauseOff node:  [from Tee.inputFalse to set_boolean ] [from triggerTime to Timer.resumeTime ] -->
<TimeTrigger DEF='PauseOffcontainerField='children'/>
<ROUTE fromNode='TeefromField='inputFalsetoNode='PauseOfftoField='set_boolean'/>
<!-- ROUTE information for Timer node:  [from PauseOn.triggerTime to pauseTime ] [from PauseOff.triggerTime to resumeTime ] [from fraction_changed to Shaker.set_fraction ] -->
<TimeSensor DEF='TimercycleInterval='.15loop='truestartTime='1'/>
<ROUTE fromNode='PauseOnfromField='triggerTimetoNode='TimertoField='pauseTime'/>
<ROUTE fromNode='PauseOfffromField='triggerTimetoNode='TimertoField='resumeTime'/>
<!-- ROUTE information for Shaker node:  [from Timer.fraction_changed to set_fraction ] [from value_changed to ShakingCone.translation ] -->
<PositionInterpolator DEF='Shakerkey='0 .25 .50 .75 1keyValue='0 0 0 .4 .2 -.3 -.2 .3 .1 -.1 -.2 .3 0 0 0'/>
<ROUTE fromNode='TimerfromField='fraction_changedtoNode='ShakertoField='set_fraction'/>
<ROUTE fromNode='ShakerfromField='value_changedtoNode='ShakingConetoField='translation'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : PauseOff, PauseOn, Shaker, ShakingCone, Tee, Timer, Toggler, TouchButton

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

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->