ai_matrix_private.h
Go to the documentation of this file.
1 // Copyright 2020 Autodesk, Inc. All rights reserved.
2 //
3 // Use of this software is subject to the terms of the Autodesk license
4 // agreement provided at the time of installation or download, or which
5 // otherwise accompanies this software in either electronic or hard copy form.
6 
11 #pragma once
12 #include <cstring>
13 #include <stdint.h>
14 
15 #ifdef _ARNOLDDLL
16 template <uint8_t ROWS, uint8_t COLS, typename T = float>
17 struct AtMatrixBase
18 {
19  AI_DEVICE constexpr bool operator==(const AtMatrixBase& m) const
20  {
21  // watch out, this will return false for +0.0 == -0.0 and true for matching NaNs
22  return !memcmp(data, m.data, sizeof(AtMatrixBase));
23  }
24 
25  AI_DEVICE constexpr const T* operator[](int t) const
26  {
27  return (const T*) &(data[t][0]);
28  }
29 
30  AI_DEVICE T* operator[](int t)
31  {
32  return &(data[t][0]);
33  }
34 
35  T data[ROWS][COLS];
36 };
37 
38 /* 4-by-4 matrix of floats */
39 using AtMatrix = AtMatrixBase<4, 4, float>;
40 #endif
Definition: ai_matrix.h:30

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com