| 1 |
// |
| 2 |
// SPDX-License-Identifier: BSD-3-Clause |
| 3 |
// Copyright Contributors to the OpenEXR Project. |
| 4 |
// |
| 5 |
|
| 6 |
// clang-format off |
| 7 |
|
| 8 |
#ifndef _PyImathQuatOperators_h_ |
| 9 |
#define _PyImathQuatOperators_h_ |
| 10 |
|
| 11 |
#include <ImathQuat.h> |
| 12 |
|
| 13 |
namespace PyImath { |
| 14 |
|
| 15 |
template <class T> |
| 16 |
struct op_quatDot { |
| 17 |
static inline typename T::BaseType apply (const T &self, const T &qB) |
| 18 |
{ return self.euclideanInnerProduct (qB); } |
| 19 |
}; |
| 20 |
|
| 21 |
template <class T> |
| 22 |
struct op_quatNormalize { |
| 23 |
static inline void apply (T &self) |
| 24 |
{ self.normalize(); } |
| 25 |
}; |
| 26 |
|
| 27 |
template <class T> |
| 28 |
struct op_quatNormalized { |
| 29 |
static inline T apply (const T &self) |
| 30 |
{ return self.normalized(); } |
| 31 |
}; |
| 32 |
|
| 33 |
template <class T> |
| 34 |
struct op_quatSlerp { |
| 35 |
static inline T apply (const T &self, const T &qB, const typename T::BaseType t) |
| 36 |
{ return Imath::slerpShortestArc (self, qB, t); } |
| 37 |
}; |
| 38 |
|
| 39 |
|
| 40 |
} // namespace PyImath |
| 41 |
|
| 42 |
#endif // _PyImathQuatOperators_h_ |