Exercise manager. The structure and commands of the .vehicle file
What can be created
After creation of a new object type, a new file with .vehicle extension appears in the installation directory.
These files are regular text files which contain information about a vehicle added to the simulator.
They can be edited by any regular text editor, like notepad. But they can be modified by the program
in "Properties" dialog by adding new commands to it.
Commands begin with "!" sign. Below is the list of them. Most of commands are automatically generated
by the program (exercise manager).
Commands at the end of file can be generated by exercise manager (when you click "Properties"
in "Geometry" tab with exercise stopped); to reset file to original state, remove them.
Commands specified automatically by the program (but changeable manually)!OBJECTNAME
Specifies the name of object type, like
!OBJECTNAME Plastic motor boat
Vehicle type, it can be SHIP, SAILINGSHIP, SAILINGMOTORSHIP, AIRPLANE, WIG, SUBMARINE, NAVSIGN, HOVERCRAFT
where WIG is a wing-in-ground effect vehicle and NAVSIGN is any navigational sign, like a buoy;
in case of navigational signs, this file will have .navsign extension, not .vehicle.
Model file defines name of CAD file from where the object geometry will be loaded. This command
should precede all tranformation and etc. commands which deal with 3D object geometry.
This is a tranformation command to apply translation to the 3D model; the three numbers define
X,Y,Z vector components used while translating. We can call the same tranformation commands
a number of times, and they apply to the resulting transformation matrix one by one, from the
uppermost downwards. For instance,
!MODELMOVE 30.0 0.0 0.0
The desirable position of the origin is at the centre of hull along X, symmetric along Y, and
Z = 0 at waterline level for floating objects and the lowest body point for flying objects.
This is a rotation command to apply the transformation to the 3D model; the three numbers define
X,Y,Z vector of the axis around which the rotation is performed; the fourth number is number of
degrees. In general, the body should be oriented like this : axis X points forward from stern
to stem; axis Y points to the left, to port; axis Z points upwards. This command is used to
provide this orientation. Specify angle from -180.0 to +180.0, e.g.
!MODELROTATE 1.0 0.0 0.0 90.0
This command rescales model dimensions along the three axes. Can be used to convert model
sizes into metres (we measure distances in metres). Avoid zero values. This command converts from
millimetres to metres:
!MODELSCALE 0.001 0.001 0.001
This is a common form of transformation defined by the whole 4 x 4 transformation matrix, e.g.
!TRANSFORM -0.0000 1.00000 0.0 -145.44 -1.0000 -0.0000 0.0 56.6749 0.0 0.0 1.00000 -2.3436 0.0 0.0 0.0 1.00000
This is object length in metres; along waterline for for ships, like
This is object beam or fuselage width for aircraft:
Draft for ships and submarines at water surface:
Height over waterline for ships or over land for aircraft:
Main colour (STL files have no colour in their format), as R, G and B components, each from 0 to 255:
!COLOR 127 127 127
Maximum speed of object in knots (nautical miles (1852m) in hour):
Commands specified manually by .vehicle file edit (not necessary)!MAXAUDIODIST
Maximum distance in metres from which this object can be heard:
All vehicles emit sounds on ships bridge (in cockpit) or when passing by. By default, these sounds
are standard. But it is possible to replace the sounds by one from a WAV sound file. This command
specifies a PATH to an existing local file for the sound on the bridge.
The WAV file must conform to the following restrictions:
only standard RIFF files are accepted
the file must be uncompressed PCM (what is standard)
only 8 bit per sample!
sample rate must be 8000Hz
mono (1 channel) or stereo (2 channels) are OK
it is better if the sound is "closed", i.e. its end is stitched to its start, what means that
when being played multiple times, not produce "clicks"
sound duration must be not longer than approx 15 seconds, what means file length no more than
approx 15 x 8000 x 2 = 240000 bytes
Sound file for a passing-by object heard from another vehicle. Exactly the same as !BRIDGEWAVFILE.
If this vehicle is active, we need to specify default viewer position (eyes) (x,y,z), as well as box
(min,max) within which the viewer (actually his head) can move. The first three values specify default
viewer position; the next three - min box corner, and the last three - max box corner. These
coordinates are taken from ALREADY TRASFORMED model, that is, the coordinates can be taken from the object
with axis orientation and scaling already set correctly.
!BOX_VIEWER -2.4 0.0 2.4 -3.0 -0.4 2.4 -2.0 +0.4 2.4
This long command means "propeller rotating around axis X clockwise" (normal ship or aircraft propeller).
This and the following commands are intended to specify a part of CAD file located with a cube
defined by its min and max coordinates.
For this command it means that all triangles from STL file which are entirely within this box,
will rotate around axis X going through centroid made up of all these triangles. An example:
!BOX_PROPELLER_X_CW -125.4 -10.0 -11.3 -124.3 -2.4 -3.7 230 232 250
In addition, there are three RGB colour components at the end of the command line to paint the propeller
in different colour.
The same as !BOX_PROPELLER_X_CW but the propeller will rotate counter-clockwise.
!BOX_PROPELLER_X_CC -125.4 -10.0 -11.3 -124.3 -2.4 -3.7 230 232 250
Propeller for a helicopter rotating clockwise.
Propeller for a helicopter rotating counter-clockwise.
Rear propeller for a helicopter or thruster rotating clockwise.
Rear propeller for a helicopter or thruster rotating counter-clockwise.
This command defines a box and colour for a group of triangles. To paint a part of vehicle
in different colour, specify three colour components, like this:
!BOX_WINDOW 73.52 -0.5 16.46 75.27 0.5 27.22 16 16 16
To make a window (triangles inside the box will be missing), use the command without the last three
!BOX_WINDOW 73.52 -0.5 16.46 75.27 0.5 27.22