7 #include <SimoxUtility/math/normal/normal_to_mat4.h>
8 #include <SimoxUtility/math/convert/rpy_to_mat3f.h>
9 #include <SimoxUtility/math/pose/transform.h>
19 dir = dir.normalized();
20 Eigen::Vector3f naturalDir = Eigen::Vector3f::UnitY();
21 Eigen::Vector3f
cross = naturalDir.cross(dir);
22 float dot = naturalDir.dot(dir);
24 if (
cross.squaredNorm() < 1.0e-12)
27 cross = Eigen::Vector3f::UnitX();
37 Eigen::Vector3f axis =
cross.normalized();
48 const std::string& relativeObjectsDirectory)
54 const std::string& relativeObjectsDirectory)
56 ObjectInfo info(objectsPackage,
"", relativeObjectsDirectory, objectID);
73 return pose(b.transformation_centered());
78 size(b.dimensions<
float>());
79 return pose(b.transformation_centered<
float>());
105 Eigen::Vector3f naturalDir = Eigen::Vector3f::UnitZ();
106 Eigen::Vector3f
cross = naturalDir.cross(dir);
107 float angle = std::acos(naturalDir.dot(dir));
108 if (
cross.squaredNorm() < 1.0e-12f)
111 cross = Eigen::Vector3f::UnitX();
114 Eigen::Vector3f axis =
cross.normalized();
124 points.reserve(ps.size());
127 points.push_back(armarx::Vector3f{p.x(), p.y(), p.z()});
136 Eigen::Vector3f::UnitZ(),
plane.normal());
137 return this->
plane(plane.projection(at), ori, size);
142 const Eigen::Vector3f x = 0.5f * size.x() * (
orientation * Eigen::Vector3f::UnitX());
143 const Eigen::Vector3f y = 0.5f * size.y() * (
orientation * Eigen::Vector3f::UnitY());
158 const float angle = 2 *
M_PI / tessellation;
161 Eigen::Vector3f lastLocalPoint = Eigen::Vector3f::UnitX() * radius;
162 addPoint(simox::math::transform_position(
pose, lastLocalPoint));
163 while (--tessellation)
165 const Eigen::Vector3f localPoint = rot * lastLocalPoint;
166 addPoint(simox::math::transform_position(
pose, localPoint));
167 lastLocalPoint = localPoint;