Wm3→Eigen

From Yade

This page summarizes API changes between Wm3 and Eigen, which yade will end up using soon.

To compile with deprecation warnings for Wm3 API, add the eigen-compat feature. Grep away warning comping from lib/miniWm3/* headers (comptibility functions call deprecated API functions and trigger those warning). You can capture build output to file:

scons > build.log 2>&1

and then grep only interesting warnings:

grep 'is deprecated' build.log  | cut -f1,2 -d\' |grep -v miniWm3

Compilation in pure-eigen mode is not yet supported.

Trivial changes
ONE, ZERO, UNIT_X, UNIT_Y, UNIT_Z Ones(), Zero(), UnitX(), UnitY(), UnitZ() [note call parentheses]
W(), X(), Y(), Z() w(), x(), y(), z()
Dot, Cross, Transpose, Conjugate, Inverse, Determinant dot, cross, transpose, conjugate, inverse, determinant
Non-trivial changes
Quaternion::Align Quaternion::setFromTwoVectors
Vector3::Normalize() returns void, not norm anymore. Code adapted at affected places.
Quaternion::operator[] Quaternion which stores elements in different order: x=[0], y=[1] (was: w=[0], x=[1], ..). Removed from code for clarity.
Matrix3::operator[] (i.e. matrix[0][2] access) use matrix(0,2) instead
Length(), SquaredLength() norm(), squaredNorm()
Quaternion::ToRotationMatrix, Quaternion::FromRotationMatrix use constructors Quaternion(Matrix3) and Matrix3(Quaternion) directly
Quaternion::ToAxisAngle us AxisAngle aa(axisAngleFromQuat(q)) which will be later trivially replaced by constructor in eigen, AxisAngle aa(q).
Quaternion::FromAxisAngle Quaternion(AngleAxis) constructor
Matrix3::EigenDecomposition (only once in clump code, handled by hand)
Matrix3::MakeTensorProduct outer product; use makeTensorProduct(v1,v2) for compatibility now (vec1*vec2.transposed() in eigen)