20 const Vector3 rotAngles = rotation.eulerAngles(2, 1, 0);
21 double sx = std::sin(rotAngles(2));
22 double cx = std::cos(rotAngles(2));
23 double sy = std::sin(rotAngles(1));
24 double cy = std::cos(rotAngles(1));
25 double sz = std::sin(rotAngles(0));
26 double cz = std::cos(rotAngles(0));
34 rotToLocalXAxis.col(0) =
Vector3(0, 0, 0);
35 rotToLocalXAxis.col(1) =
Vector3(-cz * sy, -sz * sy, -cy);
36 rotToLocalXAxis.col(2) =
Vector3(-sz * cy, cz * cy, 0);
39 rotToLocalYAxis.col(0) =
40 Vector3(cz * sy * cx + sz * sx, sz * sy * cx - cz * sx, cy * cx);
41 rotToLocalYAxis.col(1) =
Vector3(cz * cy * sx, sz * cy * sx, -sy * sx);
42 rotToLocalYAxis.col(2) =
43 Vector3(-sz * sy * sx - cz * cx, cz * sy * sx - sz * cx, 0);
46 rotToLocalZAxis.col(0) =
47 Vector3(sz * cx - cz * sy * sx, -sz * sy * sx - cz * cx, -cy * sx);
48 rotToLocalZAxis.col(1) =
Vector3(cz * cy * cx, sz * cy * cx, -sy * cx);
49 rotToLocalZAxis.col(2) =
50 Vector3(cz * sx - sz * sy * cx, cz * sy * cx + sz * sx, 0);