From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

BGE Eigen2 Proposal

Introduction

Currently the Blender Game Engine is using MoTo as its math library. MoTo is old and unoptimized. Aside from this, MoTo has also been labeled as “dead,” which means it would be in the BGE’s best interest to switch anyways.


Pros

  • Eigen2 is a fast and SSE/SSE2 optimized library
  • Eigen2 is also maintained (MoTo has not gotten much attention since rev2)
  • The BGE would no longer be forced to use the same scalar value as the rest of Blender


Cons

  • Eigen2 is faster than MoTo, but the overall affect this will have on the BGE’s speed is not yet known. At the very least, it will not be slower.
  • Changing all the math in the BGE to use Eigen2 can (and probably will) cause bugs. However, hopefully, sufficient testing can be done in a branch (see “What We Need”) to eliminate as many bugs as possible.


Implementation

A file (EigenTypes.h) will be created in source/gameengine/Expressions that will do some helpful defines and include Eigen/Core. Instead of including individual MoTo includes, files will now simply include EigenTypes.h. From here a module at a time (ie, SceneGraph, Rasterizer) will be tackled at a time and converted to using the new Eigen types. MoTo types will be swapped for Eigen types when it allows, otherwise code will be modified to better allow the use of the Eigen types.


Recommended Actions

The following is a table of recommended actions to perform when certain situations arise. The table will be used as a reference and filled out as we go along.

Situation Recommended Action

None yet

None yet


Progress

The following table shows the current progress (last updated 1/4/2009)

Incomplete In Progress Pending Review Complete
  • Blender Routines
  • Converter
  • Expressions
  • GameLogic
  • GamePlayer
  • Ketsji
  • Network
  • Physics
  • SceneGraph
  • VideoTexture
  • None
  • None
  • None


What We Need

Three people have decided to undertake this project (Gomer, Kupoman and Moguri), but we’ll need a couple things to help us.

  • Someone to review/commit code and provide some guidance.
    • None of us have commit rights, and we’ll need someone to check us to make sure we don’t do anything stupid.
  • A branch
    • There will be a lot of changes made to BGE code. These kinds of sweeping changes are best done in a branch were coders can keep all the changes under version control.