jeudi 20 août 2015

Hamiltonian mechanics-based physics engine

I am trying to implement a physics engine based around hamiltonian mechanics. Facing several problems, such as to

  1. Differentiate the H function
  2. Partially evaluate a partial derivative of the H function for an efficient use of the Runge-Kutta method

I decided to represent functions as struct (Partial evaluation of a function represented as a struct).

However, combining the code of C++ templates with standart C++ code proves difficult. Moreover, evaluating a struct-function appears to take at least 2× more time than a corresponding standart function.

So I ask the Stackoverflow community, whether should I keep my approach or change it.

Aucun commentaire:

Enregistrer un commentaire