@@ -29,22 +29,22 @@ struct rerun::ComponentBatchAdapter<rerun::components::Position3D, std::vector<E
29
29
30
30
// Adapters so we can log an eigen matrix as rerun positions:
31
31
template <>
32
- struct rerun ::ComponentBatchAdapter<rerun::components::Position3D, Eigen::MatrixX3f > {
32
+ struct rerun ::ComponentBatchAdapter<rerun::components::Position3D, Eigen::Matrix3Xf > {
33
33
// Sanity check that this is binary compatible.
34
34
static_assert (
35
35
sizeof (components::Position3D) ==
36
- sizeof (Eigen::MatrixX3f ::Scalar) * Eigen::MatrixX3f::ColsAtCompileTime
36
+ sizeof (Eigen::Matrix3Xf ::Scalar) * Eigen::Matrix3Xf::RowsAtCompileTime
37
37
);
38
- static_assert (alignof (components::Position3D) <= alignof (Eigen::MatrixX3f ));
38
+ static_assert (alignof (components::Position3D) <= alignof (Eigen::Matrix3Xf ));
39
39
40
- ComponentBatch<components::Position3D> operator ()(const Eigen::MatrixX3f & matrix) {
40
+ ComponentBatch<components::Position3D> operator ()(const Eigen::Matrix3Xf & matrix) {
41
41
return ComponentBatch<components::Position3D>::borrow (
42
42
reinterpret_cast <const components::Position3D*>(matrix.data ()),
43
- matrix.rows ()
43
+ matrix.cols ()
44
44
);
45
45
}
46
46
47
- ComponentBatch<components::Position3D> operator ()(std::vector<Eigen::MatrixX3f >&& container) {
47
+ ComponentBatch<components::Position3D> operator ()(std::vector<Eigen::Matrix3Xf >&& container) {
48
48
throw std::runtime_error (" Not implemented for temporaries" );
49
49
}
50
50
};
@@ -67,8 +67,8 @@ int main() {
67
67
const auto points3d_vector = generate_random_points_vector (1000 );
68
68
rec.log (" world/points_from_vector" , rerun::Points3D (points3d_vector));
69
69
70
- // Points represented by Eigen::MatX3f (Nx3 matrix)
71
- const Eigen::MatrixX3f points3d_matrix = Eigen::MatrixX3f ::Random (num_points, 3 );
70
+ // Points represented by Eigen::Mat3Xf (3xN matrix)
71
+ const Eigen::Matrix3Xf points3d_matrix = Eigen::Matrix3Xf ::Random (3 , num_points );
72
72
rec.log (" world/points_from_matrix" , rerun::Points3D (points3d_matrix));
73
73
74
74
// Posed pinhole camera:
0 commit comments