Coordinates and Units System

Harfang uses a left-handed coordinate system with the X axis pointing right, the Y axis pointing up and the Z axis pointing away from the viewer. For units, it uses the International System of Units (SI) or metric system:

  • Distances are expressed in meters, see Mtr, Cm and Mm.
  • Angles are expressed in radians, see Rad and Deg.

Time is internally stored in nanoseconds as a 64 bit integer, many functions are available to convert to and from different units of time:

Note: Storing time as integer is extremely important! As values in nanoseconds get very large, very fast, floating point representations will quickly loose precision due to quantization. If you really need time as a floating point value, you should perform fixed-point arithmetics on integer representation then convert the result to floating point as the very last step.

The current system time can be queried using time_now.