<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://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='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  <head>
    <meta content='RapierMissileSystemPrototype.x3d' name='title'/>
    <meta content='Oliver Tan' name='creator'/>
    <meta content='28 January 2004' name='created'/>
    <meta content='28 November 2019' name='modified'/>
    <meta content='check whether size is to scale' name='warning'/>
    <meta content='Rapier missile system prototype.' name='description'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/RapierMissileSystemPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='http://www.army-technology.com/projects/jernas/jernas1.html' name='reference'/>
    <meta content='Rapier, Rapier missile, missile' name='subject'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <!-- This is only a representational model. It is not created to scale. -->
    <WorldInfo title='RapierMissileSystemPrototype.x3d'/>
    <ExternProtoDeclare name='RapierMissile' url='"RapierMissilePrototype.x3d#RapierMissile" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/RapierMissilePrototype.x3d#RapierMissile" "RapierMissilePrototype.wrl#RapierMissile" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/RapierMissilePrototype.wrl#RapierMissile"'>
      <field accessType='initializeOnly' name='rocketAppearance' type='SFNode'/>
    </ExternProtoDeclare>
    <ProtoDeclare name='RapierMissileSystem'>
      <!-- This is only a representational model. It is not created to scale. -->
      <ProtoInterface>
        <field accessType='initializeOnly' name='material' type='SFNode'>
          <Material diffuseColor='.3 .6 .9'/>
        </field>
        <field accessType='initializeOnly' name='imageTexture' type='SFNode'>
          <ImageTexture url='"cammie1.jpg" "https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/AV8bHarrierUnitedStates/cammie1.jpg"'/>
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Viewpoint description='Rapier Missile System' position='0 0 3'/>
        <Viewpoint description='Rapier Missile System Oblique' orientation='0 1 0 -1.571' position='-3 0.5 0'/>
        <Transform rotation='0 1 0 1.57'>
          <Transform rotation='0 0 1 -1.571'>
            <Shape>
              <Appearance DEF='LauncherSkin'>
                <IS>
                  <connect nodeField='material' protoField='material'/>
                  <connect nodeField='texture' protoField='imageTexture'/>
                </IS>
              </Appearance>
            </Shape>
            <Transform DEF='MissileSystem'>
              <Transform rotation='0 0 1 1.571'>
                <Transform translation='0 -0.075 0.25'>
                  <Transform scale='0.5 0.5 0.5'>
                    <Transform rotation='0 0 1 -1.571' translation='-0.05 0.1 0'>
                      <Transform>
                        <Shape>
                          <Appearance USE='LauncherSkin'/>
                          <Extrusion creaseAngle='3.14' crossSection='-0.2 -1.4 -0.2 -0.3 0.05 0.2 0.1 0.2 0.1 -1.4 -0.2 -1.4' solid='false' spine='0 0 0 0 0.1 0'/>
                        </Shape>
                        <Transform translation='-0.05 0.05 -0.75'>
                          <Shape>
                            <Appearance USE='LauncherSkin'/>
                            <Cylinder height='0.2' radius='0.15'/>
                          </Shape>
                        </Transform>
                        <Transform translation='-0.05 0.05 -1.4'>
                          <Shape>
                            <Appearance USE='LauncherSkin'/>
                            <Cylinder height='0.2' radius='0.15'/>
                          </Shape>
                        </Transform>
                        <Transform translation='-0.05 0.05 -0.5'>
                          <Shape>
                            <Appearance USE='LauncherSkin'/>
                            <Cylinder height='0.2' radius='0.05'/>
                          </Shape>
                        </Transform>
                      </Transform>
                    </Transform>
                    <Transform translation='0 0.1 -0.55'>
                      <Transform DEF='MissileGripPair'>
                        <Transform scale='0.49 1 0.8'>
                          <Transform translation='0 0.15 -0.3'>
                            <Transform DEF='MissileGrip' translation='0.2 0 0'>
                              <Transform rotation='0 1 0 1.571'>
                                <Transform scale='0.04 0.04 0.04'>
                                  <Transform>
                                    <Transform rotation='1 0 0 1.571'>
                                      <Transform DEF='U1'>
                                        <Shape>
                                          <Appearance USE='LauncherSkin'/>
                                          <Cylinder height='8'/>
                                        </Shape>
                                        <Transform translation='0 4 0'>
                                          <Shape>
                                            <Sphere/>
                                            <Appearance USE='LauncherSkin'/>
                                          </Shape>
                                        </Transform>
                                        <Transform translation='0 -4 0'>
                                          <Shape>
                                            <Sphere/>
                                            <Appearance USE='LauncherSkin'/>
                                          </Shape>
                                        </Transform>
                                      </Transform>
                                    </Transform>
                                    <Transform translation='0 0 4'>
                                      <Transform rotation='0 0 1 -0.7'>
                                        <Transform translation='0 5 0'>
                                          <Transform>
                                            <Shape>
                                              <Appearance USE='LauncherSkin'/>
                                              <Cylinder height='10'/>
                                            </Shape>
                                            <Transform translation='0 5 0'>
                                              <Shape>
                                                <Sphere/>
                                                <Appearance USE='LauncherSkin'/>
                                              </Shape>
                                            </Transform>
                                            <Transform translation='0 -5 0'>
                                              <Shape>
                                                <Sphere/>
                                                <Appearance USE='LauncherSkin'/>
                                              </Shape>
                                            </Transform>
                                          </Transform>
                                        </Transform>
                                        <Transform translation='0 10 0'>
                                          <Transform translation='0 0 -4'>
                                            <Transform rotation='1 0 0 1.571'>
                                              <Transform scale='1 0.8 1' translation='0 0.2 0'>
                                                <Transform USE='U1'/>
                                              </Transform>
                                            </Transform>
                                          </Transform>
                                        </Transform>
                                      </Transform>
                                    </Transform>
                                  </Transform>
                                </Transform>
                              </Transform>
                            </Transform>
                          </Transform>
                          <Transform rotation='1 0 0 -1.4' translation='0 0.15 -0.3'>
                            <Transform rotation='0 1 0 3.142'>
                              <Transform USE='MissileGrip'/>
                            </Transform>
                          </Transform>
                        </Transform>
                      </Transform>
                    </Transform>
                    <Transform translation='0 0.1 -1.2'>
                      <Transform USE='MissileGripPair'/>
                    </Transform>
                    <Transform rotation='1 0 0 -3.142' translation='0 0.2 -0.95'>
                      <Transform USE='MissileGripPair'/>
                    </Transform>
                    <Transform rotation='1 0 0 -3.142' translation='0 0.2 -1.6'>
                      <Transform USE='MissileGripPair'/>
                    </Transform>
                  </Transform>
                  <Transform>
                    <Transform DEF='TopMissile'>
                      <Transform rotation='0 1 0 -1.57' scale='0.1 0.1 0.1' translation='0 0.2 -0.2'>
                        <Transform>
                          <ProtoInstance name='RapierMissile'>
                            <fieldValue name='rocketAppearance'>
                              <Appearance USE='LauncherSkin'/>
                            </fieldValue>
                          </ProtoInstance>
                        </Transform>
                      </Transform>
                      <TouchSensor DEF='shootTopMissile' description='touch missile to launch it'/>
                      <PositionInterpolator DEF='topMissilePathInterpolator' key='0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1' keyValue='0 0 1 0 0.05 2 0 0.1 3 0 0.15 4 0 0.2 5 0 0.25 6 0 0.3 7 0 0.35 8 0 0.4 9 0 0.45 10 0 0.5 11'/>
                      <TimeSensor DEF='topMissileClock' cycleInterval='10'/>
                      <ROUTE fromField='fraction_changed' fromNode='topMissileClock' toField='set_fraction' toNode='topMissilePathInterpolator'/>
                      <ROUTE fromField='value_changed' fromNode='topMissilePathInterpolator' toField='set_translation' toNode='TopMissile'/>
                      <ROUTE fromField='touchTime' fromNode='shootTopMissile' toField='set_startTime' toNode='topMissileClock'/>
                    </Transform>
                  </Transform>
                  <Transform DEF='BottomMissile'>
                    <Transform rotation='0 1 0 -1.57' scale='0.1 0.1 0.1' translation='0 -0.05 -0.15'>
                      <Transform>
                        <ProtoInstance name='RapierMissile'>
                          <fieldValue name='rocketAppearance'>
                            <Appearance USE='LauncherSkin'/>
                          </fieldValue>
                        </ProtoInstance>
                      </Transform>
                    </Transform>
                    <TouchSensor DEF='shootBottomMissile' description='touch missile to launch it'/>
                    <PositionInterpolator DEF='bottomMissilePathInterpolator' key='0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1' keyValue='0 0 1 0 0.05 2 0 0.1 3 0 0.15 4 0 0.2 5 0 0.25 6 0 0.3 7 0 0.35 8 0 0.4 9 0 0.45 10 0 0.5 11'/>
                    <TimeSensor DEF='bottomMissileClock' cycleInterval='10'/>
                    <ROUTE fromField='fraction_changed' fromNode='bottomMissileClock' toField='set_fraction' toNode='bottomMissilePathInterpolator'/>
                    <ROUTE fromField='value_changed' fromNode='bottomMissilePathInterpolator' toField='set_translation' toNode='BottomMissile'/>
                    <ROUTE fromField='touchTime' fromNode='shootBottomMissile' toField='set_startTime' toNode='bottomMissileClock'/>
                  </Transform>
                </Transform>
              </Transform>
              <CylinderSensor DEF='MissileSystemRotation' description='Rotate the missile system.' maxAngle='0' minAngle='-1.3'/>
              <ROUTE fromField='rotation_changed' fromNode='MissileSystemRotation' toField='rotation' toNode='MissileSystem'/>
            </Transform>
          </Transform>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <Anchor description='RapierMissileSystemExample' url='"RapierMissileSystemExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/RapierMissileSystemExample.x3d" "RapierMissileSystemExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/RapierMissileSystemExample.wrl"'>
      <Shape>
        <Text string='"Rapier Missile System Prototype" "contains prototype definitions" "" "Click on text to see these Appearances in" "RapierMissileSystemExample"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.5'/>
        </Text>
        <Appearance>
          <Material diffuseColor='0 0.6 0.6'/>
        </Appearance>
      </Shape>
    </Anchor>
  </Scene>
</X3D>