/ Using the OpenFlight Plugin

OpenSceneGraph

Knowledge Base

Using the OpenFlight Plugin

The OpenFlight format is an defacto industry standard format in the visual simulation industry, developed by Multigen Paradigm Inc. (MPI)
and currently maintained by Presagis. The OpenFlight file format specification is available for download.

The OSG OpenFlight plugin exists as a library named osgdb_openflight.<ext>, and it supports iimporting and exporting files with the .flt extension. As with any OSG plugin, documentation is available from the command line using osgconv as follows:

osgconv --format flt

Import Option Strings

billboardCenter Set billboard rotation point to center of face.
dofAnimation Enable animation on DOF nodes.
readObjectRecordData Read object records and store as osgSim::ObjectRecordData.
Texture:  
clampToEdge Use texture wrap mode CLAMP_TO_EDGE where CLAMP is specified.
noTextureAlphaForTransparancyBinning Do not enable alpha blending based on image translucency.
Structure:  
preserveFace Preserve Face information like name and comment by translating each face record into an osg::Geode.
preserveObject Preserve Object information.
Externals:  
keepExternalReferences Externals will be left as ProxyNodes.
cloneExternalReferences Externals are cloned.
Units conversion:  
convertToFeet Convert units to feet.
convertToInches Convert units to inches.
convertToMeters Convert units to meters.
convertToKilometers Convert units to kilometers.
convertToNauticalMiles Convert units to miles.
noUnitsConversion Disable units conversion. 

Export Option Strings

version=<ver> Specifies the version of the output FLT file. Supported values include 15.7, 15.8, and 16.1. Default is 16.1. Example: "version=15.8".
units=<units> Specifies the contents of the \c Units field of the FLT header record. Valid values include INCHES, FEET, METERS, KILOMETERS, and NATICAL_MILES. Default is METERS. Example: "units=METERS".
validate If present in the Options string, the plugin does not write a FLT file. Instead, it returns an indication of the scene graph's suitability for FLT export.
tempDir=<path> Specifies the directory to use for creation of temporary files. If not specified, the directory is taken from the file name. If the file doesn't contain a path, the current working directory is used. Applications should set this to the name of their app-specific temp directory. If the path contains spaces, use double quotes to ensure correct parsing. Examples: "tempDir=/tmp"; "tempDir=\"C:\\My Temp Dir\"".
lighting=<value> Specifies a default enable/disable state for lighting. By default, the exporter assumes lighting is enabled (GL_LIGHTING ON). Set this to either ON or OFF. Example: "lighting=OFF".
stripTextureFilePath If present in the Options string, the exporter strips the path from texture file names, and writes only the texure file name to the FLT Texture Palette. By default, the exporter doesn't strip the path, and the name written to the Texture Palette is taken directly from the osg::Image object referenced by the osg::Texture2D StateAttribute. 

If you encounter any issues with the exporter, please post to osg-users and include the following info:

  • .osg file for scene graph you are exporting
  • OSG_NOTIFY_LEVEL=INFO output
  • If a crash, include a stack trace

A regression test suite is available to test FLT export in OSG. Please checkout and run it to verify your build. Contributions to the test suite are welcome, please see the top-level readme.txt for contact information.

MultiGen, OpenFlight, and Flight Format are registered trademarks of MultiGen Inc.