Motive Animation System
An open source project by FPL.
 All Classes Functions Variables Typedefs Friends Pages
Building Motive from Loose Cpp Files

If you prefer, you can ignore the included build scripts, and manually add Motive to your build system by simply,

  • compliling the files under motive/src/motive
  • adding motive/include to your list of include directories

Note that, when compiling motive/src/motive, you'll also need these include directories: mathfu/include, mathfu/benchmarks, and fplutil/libfplutil/include.

Note also that compilation of motive/src/io/flatbuffers.cpp is optional (see below).

Enabling SIMD

Motive runs best with mathfu's SIMD support enabled. Support is enabled by default, but you may have to add a compiler flag to enable SIMD instructions on your compiler. Please see the enable_simd section of MathFu's CMakeLists.txt file for details.

Compile Defines

You can add defines to enable the options below. For example, use /Ddefine_name with the Visual Studio (or use Configuration Properties\ C,C++ \ Preprocessor), or -Ddefine_name on g++.

  • BENCHMARK_MOTIVE – Analyse the runtime of each MotiveProcessor and periodically output a histogram of these runtimes.
  • MOTIVE_ASSEMBLY_TEST – Define as Neon to run both the NEON and C++ versions of the code and compare the results. Useful for testing assembly language functions. Currently only NEON functions exist.
  • MOTIVE_NEON – Optimize with NEON SIMD instructions. To assemble bulk_spline_evaluator_neon.s, you'll need ensure that the NEON instruction set is enabled on your assembler, for example with the -mfpu=neon option on gcc.
  • FPL_CURVE_GRAPH_FUNCTIONS – Compile functions that draw ASCII art representations of mathematical curves. These are useful for debugging, but they also consume code space.

Building Motive's FlatBuffer Support from Loose Cpps

You can optionally use FlatBuffers to quickly load your Motive data in binary format, and to easily edit your data in text format (json).

Motive's FlatBuffer support is accessed with motive/include/io/flatbuffers.h. To add support for this header, you'll need to compile motive/src/io/flatbuffers.cpp.

Before you compile motive/src/io/flatbuffers.cpp, you need to call the FlatBuffer compiler flatc to generate a header file for motive's FlatBuffer schemas.

flatc -o generated_includes -c motive/schemas/motive.fbs

This will create generated_includes/motive_generated.h. You should add generated_includes to your include path when compiling motive/src/io/flatbuffers.cpp.

The flatc compiler can be downloaded from the latest FlatBuffer release, or you can build it yourself (see FlatBuffers build instructions).