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. …')
 
 
(3 intermediate revisions by the same user not shown)
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()
Line 32: Line 32:
 
|-
 
|-
 
| Quaternion::operator[]
 
| 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.
+
| 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)
 
| Matrix3::operator[] (i.e. matrix[0][2] access)
Line 43: Line 43:
 
| use constructors Quaternion(Matrix3) and Matrix3(Quaternion) directly
 
| use constructors Quaternion(Matrix3) and Matrix3(Quaternion) directly
 
|-
 
|-
| Quaterion::ToAxisAngle
+
| Quaternion::ToAxisAngle
| function quatToAngleAxis (will be replaced by AngleAxis(Quaterion) constructor with eigen)
+
| us '''AxisAngle aa(axisAngleFromQuat(q))''' which will be later trivially replaced by constructor in eigen, '''AxisAngle aa(q)'''.
 
|-
 
|-
 
| Quaternion::FromAxisAngle
 
| Quaternion::FromAxisAngle
Line 51: Line 51:
 
| Matrix3::EigenDecomposition
 
| Matrix3::EigenDecomposition
 
| (only once in clump code, handled by hand)
 
| (only once in clump code, handled by hand)
  +
|-
 
  +
| Matrix3::MakeTensorProduct
  +
| outer product; use makeTensorProduct(v1,v2) for compatibility now (vec1*vec2.transposed() in eigen)
 
|}
 
|}

Latest revision as of 09:14, 26 May 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], ..). 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)