17[[maybe_unused]] [[nodiscard]]
Unit toUnit(
const std::string& unitStr) {
18 if (unitStr ==
"m" || unitStr ==
"M") {
20 }
else if (unitStr ==
"dm" || unitStr ==
"DM") {
22 }
else if (unitStr ==
"cm" || unitStr ==
"CM") {
24 }
else if (unitStr ==
"mm" || unitStr ==
"MM") {
31[[maybe_unused]] [[nodiscard]] std::string_view
toString(
const Unit& unit) {
70 "{}: Unknown unit '{}' found in the file. Use centimeters instead.",
87 return {vec_in_cm.y(), vec_in_cm.z(), vec_in_cm.x()};
89 return {vec_in_cm.x(), vec_in_cm.z(), -vec_in_cm.y()};
93 return {vec_in_cm.x(), -vec_in_cm.z(), vec_in_cm.y()};
UpVector
This enumeration is used to define the primary up vector directions for various coordinate systems an...
@ YNeg
Negative Y-axis up vector.
Unit
An enumeration representing the units of measurement used in marker data files.
@ Unknown
Unknown unit of measurement.
LengthUnit
Specifies the unit of length measurement.
Vector3< T > toMomentumVector3(const Vector3< T > &vec, UpVector up, Unit unit)
This function converts a 3D vector in the mocap marker coordinate system to the Momentum coordinate s...
std::string_view toString(const LimitType type)
T scaleFactor(const CoordinateSystem &from, const CoordinateSystem &to)
Returns the length scale factor when converting a length from from's unit to to's unit.
A 3D coordinate system defined by its up axis, handedness, and length unit.