Howto:Implement generic tyre smoke

From FlightGear wiki
Jump to: navigation, search
Tyre smoke, as seen on a Boeing 727-230 at touchdown.

Tyre smoke often refers to the smoke that is visible when an aircraft touches down. This arises when stationary wheels hit the ground at high speeds; a little layer of rubber is burned due to the friction between the tyre and the runway.

Following this howto, you will be able to add tyre smoke when landing and spray when it is raining to your aircraft. The here explained method works with both YASim and JSBSim.

The examples below are for a 3-point-gear, but you can use more gears of course!

Nasal/tyresmoke.nas

Create a folder in $FG ROOT/Aircraft/YourAircraft called Nasal, if not already there. Create a file called tyresmoke.nas with the following lines inside:

 #============================ Tyre Smoke ===================================
 aircraft.tyresmoke_system.new(0, 1, 2);
 #============================ Rain ===================================
 aircraft.rain.init();
 var rain = func {
	 aircraft.rain.update();
	 settimer(rain, 0);
 }
 # == fire it up ===
 rain()
 # end

Pass the indices of gears you would like to produce smoke.

-set.xml

At the bottom of the file, add the link to the nasal-file, between the <nasal> and </nasal> tags. Do not place them between the <sim>-tags!

 <tyresmoke>
   <file>Aircraft/''YourAircraft''/Nasal/tyresmoke.nas</file>
 </tyresmoke>

Models/model.xml

Insert the following lines into the .xml file that contains your aircraft's animations, in your Models/ folder and change the ccordinates so it matches with your gear. This are examples for a 3-point-gear- it links to the Aircraft/Generic/Effects-folder.

You can create of course your own Effect-file if you want. Just regard the correct link!

 <model>
  <path>Aircraft/Generic/Effects/tyre-smoke-nose.xml</path>
  <name>tyre-smoke-n</name>
  <offsets>
   <x-m>-4.669</x-m>
   <y-m>0</y-m>
   <z-m>-2.484</z-m>
  </offsets>
 </model>
 
 <model>
  <path>Aircraft/Generic/Effects/tyre-smoke-port.xml</path>
  <name>tyre-smoke-p</name>
  <offsets>
   <x-m>7.962</x-m>
   <y-m>-2.634</y-m>
   <z-m>-2.784</z-m>
  </offsets>
 </model>
 
 <model>
  <path>Aircraft/Generic/Effects/tyre-smoke-stbd.xml</path>
  <name>tyre-smoke-s</name>
  <offsets>
   <x-m>7.962</x-m>
   <y-m>2.634</y-m>
   <z-m>-2.784</z-m>
  </offsets>
 </model>

Now you have tyre-smoke when landing, and spray when it is raining on your aircraft!