package Savage.Weapons.Guns;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Shape.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Rifled Recoiling Mortar, 120mm This mortar is a proposed candidate for the Marine Corps Expeditionary Fire Support System. The EFSS will replace the 105mm light howitzer. </p>
 <p> Related links: Catalog page <a href="../../../../Weapons/Guns/RifledRecoilingMortar120mmIndex.html" target="_blank">RifledRecoilingMortar120mm</a>,  source <a href="../../../../Weapons/Guns/RifledRecoilingMortar120mm.java">RifledRecoilingMortar120mm.java</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;">
        <caption>Scene Meta Information</caption>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center; padding:10px 0px;"><i>meta tags</i></td>
			<td style="text-align:left;   padding:10px 0px;">&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="../../../../Weapons/Guns/RifledRecoilingMortar120mm.x3d">RifledRecoilingMortar120mm.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Rifled Recoiling Mortar, 120mm This mortar is a proposed candidate for the Marine Corps Expeditionary Fire Support System. The EFSS will replace the 105mm light howitzer. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> William W. Yates </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 24 July 2003 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 28 November 2019 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> photograph </i> </td>
			<td> dragonf.jpg </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.hqmc.usmc.mil/marines.nsf/0/dcee8726af76db7f852565a100785b36/$FILE/Urbanw1.jpg" target="_blank">http://www.hqmc.usmc.mil/marines.nsf/0/dcee8726af76db7f852565a100785b36/$FILE/Urbanw1.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.dtic.mil/ndia/44fuze/rockets.pdf" target="_blank">http://www.dtic.mil/ndia/44fuze/rockets.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.fas.org/man/dod-101/sys/land/docs/000519-covington-mortar.jpg" target="_blank">https://www.fas.org/man/dod-101/sys/land/docs/000519-covington-mortar.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/Weapons/Guns/RifledRecoilingMortar120mm.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Weapons/Guns/RifledRecoilingMortar120mm.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/README.X3D-Edit.html" target="_blank">https://www.web3d.org/x3d/content/README.X3D-Edit.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../Weapons/Guns/../../license.html">../../license.html</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">  &nbsp; </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="https://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">X3D Java Scene Access Interface Library (X3DJSAIL)</a>.
		It has been produced using the 
		<a href="https://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet
	       (<a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">version control</a>)
                which is used to create Java source code from an original <code>.x3d</code> model.
	</p>

	* @author William W. Yates
 */

public class RifledRecoilingMortar120mm
{
	/** Default constructor to create this object. */
	public RifledRecoilingMortar120mm ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_0)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("RifledRecoilingMortar120mm.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Rifled Recoiling Mortar, 120mm This mortar is a proposed candidate for the Marine Corps Expeditionary Fire Support System. The EFSS will replace the 105mm light howitzer."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("William W. Yates"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("24 July 2003"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("28 November 2019"))
    .addMeta(new meta().setName(meta.NAME_PHOTOGRAPH ).setContent("dragonf.jpg"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.hqmc.usmc.mil/marines.nsf/0/dcee8726af76db7f852565a100785b36/$FILE/Urbanw1.jpg"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.dtic.mil/ndia/44fuze/rockets.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.fas.org/man/dod-101/sys/land/docs/000519-covington-mortar.jpg"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Weapons/Guns/RifledRecoilingMortar120mm.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("https://www.web3d.org/x3d/content/README.X3D-Edit.html"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("RifledRecoilingMortar120mm.x3d"))
    .addChild(new Transform()
      .addChild(new Transform("Lower_Traverse_Plate").setTranslation(0.0,-.2,0.0)
        .addChild(new Shape()
          .setGeometry(new Cylinder().setHeight(.2).setRadius(2))
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(.4,.6,.1).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
      .addChild(new Transform("Main_Chassis").setTranslation(-.1,-.8,0.0)
        .addChild(new Shape()
          .setGeometry(new Box().setSize(4.0,1.0,4.2))
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))
        .addChild(new Transform("Front_Chassis").setTranslation(5.1,0.0,0.0)
          .addChild(new Shape()
            .setGeometry(new Box().setSize(6.4,1.0,1.2))
            .setAppearance(new Appearance()
              .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))
          .addChild(new Transform("Front_Stake_Plate").setRotation(0.0,0.0,1.0,-1.5707).setTranslation(3.20,0.0,0.0)
            .addChild(new Transform().setTranslation(-.4,0.0,.4)
              .addChild(new Shape()
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.7,0.0,0.7,-0.85,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,0.2})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
            .addChild(new Transform().setRotation(0.0,0.0,1.0,1.5707).setScale(.3,.3,.3).setTranslation(0.5,0.40,0.0)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00,1.5,0.0,1.5,2.0,-1.5,2.0,-1.5,-2.0,1.5,-2.0,1.5,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,.7,0.0})))))
            .addChild(new Transform().setTranslation(-.4,0.0,-0.6)
              .addChild(new Shape()
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.7,0.0,0.7,-0.85,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,0.2})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))
          .addChild(new Transform("Battery_Carrier").setTranslation(1.0,-.4,1.2)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(3.0,.2,1.2))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))
            .addChild(new Transform().setTranslation(-.7,.6,0.0)
              .addChild(new Group("BATTERY")
                .addChild(new Transform()
                  .addChild(new Shape("BATTERY_BODY")
                    .setGeometry(new Box().setSize(1.2,1.0,1.0))
                    .setAppearance(new Appearance()
                      .setMaterial(new Material().setDiffuseColor(.5,.5,.5)))))
                .addChild(new Transform().setTranslation(0.4,0.7,-0.2)
                  .addChild(new Shape("TERMINAL_POST")
                    .setGeometry(new Cylinder().setHeight(.15).setRadius(.08))
                    .setAppearance(new Appearance()
                      .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
                .addChild(new Transform().setTranslation(-.4,.7,-0.2)
                  .addChild(new Shape().setUSE("TERMINAL_POST")))
                .addChild(new Transform().setTranslation(0.0,.6,0.0)
                  .addChild(new Shape("BATTERY_TOP")
                    .setGeometry(new Box().setSize(1.2,.2,1.0))
                    .setAppearance(new Appearance()
                      .setMaterial(new Material().setDiffuseColor(.1,.1,.1)))))))
            .addChild(new Transform().setTranslation(.7,.6,0.0)
              .addChild(new Group().setUSE("BATTERY")))
            .addChild(new Transform().setTranslation(-1.5,0.1,-.6)
              .addChild(new Shape("BATTERY_CASE_WALL")
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,.1,0.0,.1,1.1,2.9,1.1,2.9,0.0,3.0,0.0,3.0,1.2,0.0,1.2,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,.6,0.0})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))
          .addChild(new Transform("Lunette_Assembly")
            .addChild(new Transform().setTranslation(2.30,0.5,.4)
              .addChild(new Shape("L_lunette_bracket")
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.7,0.0,0.7,-0.7,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,0.2})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
            .addChild(new Transform().setTranslation(2.30,0.5,-0.6)
              .addChild(new Shape("R_lunette_bracket")
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.7,0.0,0.7,-0.7,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,0.2})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
            .addChild(new Transform().setTranslation(3.1,.8,0.0)
              .addChild(new Shape("Lunette_bracket_front_Plate")
                .setGeometry(new Box().setSize(.2,.8,1.2))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
            .addChild(new Transform().setScale(.15,.15,.15).setTranslation(4.5,1.0,0.0)
              .addChild(new Shape("Lunette")
                .setGeometry(new Extrusion().setCreaseAngle(1.57).setCrossSection(new MFVec2f(new double[] {1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00})).setSpine(new MFVec3f(new double[] {2.00,0.0,0.00,1.85,0.0,0.77,1.41,0.0,1.41,0.77,0.0,1.85,0.00,0.0,2.00,-0.77,0.0,1.85,-1.41,0.0,1.41,-1.85,0.0,0.77,-2.00,0.0,0.00,-1.85,0.0,-0.77,-1.41,0.0,-1.41,-0.77,0.0,-1.85,0.00,0.0,-2.00,0.77,0.0,-1.85,1.41,0.0,-1.41,1.85,0.0,-0.77,2.00,0.0,0.00})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
            .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(.15,.15,.15).setTranslation(3.6,1.0,0.0)
              .addChild(new Shape("Lunette_Bar")
                .setGeometry(new Cylinder().setHeight(8))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3))))))
          .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57070).setTranslation(-.4,-.50,-.6)
            .addChild(new Shape()
              .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,2.5,0.0,2.5,1.5,1.0,2.5,0.0,2.5,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,1.2,0.0})))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))
        .addChild(new Transform("TRAILS")
          .addChild(new Transform("Right_Trail_Bracket").setTranslation(.1,.8,0.0)
            .addChild(new Transform("Bottom_trail_bracket").setTranslation(-2.1,-1.3,2.1)
              .addChild(new Shape("TRAIL_MOUNT_BRACKET")
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.6,0.0,0.6,0.6,-0.6,0.6,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.1,0.0})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
            .addChild(new Transform("Top_trail_bracket").setTranslation(-2.1,-.6,2.1)
              .addChild(new Shape().setUSE("TRAIL_MOUNT_BRACKET")))
            .addChild(new Transform().setTranslation(-2.1,-1.2,2.1)
              .addChild(new Shape("TRAIL_BRACKET_SIDE")
                .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.1,0.0,-0.5,0.6,-0.6,0.6,0.0,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,.7,0.0})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))
          .addChild(new Transform("Left_Trail_Bracket").setRotation(1.0,0.0,0.0,3.14159).setTranslation(.1,-1.0,-4.2)
            .addChild(new Transform("Left_Bottom_trail_bracket").setTranslation(-2.1,-1.3,-2.1)
              .addChild(new Shape().setUSE("TRAIL_MOUNT_BRACKET")))
            .addChild(new Transform("Left_top_trail_bracket").setTranslation(-2.1,-.6,-2.1)
              .addChild(new Shape().setUSE("TRAIL_MOUNT_BRACKET")))
            .addChild(new Transform().setTranslation(-2.1,-1.2,-2.1)
              .addChild(new Shape().setUSE("TRAIL_BRACKET_SIDE"))))
          .addChild(new Transform().setTranslation(0.0,-.1,-2.4)
            .addChild(new CylinderSensor("Left_Trail_Pivot_Sensor").setDescription("Extends and closes left trail").setMaxAngle(2.356))
            .addChild(new Transform("Left_Trail").setTranslation(-1.75,0.0,0.0)
              .addChild(new Transform().setTranslation(1.45,0.0,0.0)
                .addChild(new Shape()
                  .setGeometry(new Box().setSize(3.0,.6,.6))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform()
                .addChild(new Shape()
                  .setGeometry(new Cylinder().setHeight(.6).setRadius(.3))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform().setRotation(1.0,0.0,0.0,3.1415).setTranslation(2.95,-.25,-.2)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.0,.55,.77,0.0,0.0,0.0})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,.1})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform().setRotation(1.0,0.0,0.0,3.1415).setTranslation(2.95,-.25,.3)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.0,.55,.77,0.0,0.0,0.0})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,.1})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57).setScale(.25,.25,.25).setTranslation(3.3,-.3,0.0)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00,1.2,0.0,1.2,1.7,-1.2,1.7,-1.2,-1.7,1.2,-1.7,1.2,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,.2,0.0})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new ROUTE().setFromNode("Left_Trail_Pivot_Sensor").setFromField("rotation_changed").setToNode("Left_Trail").setToField("set_rotation"))))
          .addChild(new Transform().setTranslation(0.0,-0.1,2.4)
            .addChild(new CylinderSensor("Right_Trail_Pivot_Sensor").setDescription("Extends and closes the right trail.").setMaxAngle(0).setMinAngle(-2.356))
            .addChild(new Transform("Right_Trail").setTranslation(-1.75,0.0,0.0)
              .addChild(new Transform().setTranslation(1.45,0.0,0.0)
                .addChild(new Shape()
                  .setGeometry(new Box().setSize(3.0,.6,.6))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform()
                .addChild(new Shape()
                  .setGeometry(new Cylinder().setHeight(.6).setRadius(.3))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform().setRotation(1.0,0.0,0.0,3.1415).setTranslation(2.95,-.25,.3)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.0,.55,.77,0.0,0.0,0.0})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,.1})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform().setRotation(1.0,0.0,0.0,3.1415).setTranslation(2.95,-.25,-.2)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,0.0,.55,.77,0.0,0.0,0.0})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,.1})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new Transform("Trail_Stake_Plate").setRotation(0.0,1.0,0.0,1.57).setScale(.25,.25,.25).setTranslation(3.3,-.3,0.0)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00,1.2,0.0,1.2,1.7,-1.2,1.7,-1.2,-1.7,1.2,-1.7,1.2,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,.2,0.0})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3)))))
              .addChild(new ROUTE().setFromNode("Right_Trail_Pivot_Sensor").setFromField("rotation_changed").setToNode("Right_Trail").setToField("set_rotation"))))))
      .addChild(new Group()
        .addChild(new Transform("Traversing_Assembly")
          .addChild(new CylinderSensor("Traversing_Sensor").setDescription("Traverses the tube left and right").setMaxAngle(.9).setMinAngle(-.9))
          .addChild(new Transform("Transform_B")
            .addChild(new Transform("Elevating_Assemblies").setRotation(1.0,0.0,0.0,1.570).setTranslation(-.8,0.8,0.0)
              .addChild(new CylinderSensor("FIRST_CYLINDERSENSOR").setDescription("Elevates and depresses the tube").setDiskAngle(0).setMaxAngle(1.3).setMinAngle(.25).setOffset(1.57))
              .addChild(new Transform("FIRST_TRANSFORM")
                .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(.8,0.0,.8)
                  .addChild(new Transform().setRotation(1.0,0.0,0.0,3.14159).setTranslation(3.4,.8,0.1)
                    .addChild(new Transform("Tube_Assembly").setRotation(0.0,0.0,1.0,1.57).setScale(.165,4.5,.165)
                      .addChild(new Shape("tube")
                        .setGeometry(new Extrusion().setCreaseAngle(1.57).setCrossSection(new MFVec2f(new double[] {-1.00,0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,0.00})).setSolid(false).setSpine(new MFVec3f(new double[] {2.00,0.0,0.00,1.85,0.0,0.77,1.41,0.0,1.41,0.77,0.0,1.85,0.00,0.0,2.00,-0.77,0.0,1.85,-1.41,0.0,1.41,-1.85,0.0,0.77,-2.00,0.0,0.00,-1.85,0.0,-0.77,-1.41,0.0,-1.41,-0.77,0.0,-1.85,0.00,0.0,-2.00,0.77,0.0,-1.85,1.41,0.0,-1.41,1.85,0.0,-0.77,2.00,0.0,0.00})))
                        .setAppearance(new Appearance()
                          .setMaterial(new Material().setDiffuseColor(.3,.3,.3).setEmissiveColor(.1,.1,.1).setShininess(.3))))))
                  .addChild(new Transform("Shroud_Top_Plate").setRotation(0.0,0.0,1.0,1.5707).setScale(.4,.4,.4).setTranslation(5.2,.8,0.1)
                    .addChild(new Shape()
                      .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00,1.2,0.0,1.2,1.7,-1.2,1.7,-1.2,-1.7,1.2,-1.7,1.2,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,.2,0.0})))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
                  .addChild(new Transform("Elevation_Pivot_Base").setRotation(1.0,0.0,0.0,1.57).setTranslation(-.8,0.8,0.1)
                    .addChild(new Shape()
                      .setGeometry(new Cylinder().setHeight(1.7).setRadius(.6))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
                  .addChild(new Transform("Shroud").setRotation(1.0,0.0,0.0,1.57).setScale(2.0,.85,1.2).setTranslation(-.80,1.4,.1)
                    .addChild(new Shape()
                      .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,0.0,-1.0,0.0,-1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.0,0.0,.1,.8,.1,.8,.9,-.8,.9,-.8,.1,0.0,.1})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,3.0,0.0,0.0})))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
                  .addChild(new ROUTE().setFromNode("FIRST_CYLINDERSENSOR").setFromField("rotation_changed").setToNode("FIRST_TRANSFORM").setToField("set_rotation"))
                  .addChild(new Transform("FireControl").setRotation(1.0,0.0,0.0,0.0).setTranslation(.50,0.0,-.75)
                    .addChild(new Shape()
                      .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {0.0,1.0,0.7,1.4,4.0,1.4,4.0,1.0,3.2,-0.1,1.0,-0.1,0.0,0.5,0.0,1.0})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,-.8})))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))))
            .addChild(new Transform()
              .addChild(new Transform("Upper_Traverse_Plate")
                .addChild(new Shape()
                  .addComments(" When attribute values are not specified, the default values from the VRML Specification are used. ")
                  .setGeometry(new Cylinder().setHeight(.2).setRadius(2))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
              .addChild(new Transform("Right_Base_Bracket").setTranslation(-1.0,.1,-1.0)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {-0.4,0.0,.8,0.0,1.2,0.2,-0.4,0.2,-0.4,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,1.3,0.0})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2)))))
              .addChild(new Transform("Left_Base_Bracket").setTranslation(-1.0,.1,1.0)
                .addChild(new Shape()
                  .setGeometry(new Extrusion().setCrossSection(new MFVec2f(new double[] {-0.4,0.0,1.2,0.0,0.8,0.2,-0.4,0.2,-0.4,0.0})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,1.3,0.0})))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(.2,.3,0.0).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))
            .addChild(new ROUTE().setFromNode("Traversing_Sensor").setFromField("rotation_changed").setToNode("Traversing_Assembly").setToField("set_rotation")))))
      .addChild(new Viewpoint("Right").setDescription("Mortar 120mm").setOrientation(1.0,0.0,0.0,0.0).setPosition(2.0,0.0,17.0))
      .addChild(new Viewpoint("Top_View").setDescription("Mortar 120mm top view").setOrientation(1.0,0.0,0.0,-1.2).setPosition(4.0,12.0,6.0))
      .addChild(new Viewpoint("Tube_View").setDescription("Tube axis").setOrientation(0.0,1.0,0.0,1.70).setPosition(13.0,5.0,0.0))
      .addChild(new Transform("ROLLING_ASSEMBLY")
        .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setScale(.8,.8,.8).setTranslation(3.15,-.7,0.0)
          .addChild(new Shape("AXLE")
            .setGeometry(new Cylinder().setHeight(5).setRadius(.2))
            .setAppearance(new Appearance()
              .setMaterial(new Material().setDiffuseColor(.1,.1,.1))))
          .addChild(new Transform().setScale(.8,.8,.8).setTranslation(0.0,2.4,0.0)
            .addChild(new Shape("WHEEL_HUB")
              .setGeometry(new Cylinder().setHeight(.1).setRadius(.4))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(.2,.2,.2).setEmissiveColor(.1,.1,.1)))))
          .addChild(new Transform().setScale(.8,.8,.8).setTranslation(0.0,-2.4,0.0)
            .addChild(new Shape().setUSE("WHEEL_HUB"))))
        .addChild(new Transform().setScale(.7,.7,.7).setTranslation(.50,0.0,0.0)
          .addChild(new Transform("Right_Tire").setRotation(1.0,0.0,0.0,1.57).setScale(.6,.6,.6).setTranslation(3.8,-1.0,2.6)
            .addChild(new Shape("TIRE")
              .setGeometry(new Extrusion().setCreaseAngle(1.57).setCrossSection(new MFVec2f(new double[] {1.00,0.00,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.00,-1.00,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.00,-0.00,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.00,1.00,0.38,0.92,0.71,0.71,0.92,0.38,1.00,0.00})).setSpine(new MFVec3f(new double[] {2.00,0.0,0.00,1.85,0.0,0.77,1.41,0.0,1.41,0.77,0.0,1.85,0.00,0.0,2.00,-0.77,0.0,1.85,-1.41,0.0,1.41,-1.85,0.0,0.77,-2.00,0.0,0.00,-1.85,0.0,-0.77,-1.41,0.0,-1.41,-0.77,0.0,-1.85,0.00,0.0,-2.00,0.77,0.0,-1.85,1.41,0.0,-1.41,1.85,0.0,-0.77,2.00,0.0,0.00})))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(.1,.2,.2).setShininess(.2))))
            .addChild(new Transform().setScale(.5,.8,.5)
              .addChild(new Shape("WHEEL")
                .setGeometry(new Extrusion().setCreaseAngle(1.57).setCrossSection(new MFVec2f(new double[] {-1.5,0.1,-0.7,0.1,-0.3,0.2,-0.2,0.4,-0.1,0.5,0.2,0.7,0.6,.9,0.6,-0.9,0.2,-0.7,-0.1,-0.5,-0.2,-0.4,-0.3,-0.2,-0.7,-0.1,-1.5,-0.1})).setSpine(new MFVec3f(new double[] {2.00,0.0,0.00,1.85,0.0,0.77,1.41,0.0,1.41,0.77,0.0,1.85,0.00,0.0,2.00,-0.77,0.0,1.85,-1.41,0.0,1.41,-1.85,0.0,0.77,-2.00,0.0,0.00,-1.85,0.0,-0.77,-1.41,0.0,-1.41,-0.77,0.0,-1.85,0.00,0.0,-2.00,0.77,0.0,-1.85,1.41,0.0,-1.41,1.85,0.0,-0.77,2.00,0.0,0.00})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(.4,.6,.1).setEmissiveColor(0.0,0.0,.1).setShininess(.2))))))
          .addChild(new Transform("Left_Tire").setRotation(1.0,0.0,0.0,1.57).setScale(.6,.6,.6).setTranslation(3.8,-1.0,-2.6)
            .addChild(new Shape().setUSE("TIRE"))
            .addChild(new Transform().setScale(.5,.8,.5)
              .addChild(new Shape().setUSE("WHEEL")))))))
    .addChild(new Background().setGroundAngle(new double[] {1.309,1.570796}).setGroundColor(new MFColor(new double[] {0.1,0.1,0.0,0.4,0.25,0.2,0.6,0.6,0.6})).setSkyAngle(new double[] {1.309,1.571}).setSkyColor(new MFColor(new double[] {0.0,0.2,0.8,0.0,0.5,1.0,1.0,1.0,1.0}))));
            }
            catch (Exception ex)
            {       
                System.err.println ("*** Further hints on X3DJSAIL errors and exceptions at");
                System.err.println ("*** https://www.web3d.org/specifications/java/X3DJSAIL.html");
                throw (ex);
            }
	}
	// end of initialize() method

	/** The initialized model object, created within initialize() method. */
	private X3D x3dModel;

	/** 
	 * Provide a 
	 * <a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank">shallow copy</a>
	 * of the X3D model.
	 * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html">X3D</a>
	 * @return RifledRecoilingMortar120mm model
	 */
	public X3D getX3dModel()
	{	  
		return x3dModel;
	}
	   
    /** 
     * Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object.
     * @param args array of input parameters, provided as arguments
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#handleArguments-java.lang.String:A-">X3D.handleArguments(args)</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#validationReport--">X3D.validationReport()</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html">CommandLine</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE">CommandLine.USAGE</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html">ConfigurationProperties</a>
     */
    public static void main(String args[])
    {
        System.out.println("Build this X3D model, showing validation diagnostics...");
        X3D thisExampleX3dModel = new RifledRecoilingMortar120mm().getX3dModel();
//      System.out.println("X3D model construction complete.");
	
        // next handle command line arguments
        boolean hasArguments = (args != null) && (args.length > 0);
        boolean validate = true; // default
        boolean argumentsLoadNewModel = false;
        String  fileName = new String();

        if (args != null)
        {
                for (String arg : args)
                {
                        if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate"))
                        {
                                validate = true; // making sure
                        }
                        if (arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3D) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_CLASSICVRML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3DB) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_VRML97) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_EXI) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_GZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_ZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_HTML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_XHTML))
                        {
                                argumentsLoadNewModel = true;
                                fileName = arg;
                        }
                }
        }
        if      (argumentsLoadNewModel)
                System.out.println("WARNING: \"Savage.Weapons.Guns.RifledRecoilingMortar120mm\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored.");
        else if (hasArguments) // if no arguments provided, this method produces usage warning
                thisExampleX3dModel.handleArguments(args);
	
        if (validate)
        {
            //  System.out.println("--- TODO fix duplicated outputs ---"); // omit when duplicated outputs problem is solved/refactored
		String validationResults = thisExampleX3dModel.validationReport();
            //  System.out.println("-----------------------------------"); // omit when duplicated outputs problem is solved/refactored
                System.out.print("Savage.Weapons.Guns.RifledRecoilingMortar120mm self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

                // experimental: test X3DJSAIL output files
                // Weapons/Guns/RifledRecoilingMortar120mm_JavaExport.* file validation is checked when building X3D Example Archives
                String filenameX3D  = "Weapons/Guns/RifledRecoilingMortar120mm_JavaExport.x3d"; 
                String filenameX3DV = "Weapons/Guns/RifledRecoilingMortar120mm_JavaExport.x3dv"; 
                String filenameJSON = "Weapons/Guns/RifledRecoilingMortar120mm_JavaExport.json";
                thisExampleX3dModel.toFileX3D        (filenameX3D);
                thisExampleX3dModel.toFileClassicVRML(filenameX3DV);
// TODO         thisExampleX3dModel.toFileJSON       (filenameJSON);
        }
    }
}
