<?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='RifleM24Example.x3d'/>
<meta name='descriptioncontent='Animation example from RifleM24 Prototype. Clicking trigger fires and sound.'/>
<meta name='creatorcontent='Etsuko Lippi'/>
<meta name='createdcontent='31 Decmember 2001'/>
<meta name='modifiedcontent='16 January 2014'/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Weapons/SmallArms/RifleM24Example.x3d '/>
<meta name='subjectcontent='Rifle M24'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for ExternProtoDeclare definition : RifleM24

Index for DEF nodes : About, AboutRifleM24, FireScript, FireTouchSensor, rifleM24, Target
-->
<Scene>
<ExternProtoDeclare name='RifleM24appinfo='Rifle M24'
  url=' "RifleM24Prototype.x3d#RifleM24" "https://savage.nps.edu/Savage/Weapons/SmallArms/RifleM24Prototype.x3d#RifleM24" "RifleM24Prototype.wrl#RifleM24" "https://savage.nps.edu/Savage/Weapons/SmallArms/RifleM24Prototype.wrl#RifleM24" '>
<field name='triggertype='SFBoolaccessType='inputOnly'
 appinfo='input true to fire'/>

<field name='firetype='SFBoolaccessType='outputOnly'
 appinfo='output true when fired'/>

<field name='animationStartTimetype='SFTimeaccessType='inputOnly'
 appinfo='trigger animation'/>
</ExternProtoDeclare>
<Background skyColor='0.604 0.753 0.804'/>
<Group>
<!-- ROUTE information for rifleM24 node:  [from FireTouchSensor.touchTime to animationStartTime ] [from FireScript.fire to trigger ] -->
<ProtoInstance name='RifleM24DEF='rifleM24'/>
<!-- ROUTE information for FireScript node:  [from FireTouchSensor.isOver to enabled ] [from fire to rifleM24.trigger ] -->
<Script DEF='FireScript'>
<field name='firetype='SFBoolaccessType='outputOnly'/>
<field name='enabledtype='SFBoolaccessType='inputOnly'/>
<![CDATA[
        
ecmascript:

function enabled (value, timeStamp)
{
        //print ('enabled value =' + value);
        if (value == true)
           fire = value;
}

      
]]>
</Script>
<!-- ROUTE information for FireTouchSensor node:  [from isOver to FireScript.enabled ] [from touchTime to rifleM24.animationStartTime ] -->
<TouchSensor DEF='FireTouchSensordescription='click to shoot'/>
<ROUTE fromNode='FireTouchSensorfromField='isOvertoNode='FireScripttoField='enabled'/>
<ROUTE fromNode='FireTouchSensorfromField='touchTimetoNode='rifleM24toField='animationStartTime'/>
<ROUTE fromNode='FireScriptfromField='firetoNode='rifleM24toField='trigger'/>
</Group>
<Transform DEF='Targetrotation='0.58 0.58 0.58 2.09translation='50 -1 0'>
<Shape>
<Appearance> </Appearance>
<IndexedFaceSet creaseAngle='1.75solid='falsecoordIndex='0 1 2 3 0'>
<Coordinate point='0.00 1.30 0 2.5 1.30 0 2.5 -1.30 0 0.00 -1.30 0'/>
</IndexedFaceSet>
</Shape>
</Transform>
<Anchor DEF='Aboutdescription='Federation of American Scientists (FAS) pageparameter='"target=_blank"'
  url=' "http://www.fas.org/man/dod-101/sys/land/m14.htm" '>
<Transform DEF='AboutRifleM24translation='-0.5 -0.4 -0.3'>
<Shape>
<Appearance>
<Material diffuseColor='0 0 0.545'/>
</Appearance>
<Text string='"About RifleM24"'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='0.25style='BOLD'/>
</Text>
</Shape>
</Transform>
</Anchor>
</Scene>
</X3D>
<!--

Index for ExternProtoDeclare definition : RifleM24

Index for DEF nodes : About, AboutRifleM24, FireScript, FireTouchSensor, rifleM24, Target
-->

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