Skip to content

Upgrade curve module: refactoring, performance improvements and new functionality for quaternion curves

Philipp Seiwald requested to merge philipp_quaternion_curve into dev-v2

Refactoring

Curve Module

  • Quaternion curves are now derived either from QuaternionCurveFixedSize (fixed count of control point quaternions) or QuaternionCurveDynamicSize (dynamic count of control point quaternions).
  • Restructured inheritance hierarchy of (euclidean/quaternion) curves, splines and trajectories: now each curve type got its own derived spline and trajectory.
  • Splitted interpolate functions into more granular protected functions (to improve readability - API not affected)
  • Complete overhaul of unit-tests for curve-module (to fit new inheritance hierarchy and to cover more functions/cases)

New Functionality

Core Module

  • Added functions to compute quaternion exponential, (natural) logarithm and power (quaternion to the power of a scalar and quaternion to the power of another quaternion)
  • Added functions to compute integer tuples for general Leibniz formula (derivative of a product of functions)
  • Added binomial and multimonial coefficient
  • Added custom implementation of SLERP
    • In contrast to Eigen's version this function allows the user to specify if the keyframe quaternions should be flipped (q -> -q) such that the result describes the shortest path on the unit sphere. In some cases (e.g. for quaternion Bezier and SQUAD curves we do not want the shortest distance, since this represents a (discontinuous) switching, which in turn breaks C1-continuity of Bezier and SQUAD).

Curve Module

  • Implemented numeric derivatives for all curves and quaternion curves
  • Implemented (dummy) high-performance evaluation functions (D0D1 and D0D1D2) for all curves and quaternion curves. For curves and quaternion curves where an analytic derivative is known, these functions are overwritten by efficient implementations which reuse intermediate results.
  • Implemented BSplineBasis, BSplineBasisSample and CumulativeBSplineBasisSample as background for quaternion B-spline curves (may be used for euclidean B-spline curves in future as well).
  • New quaternion curves and interpolation methods: LERP, NLERP, Bezier, SQUAD and BSpline
  • Unit-tests for all new curves and interpolation methods

Bug Fixes

  • (Uncritical) math::factorial: In case of an overflow now returns "1" instead of "0" (to prevent division by zero in typical applications)
  • (Uncritical) Improved overflow handling in computation of Faa di Bruno tuples

Minor Improvements

  • Minor improvements in documentation (mainly core and curve module)
  • Added assert's at various places to detect algorithmic failures in DEBUG mode
  • Minor performance improvements in curve-module (mainly functions related to evaluation)
Edited by Philipp Seiwald

Merge request reports