5#include "dim/DimensionedValues.h"
6#include "spat/Position.h"
7#include "spat/Vector.h"
8#include "spat/Matrix.h"
11# pragma warning( push )
12# pragma warning( disable: 4244 )
13# pragma warning( disable: 4305 )
15#include <pxr/base/gf/vec3f.h>
16#include <pxr/base/gf/vec3d.h>
17#include <pxr/base/gf/quatf.h>
18#include <pxr/base/tf/token.h>
20# pragma warning( pop )
25 template<
class GfVect3Type >
27 return GfVect3Type{
_m(p.
x)/usdStageMetersPerUnit,
_m(p.
y)/usdStageMetersPerUnit,
_m(p.
z)/usdStageMetersPerUnit };
31 return pxr::GfVec3f{
_deg(rotAngles.
x),
_deg(rotAngles.
y),
_deg(rotAngles.
z) };
35 return pxr::GfVec3f{ rot.
dx, rot.
dy, rot.
dz };
39 inline pxr::GfQuatf CalculateQuaternionFromAxis(
const pxr::GfVec3f& axis,
float angle )
42 pxr::GfVec3f normalizedAxis = axis.GetNormalized();
45 float halfAngle = angle / 2.0f;
46 float sinHalfAngle = std::sin(halfAngle);
47 float cosHalfAngle = std::cos(halfAngle);
50 pxr::GfQuatf quaternion{
52 sinHalfAngle * normalizedAxis[0],
53 sinHalfAngle * normalizedAxis[1],
54 sinHalfAngle * normalizedAxis[2] };
Rotation matrix.
Definition Matrix.h:607
Valtype RotationAngle() const noexcept
Angle of the rotation described by this matrix.
Definition Matrix.h:2059
Vector< Valtype > RotationAxis() const noexcept
Axis of the rotation described by this matrix.
Definition Matrix.h:2028
constexpr Real _rad(Angle a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1202
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
constexpr Real _deg(Angle a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1194
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Implements a 3D - position in cartesian coordinates.
Definition Position.h:46
Valtype y
cartesian y coordinate.
Definition Position.h:50
Valtype z
cartesian z coordinate.
Definition Position.h:51
Valtype x
cartesian x coordinate.
Definition Position.h:49
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
Valtype dy
cartesian y component.
Definition Vector.h:52
Valtype dx
cartesian x component.
Definition Vector.h:51
Valtype dz
cartesian z component.
Definition Vector.h:53