Attributes: Add quaternion rotation type #108678

Merged
Hans Goudey merged 10 commits from HooglyBoogly/blender:attributes-quaternion-type into main 2023-06-12 15:49:57 +02:00
1 changed files with 3 additions and 10 deletions
Showing only changes of commit d122c6587a - Show all commits

View File

@ -39,26 +39,19 @@ template<typename T> struct QuaternionBase {
QuaternionBase() = default;
QuaternionBase(const T &new_w, const T &new_x, const T &new_y, const T &new_z)
: w(new_w), x(new_x), y(new_y), z(new_z)
{
}
: w(new_w), x(new_x), y(new_y), z(new_z){};
/**
* Creates a quaternion from an vector without reordering the components.
* \note Component order must follow the scalar constructor (w, x, y, z).
*/
explicit QuaternionBase(const VecBase<T, 4> &vec)
: QuaternionBase(vec[0], vec[1], vec[2], vec[3])
{
}
explicit QuaternionBase(const VecBase<T, 4> &vec) : QuaternionBase(UNPACK4(vec)){};
/**
* Creates a quaternion from real (w) and imaginary parts (x, y, z).
*/
QuaternionBase(const T &real, const VecBase<T, 3> &imaginary)
: QuaternionBase(real, UNPACK3(imaginary))
{
}
: QuaternionBase(real, UNPACK3(imaginary)){};
/** Static functions. */