<?xml version="1.0" standalone="no"?>

<track name="Peanut">

  <racing-line>
    <distance-factor>0.98</distance-factor>
    <stiffness>2.0</stiffness>
    <!-- show/ -->
  </racing-line>

  <!-- Sky Box -->

  <sky>
    <sides>textures/sky_sides.png</sides>
	<top>textures/sky_top.png</top>
	<bottom>textures/sky_bottom.png</bottom>
	<smooth/>
  </sky>

  <!-- Material Properties -->

  <material name="track" type="asphalt">
	<friction>1.0</friction>
	<restitution>0.1</restitution>
	<rolling>1.0</rolling>
	<drag>0.0</drag>
	<bump-amplitude>0.01</bump-amplitude>
	<bump-wavelength>100.0</bump-wavelength>
	<texture>
	  <file>textures/track2.png</file>
	  <length>200.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <material name="grass" type="grass">
	<friction>0.7</friction>
	<restitution>0.1</restitution>
	<rolling>5.0</rolling>
	<drag>20.0</drag>	
	<bump-amplitude>0.03</bump-amplitude>
	<bump-wavelength>2.0</bump-wavelength>
	<texture>
	  <file>textures/grass.png</file>
	  <width>10.0</width>
	  <length>12.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <material name="gravel" type="gravel">
	<friction>0.8</friction>
	<restitution>0.0</restitution>
	<rolling>40.0</rolling>
	<drag>200.0</drag>	
	<bump-amplitude>0.05</bump-amplitude>
	<bump-wavelength>2.0</bump-wavelength>
	<texture>
	  <file>textures/gravel3.png</file>
	  <width>10.0</width>
	  <length>10.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <material name="tires" type="rubber">
	<friction>1.0</friction>
	<restitution>0.8</restitution>
	<rolling>1.0</rolling>
	<drag>5.0</drag>
	<bump-amplitude>0.0</bump-amplitude>
	<bump-wavelength>1.0</bump-wavelength>
    <texture>
	  <file>textures/blue-tires.png</file>
	  <width>0.33</width>
	  <length>3.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <material name="rail" type="metal">
	<friction>1.0</friction>
	<restitution>0.5</restitution>
	<rolling>1.0</rolling>
	<drag>0.0</drag>	
	<bump-amplitude>0.0</bump-amplitude>
	<bump-wavelength>1.0</bump-wavelength>
    <texture>
	  <file>textures/rail.png</file>
	  <width>0.34</width>
	  <length>10.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <material name="wall" type="concrete">
	<friction>1.0</friction>
	<restitution>0.5</restitution>
	<rolling>1.0</rolling>
	<drag>0.0</drag>
	<bump-amplitude>0.0</bump-amplitude>
	<bump-wavelength>1.0</bump-wavelength>
	<texture>
	  <file>textures/wall.png</file>
	  <width>1.0</width>
	  <length>10.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <material name="kerb" type="concrete">
	<friction>1.0</friction>
	<restitution>0.1</restitution>
	<rolling>1.0</rolling>
	<drag>0.0</drag>
	<bump-amplitude>0.06</bump-amplitude>
	<bump-wavelength>2.0</bump-wavelength>
	<texture>
	  <file>textures/blue-kerb.png</file>
	  <width>2.0</width>
	  <length>4.0</length>
	  <smooth/>
	  <mipmap/>
	</texture>
  </material>

  <!-- Segment Properties -->

  <segment name="straight">
    [ wall grass kerb track kerb grass rail ]
  </segment>
  <segment name="straight pit">
    [ wall track kerb track kerb grass rail ]
  </segment>
  <segment name="left turn">
    [ wall grass kerb track kerb gravel tires ]
  </segment>
  <segment name="left turn pit">
    [ wall track kerb track kerb gravel tires ]
  </segment>
  <segment name="right turn">
    [ tires gravel kerb track kerb grass rail ]
  </segment>

  <!-- The track -->

  <!-- front straight -->
  <start-direction>30.0</start-direction>
  <start-slope>0.0</start-slope>

  <road segment="straight">
    <model>
	  <file>grandstand.ac</file>
	  <scale>10.0</scale>
	  <translate>[ 100.0, -40, 0.0 ]</translate>
	  <rotate>[ 0.0, 0.0, 180.0 ]</rotate>
    </model>

    <resolution>20.0</resolution>
	<length>200.0</length>
	<left-width>[ 0.0, 25.0 ]</left-width>
	<right-width>[ 0.0, 25.0 ]</right-width>
	<left-road-width>[ 0.0, 8.0 ]</left-road-width>
	<right-road-width>[ 0.0, 8.0 ]</right-road-width>
	<left-wall-height>1.0</left-wall-height>
	<right-wall-height>1.0</right-wall-height>
	<elevation>[ 20.0, 0.0 ]</elevation>
	<elevation>[ 200.0, 5.0 ]</elevation>
    <camera>
      <position>[ 200.0, -20.0, 10.0 ]</position>
      <range>500.0</range>
    </camera>
    <pit-out>
      <side>left</side>
      <join>100.0</join>
      <merge>150.0</merge>
      <angle>-5.0</angle>
    </pit-out>
	<braking-marker>
	  <file>textures/50.png</file>
	  <distance>50.0</distance>
	  <size>[ 1.4, 0.7 ]</size>
	  <offset>[ 2.0, 0.0 ]</offset>
	  <side>right</side>
	</braking-marker>
	<braking-marker>
	  <file>textures/100.png</file>
	  <distance>100.0</distance>
	</braking-marker>
	<braking-marker>
	  <file>textures/150.png</file>
	  <distance>150.0</distance>
	</braking-marker>
  </road>

  <!-- tight left-hander -->
  <road segment="left turn">
    <resolution>2.0</resolution>
	<length>50.0</length>
	<radius>35.0</radius>
    <racing-line-adjustment>0.5</racing-line-adjustment>
	<left-kerb>
	  <start>
		<transition>
		  <length>4.0</length>
		  <width>1.0</width>
		</transition>
	  </start>
	  <profile>[ 0.2, 0.05 ][ 0.4, 0.07 ][ 0.6, 0.1 ][ 0.8, 0.1 ][ 1.2, 0.07 ][ 1.4, 0.0 ]</profile>
	</left-kerb>
    <camera>
      <position>[ 2.0, -30.0, 3.0 ]</position>
      <field>30.0</field>
      <range>100.0</range>
    </camera>
  </road>
  <road segment="left turn">
    <resolution>2.0</resolution>
	<length>50.0</length>
	<radius>35.0</radius>
    <racing-line-adjustment>0.5</racing-line-adjustment>
	<elevation>[ 50.0, 0.0 ]</elevation>
	<left-kerb>
	  <end>
		<transition>
		  <length>4.0</length>
		  <width>1.0</width>
		</transition>
	  </end>
	</left-kerb>
    <camera>
      <position>[ 0.0, 25.0, 1.0 ]</position>
      <range>50.0</range>
    </camera>
  </road>

  <road segment="straight">
    <model>
	  <file>grandstand.ac</file>
	  <scale>10.0</scale>
	  <translate>[ 40.0, -40.0, -10.0 ]</translate>
	  <rotate>[ 0.0, 0.0, 180.0 ]</rotate>
    </model>
    <resolution>10.0</resolution>
	<length>100.0</length>
	<right-kerb>
	  <start>
		<transition>
		  <length>4.0</length>
		  <width>1.0</width>
		</transition>
	  </start>
	  <end>
	    <distance>40.0</distance>
		<transition>
		  <length>4.0</length>
		  <width>1.0</width>
		</transition>
	  </end>
	  <profile>[ 2.0, 0.0 ]</profile>
	</right-kerb>
	<elevation>[ 100.0, -5.0 ]</elevation>
    <camera>
      <position>[ 50.0, -35.0, 4.0 ]</position>
      <range>50.0</range>
    </camera>
  </road>

  <!-- tight right-hander -->
  <road segment="right turn">
    <resolution>2.0</resolution>
	<length>140.0</length>
	<radius>-60.0</radius>
	<left-kerb>
	  <start>
	    <distance>140.0</distance>
		<transition/>
	  </start>
	  <profile>[ 1.0, 0.1 ][ 3.0, 0.1 ][ 3.1, 0.0 ]</profile>
	</left-kerb>
	<right-kerb>
	  <start><transition/></start>
	  <end><transition/></end>
	  <profile>[ 2.0, 0.3 ][ 2.4, 0.3 ][ 2.5, 0.0 ]</profile>
	</right-kerb>
	<elevation>[ 140.0, -10.0 ]</elevation>
    <camera>
      <position>[ 40.0, -40.0, 5.0 ]</position>
      <range>100.0</range>
    </camera>
  </road>

  <road segment="straight">
    <resolution>10.0</resolution>
	<length>350.0</length>
    <racing-line-adjustment>1.5</racing-line-adjustment>
	<left-kerb>
	  <end>
	    <distance>80.0</distance>
		<transition/>
	  </end>
	</left-kerb>
	<elevation>[ 350.0, -5.0 ]</elevation>
	<bank>10.0</bank>
    <camera>
      <position>[ 300.0, -20.0, 10.0 ]</position>
      <range>400.0</range>
      <field>5.0</field>
    </camera>
  </road>

  <!-- long banked left-hander -->
  <road segment="straight">
    <resolution>2.0</resolution>
	<length>200.0</length>
	<radius>200.0</radius>
	<bank>10.0</bank>
  </road>
  <road segment="straight">
	<length>200.0</length>
	<radius>200.0</radius>
	<right-kerb>
	  <start>
	    <distance>200.0</distance>
		<transition/>
	  </start>
	  <profile>[ 1.0, 0.1 ][ 4.0, 0.1 ][ 4.1, 0.0 ]</profile>
	</right-kerb>
	<elevation>[ 100.0, 0.0 ]</elevation>
	<bank>0.0</bank>
  </road>

  <road segment="straight">
	<length>280.0</length>
	<right-kerb>
	  <end>
	    <distance>100.0</distance>
		<transition/>
	  </end>
	</right-kerb>
	<elevation>[ 50.0, 0.0 ]</elevation>
	<elevation>[ 200.0, -20.0 ]</elevation>
	<braking-marker>
	  <file>textures/50.png</file>
	  <distance>50.0</distance>
	</braking-marker>
	<braking-marker>
	  <file>textures/100.png</file>
	  <distance>100.0</distance>
	</braking-marker>
	<braking-marker>
	  <file>textures/150.png</file>
	  <distance>150.0</distance>
	</braking-marker>
    <camera>
      <position>[ 0.0, -20.0, 10.0 ]</position>
      <range>100.0</range>
    </camera>
    <camera>
      <position>[ 150.0, -10.0, 1.0 ]</position>
      <range>100.0</range>
    </camera>
  </road>

  <!-- tight left hander -->
  <road segment="left turn">
    <resolution>2.0</resolution>
	<length>130.0</length>
	<radius>60.0</radius>
	<left-kerb>
	  <start><transition/></start>
	  <end><transition/></end>
	  <profile>[ 0.2, 0.05 ][ 0.4, 0.07 ][ 0.6, 0.1 ][ 0.8, 0.1 ][ 1.2, 0.07 ][ 1.4, 0.0 ]</profile>
	</left-kerb>
	<right-kerb>
	  <start>
	    <distance>130.0</distance>
		<transition/>
      </start>
	  <profile>[ 1.0, 0.1 ][ 3.0, 0.1 ][ 3.1, 0.0 ]</profile>
	</right-kerb>
    <camera>
      <position>[ 80.0, -30.0, 1.0 ]</position>
      <range>100.0</range>
    </camera>
  </road>

  <road segment="straight">
    <resolution>10.0</resolution>
	<length>350.0</length>
    <racing-line-adjustment>-1.5</racing-line-adjustment>
	<right-kerb>
	  <end>
	    <distance>80.0</distance>
		<transition/>
	  </end>
	</right-kerb>
	<elevation>[ 350.0, 0.0 ]</elevation>
	<braking-marker>
	  <file>textures/50.png</file>
	  <distance>50.0</distance>
	  <side>left</side>
	</braking-marker>
  </road>

  <!-- kink -->
  <road segment="straight">
    <resolution>2.0</resolution>
	<length>130.0</length>
	<radius>-160.0</radius>
    <racing-line-adjustment>-0.5</racing-line-adjustment>
	<right-kerb>
	  <start><transition/></start>
	  <end><transition/></end>
	</right-kerb>
  </road>

  <road segment="straight">
    <resolution>10.0</resolution>
	<length>400.0</length>
    <model>
	  <file>bridge.ac</file>
	  <scale>1.5</scale>
	  <translate>[ 280.0, 25.0, 10.0 ]</translate>
	  <rotate>[ 0.0, 180.0, 0.0 ]</rotate>
    </model>
    <camera>
      <position>[ 300.0, -10.0, 10.0 ]</position>
      <range>350.0</range>
    </camera>
    <pit-in>
      <side>left</side>
      <merge>200.0</merge>
      <split>380.0</split>
      <angle>3.0</angle>
    </pit-in>
	<braking-marker>
	  <file>textures/50.png</file>
	  <distance>50.0</distance>
	  <side>right</side>
	</braking-marker>
	<braking-marker>
	  <file>textures/100.png</file>
	  <distance>100.0</distance>
	</braking-marker>
	<braking-marker>
	  <file>textures/150.png</file>
	  <distance>150.0</distance>
	</braking-marker>
  </road>

  <!-- tight left-hander -->
  <road segment="left turn">
    <resolution>2.0</resolution>
	<length>110.0</length>
	<radius>50.0</radius>
    <racing-line-adjustment>1.5</racing-line-adjustment>
	<left-kerb>
	  <start><transition/></start>
	  <end><transition/></end>
	</left-kerb>
	<right-kerb>
	  <start>
	    <distance>120.0</distance>
		<transition/>
	  </start>
	</right-kerb>
  </road>

  <!-- front straight -->
  <road segment="straight">
    <resolution>10.0</resolution>
	<length>200.0</length>
    <racing-line-adjustment>-1.5</racing-line-adjustment>
	<right-kerb>
	  <end>
	    <distance>80.0</distance>
		<transition/>
	  </end>
	</right-kerb>
	<elevation>[ 250.0, 0.0 ]</elevation>
  </road>

  <pit>
    <road segment="straight">
      <resolution>10.0</resolution>
	  <length>40.0</length>
	  <right-width>[ 0.0, 6.0 ]</right-width>
	  <left-width>[ 0.0, 6.0 ]</left-width>
	  <left-road-width>[ 0.0, 4.0 ]</left-road-width>
	  <right-road-width>[ 0.0, 4.0 ]</right-road-width>
    </road>
    <road segment="straight">
      <resolution>2.0</resolution>
	  <length>96.0</length>
	  <radius>40.0</radius>
    </road>
    <road segment="straight">
      <resolution>10.0</resolution>
	  <length>150.0</length>
      <model>
	    <file>garage.ac</file>
	    <scale>10.0</scale>
	    <translate>[ 200.0, 20, 0.0 ]</translate>
	    <rotate>[ 0.0, 0.0, 180.0 ]</rotate>
      </model>
    </road>
    <road segment="straight">
      <resolution>2.0</resolution>
	  <length>12.0</length>
	  <radius>-50.0</radius>
    </road>
    <road segment="straight">
      <resolution>10.0</resolution>
	  <length>5.0</length>
	  <left-width>[ 5.0, 4.0 ]</left-width>
    </road>
    <join segments="3" />
  </pit>

  <!-- Force the track to close.-->
  <circuit/>

  <!-- Define the timing sectors. -->
  <timing-line>10.0</timing-line>
  <timing-line>700.0</timing-line>
  <timing-line>1800.0</timing-line>

  <!-- Adjust the total length if necessary. -->
  <track-length>3500.0</track-length>
</track>
