<?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='MissileExplosionPrototype.x3d'/>
<meta name='descriptioncontent='Simple prototype for an Anti-Ship Missile (ASM) explosion.'/>
<meta name='creatorcontent='James Harney'/>
<meta name='createdcontent='25 August 2001'/>
<meta name='modifiedcontent='2 January 2019'/>
<meta name='referencecontent=' http://www.planetnine.com '/>
<meta name='referencecontent=' https://savage.nps.edu/Savage/CruiserUnitedStates/Cruiser.x3d '/>
<meta name='referencecontent='www.specialoperations.com/multimedia/sounds.html/exp03.au'/>
<meta name='referencecontent=' See url "soundpermissions.html"
for copyright info and use on missile1.au and exp03.au that are converted to missile1.wav and exp03.wav for use in this file/model '/>

<meta name='accessRightscontent='soundpermissions.html'/>
<meta name='referencecontent='explosion.png'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Weapons/Missiles/MissileExplosionPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

Index for ProtoDeclare definition : ASMEXPLOSION

Index for DEF nodes : EXPCLOCK, EXPINTERP, EXPLOSION, explosion, EXPSHAPE, IMPACT, TimeFilter
-->
<Scene>
<ProtoDeclare name='ASMEXPLOSION'>
<ProtoInterface>
<field name='STARTEXPLOSIONtype='SFBoolaccessType='inputOnly'/>
<field name='THETIMEtype='SFTimeaccessType='inputOnly'/>
</ProtoInterface>
<ProtoBody>
<!-- ROUTE information for EXPLOSION node:  [from EXPINTERP.value_changed to set_scale ] -->
<Transform DEF='EXPLOSIONscale='.05 .05 .05'>
<Shape>
<Sphere DEF='EXPSHAPEradius='25'/>
<Appearance>
<!-- explosion.png is from the Pearl Harbor scene from www.planetnine.com. -->
<ImageTexture DEF='explosion'
  url=' "explosion.png" "https://savage.nps.edu/Savage/Weapons/Missiles/explosion.png" '/>
</Appearance>
</Shape>
<!-- Note, explosion delay is hard coded into script. Must modify if you don't want a 28 sec delay to start. -->
<!-- ROUTE information for TimeFilter node:  [from startEventTime to EXPCLOCK.set_startTime ] [from startEventTime to IMPACT.set_startTime ] -->
<Script DEF='TimeFilter'>
<field name='setStarttype='SFBoolaccessType='inputOnly'/>
<field name='startEventTimetype='SFTimeaccessType='outputOnly'/>
<field name='InputTimetype='SFTimeaccessType='inputOnly'/>
<IS>
<connect nodeField='setStartprotoField='STARTEXPLOSION'/>
<connect nodeField='InputTimeprotoField='THETIME'/>
</IS>
<![CDATA[
            
ecmascript:


function setStart ( value, InputTime ) {
                         
	startEventTime = InputTime + 28 ;
	
}

          
]]>
</Script>
<!-- Used with permission. See soundpermissions.html for details. -->
<Sound maxBack='50000maxFront='50000'>
<!-- ROUTE information for IMPACT node:  [from TimeFilter.startEventTime to set_startTime ] -->
<AudioClip DEF='IMPACTdescription='Explosion'
  url=' "EXP03.wav" "https://savage.nps.edu/Savage/Weapons/Missiles/EXP03.wav" '/>
</Sound>
</Transform>
<!-- ROUTE information for EXPCLOCK node:  [from TimeFilter.startEventTime to set_startTime ] [from fraction_changed to EXPINTERP.set_fraction ] -->
<TimeSensor DEF='EXPCLOCKcycleInterval='16'/>
<!-- ROUTE information for EXPINTERP node:  [from EXPCLOCK.fraction_changed to set_fraction ] [from value_changed to EXPLOSION.set_scale ] -->
<PositionInterpolator DEF='EXPINTERPkey='0 .25 .5 1keyValue='1 1 1 2.5 2.5 2.5 3 3 3 .01 .01 .01'/>
<ROUTE fromNode='TimeFilterfromField='startEventTimetoNode='EXPCLOCKtoField='set_startTime'/>
<ROUTE fromNode='TimeFilterfromField='startEventTimetoNode='IMPACTtoField='set_startTime'/>
<ROUTE fromNode='EXPCLOCKfromField='fraction_changedtoNode='EXPINTERPtoField='set_fraction'/>
<ROUTE fromNode='EXPINTERPfromField='value_changedtoNode='EXPLOSIONtoField='set_scale'/>
</ProtoBody>
</ProtoDeclare>
<Background skyColor='0.604 0.753 0.804'/>
<Anchor description='Multiple Explosion Exampleparameter='"target=_blank"'
  url=' "MultipleExplosionExample.wrl" "../../Weapons/Missiles/MultipleExplosionExample.wrl" "https://savage.nps.edu/Savage/Weapons/Missiles/MultipleExplosionExample.wrl" "MultipleExplosionExample.x3d" "../../Weapons/Missiles/MultipleExplosionExample.x3d" "https://savage.nps.edu/Savage/Weapons/Missiles/MultipleExplosionExample.x3d" '>
<Shape>
<Text string='"MissileExplosionPrototype" "is a prototype declaration file" "" "To see an example scene" "click on this text and view" "MissileExplosionExample"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance/>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : ASMEXPLOSION

Index for DEF nodes : EXPCLOCK, EXPINTERP, EXPLOSION, explosion, EXPSHAPE, IMPACT, TimeFilter
-->

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