<?xml version="1.0" ?>
<scene AmbientColor="0.7,0.7,0.7"
	FullName="Unpredictable universe"
	formatVersion="1.0">
	<BoundingBox MaxCorner="178.329,110.998,20"
		MinCorner="-185.384,-109.852,-20"
		Name="Boundaries">
		<Mesh Mesh="Boundary"
			Name="ForceFieldAccuracy/Boundary"
			Position="0, 0, 0"
			Rotation="0,0,0"
			Scale="5, 5, 5" />
	</BoundingBox>
	<ForceFieldVisualization TimeToLive="10,20">
		<Trail HeadHeight="5"
			HeadMaterial="ForceFieldAccuracy/LightRibbonTrailHead"
			HeadWidth="5"
			Material="ForceFieldAccuracy/LightRibbonTrail"
			MaxElements="20"
			NumberOfChains="1"
			TrailLength="50"
			UseColours="true"
			UseTextureCoords="true">
			<Chain ColorChange="0.1, 0.1, 0.1, 0.1"
				Index="0"
				InitialColor="1.0, 0.8, 0"
				InitialWidth="4"
				WidthChange="0.5" />
		</Trail>
	</ForceFieldVisualization>
	<GroundLevel Value="300" />
	<Preset>
		<Camera Pos="-1.71709,-2.63182,266"
			Type="camera_script1" />
		<Jumper Create="1"
			Position="-164.68,89.6031,0" />
		<Wind Enabled="true">
			<Region>
				<Description>Creates wind in a given direction.

Use Radius1 to set the direction and strength of the wind.
No change with the time</Description>
				<Function>-- 1CONSTANT_FUNCTION --
function CalculateForce()
  -- Direction of the wind depends on the position of the Radius1
  Direction = Radius1Pos - FieldCenter;
  -- Make it a direction 
  Direction:normalize();
  -- Strength of the field depends on the Radius1
  return Direction * Radius1 * 0.1;
end

-- Remember the maximum strength
MaximumStrength = Radius1;
-- Maximum change of the wind (per second)
MaxChange = 10;
-- Start with half of the wind strength
Radius1 = Radius1 / 2;
-- Time period not to change the change of the speed (seconds)
MaxTimePeriod = 2;
-- Current time period
TimePeriod = 0;
Change =0;

function Update()
  TimePeriod = TimePeriod + DeltaTime;
  if(TimePeriod &gt; MaxTimePeriod)then
     TimePeriod = 0;
    -- Change radius
    Change = (math.random() * MaxChange) - (MaxChange / 2);
  end
  Radius1 = Radius1 + Change * DeltaTime;
  -- Make sure that strength is in the proper limits  
  if(Radius1 &gt; MaximumStrength)then
     Radius1 = MaximumStrength;
  elseif(Radius1 &lt; 0)then
     Radius1 = 0;
  end
end</Function>
				<Radius Name="1"
					Position="-33.2919,1.8373,0">Direction and strength of the wind</Radius>
				<Radius Name="2"
					Position="-8.7652,0.869394,0">Not used</Radius>
				<Radius Name="3"
					Position="-3.7652,-4.13061,0">Not used</Radius>
				<Shape Orientation="1,0,0,0"
					Position="-3.7652,0.869394,0"
					Size="364.945,221.337,20" />
			</Region>
		</Wind>
	</Preset>
	<SkyBox Distance="5000"
		Material="ForceFieldAccuracy/SkyBox/CloudySky" />
	<Stream File="../data/sounds/wind.mp3"
		Loop="true"
		Name="BgMusic" />
	<Target File="../data/ForceFieldAccuracy/models/PortalTarget.phs"
		Material="Target"
		Name="Target"
		Orientation="1, 0, 0, 0"
		Position="150.647,-89.4024,0" />
</scene>
