HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PyImathVecOperators.h
Go to the documentation of this file.
1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright Contributors to the OpenEXR Project.
4 //
5 
6 // clang-format off
7 
8 #ifndef _PyImathVecOperators_h_
9 #define _PyImathVecOperators_h_
10 
11 namespace PyImath {
12 
13 template <class T>
14 struct op_vecDot {
15  static inline typename T::BaseType apply(const T &a, const T &b) { return a.dot(b); }
16 };
17 
18 template <class T,
20 struct op_vecLength {
21  static inline typename T::BaseType apply(const T &v) { return v.length(); }
22 };
23 
24 template <class T>
25 struct op_vecLength2 {
26  static inline typename T::BaseType apply(const T &v) { return v.length2(); }
27 };
28 
29 template <class T,
32  static inline void apply(T &v) { v.normalize(); }
33 };
34 
35 template <class T,
38  static inline T apply(const T &v) { return v.normalized(); }
39 };
40 
41 template <class T,
44  static inline void apply(T &v) { v.normalizeExc(); }
45 };
46 
47 template <class T,
50  static inline T apply(const T &v) { return v.normalizedExc(); }
51 };
52 
53 template <class T>
54 struct op_vec3Cross {
55  static inline IMATH_NAMESPACE::Vec3<T> apply(const IMATH_NAMESPACE::Vec3<T> &a, const IMATH_NAMESPACE::Vec3<T> &b) { return a.cross(b); }
56 };
57 
58 template <class T>
59 struct op_vec2Cross {
60  static inline T apply(const IMATH_NAMESPACE::Vec2<T> &a, const IMATH_NAMESPACE::Vec2<T> &b) { return a.cross(b); }
61 };
62 
63 } // namespace PyImath
64 
65 #endif // _PyImathVecOperators_h_
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLfloat * value
Definition: glcorearb.h:824
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
static T::BaseType apply(const T &v)
static T::BaseType apply(const T &a, const T &b)
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
#define IMATH_ENABLE_IF(...)
static T::BaseType apply(const T &v)
static IMATH_NAMESPACE::Vec3< T > apply(const IMATH_NAMESPACE::Vec3< T > &a, const IMATH_NAMESPACE::Vec3< T > &b)
static T apply(const T &v)
static T apply(const IMATH_NAMESPACE::Vec2< T > &a, const IMATH_NAMESPACE::Vec2< T > &b)