Difference between revisions of "Wm3→Eigen"

From Yade

(Created page with '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. …')
 
m
Line 15: Line 15:
 
|-
 
|-
 
| ONE, ZERO, UNIT_X, UNIT_Y, UNIT_Z
 
| ONE, ZERO, UNIT_X, UNIT_Y, UNIT_Z
| One(), Zero(), UnitX(), UnitY(), UnitZ() [note call parentheses]
+
| Ones(), Zero(), UnitX(), UnitY(), UnitZ() [note call parentheses]
 
|-
 
|-
 
| W(), X(), Y(), Z()
 
| W(), X(), Y(), Z()

Revision as of 19:15, 25 April 2010

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], ..). Such cases will be removed from code from 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
Quaterion::ToAxisAngle function quatToAngleAxis (will be replaced by AngleAxis(Quaterion) constructor with eigen)
Quaternion::FromAxisAngle Quaternion(AngleAxis) constructor
Matrix3::EigenDecomposition (only once in clump code, handled by hand)