CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
mat4 Class Reference

#include <mat4.h>

Public Member Functions

void BuildOrthographicMatrix (float left, float right, float top, float bottom, float near, float far)
 
 mat4 ()
 
 mat4 (float r00, float r10, float r20, float r01, float r11, float r21, float r02, float r12, float r22, float x, float y, float z)
 
 mat4 (const mat4 &mat)
 
void MulVec (const float *vecIn, float *vecOut)
 
mat4operator & (const mat4 &mat)
 
mat4 operator* (float s) const
 
mat4 operator+ (const mat4 &mat) const
 
mat4operator= (const mat4 &mat)=default
 
float & operator[] (unsigned i)
 
float operator[] (unsigned i) const
 

Public Attributes

float data [12]
 

Detailed Description

Definition at line 9 of file mat4.h.

Constructor & Destructor Documentation

◆ mat4() [1/3]

mat4::mat4 ( )
inline

Definition at line 13 of file mat4.h.

13 {}

◆ mat4() [2/3]

mat4::mat4 ( float  r00,
float  r10,
float  r20,
float  r01,
float  r11,
float  r21,
float  r02,
float  r12,
float  r22,
float  x,
float  y,
float  z 
)
inline

Definition at line 15 of file mat4.h.

References data, x, y, and z.

26  {
27  data[0] = r00;
28  data[1] = r10;
29  data[2] = r20;
30 
31  data[3] = r01;
32  data[4] = r11;
33  data[5] = r21;
34 
35  data[6] = r02;
36  data[7] = r12;
37  data[8] = r22;
38 
39  data[9] = x;
40  data[10] = y;
41  data[11] = z;
42  }
float data[12]
Definition: mat4.h:11

◆ mat4() [3/3]

mat4::mat4 ( const mat4 mat)
inline

Definition at line 44 of file mat4.h.

References data, and mps_fire::i.

44  {
45  for (unsigned i = 0; i < 12; ++i)
46  data[i] = mat[i];
47  }
float data[12]
Definition: mat4.h:11

Member Function Documentation

◆ BuildOrthographicMatrix()

void mat4::BuildOrthographicMatrix ( float  left,
float  right,
float  top,
float  bottom,
float  near,
float  far 
)
inline

Definition at line 88 of file mat4.h.

References data.

Referenced by SiPixelPhase1Analyzer::SiPixelPhase1Analyzer().

88  {
89  float rmli = 1.0f / (right - left);
90  float rpl = right + left;
91 
92  float tmbi = 1.0f / (top - bottom);
93  float tpb = top + bottom;
94 
95  float fmni = 1.0f / (far - near);
96  float fpn = far + near;
97 
98  data[0] = 2.0f * rmli;
99  data[1] = 0.0f;
100  data[2] = 0.0f;
101 
102  data[3] = 0.0f;
103  data[4] = 2.0f * tmbi;
104  data[5] = 0.0f;
105 
106  data[6] = 0.0f;
107  data[7] = 0.0f;
108  data[8] = -2.0f * fmni;
109 
110  data[9] = -rpl * rmli;
111  data[10] = -tpb * tmbi;
112  data[11] = -fpn * fmni;
113  }
float data[12]
Definition: mat4.h:11

◆ MulVec()

void mat4::MulVec ( const float *  vecIn,
float *  vecOut 
)
inline

Definition at line 79 of file mat4.h.

References data, mps_fire::i, dqmiolumiharvest::j, and groupFilesInBlocks::temp.

Referenced by SiPixelPhase1Analyzer::BookForwardBins().

79  {
80  for (unsigned i = 0; i < 3; ++i) {
81  float temp = 0;
82  for (unsigned j = 0; j < 3; ++j) {
83  temp += data[3 * j + i] * vecIn[j];
84  }
85  vecOut[i] = temp + data[9 + i];
86  }
87  }
float data[12]
Definition: mat4.h:11

◆ operator &()

mat4& mat4::operator& ( const mat4 mat)
inline

Definition at line 51 of file mat4.h.

References data, and mps_fire::i.

51  {
52  if (this != &mat) {
53  for (unsigned i = 0; i < 12; ++i)
54  data[i] = mat[i];
55  }
56  return *this;
57  }
float data[12]
Definition: mat4.h:11

◆ operator*()

mat4 mat4::operator* ( float  s) const
inline

Definition at line 67 of file mat4.h.

References mps_fire::i, alignCSCRings::s, and createJobs::tmp.

67  {
68  mat4 tmp;
69  for (unsigned i = 0; i < 12; ++i)
70  tmp[i] = (*this)[i] * s;
71 
72  return tmp;
73  }
Definition: mat4.h:9
tmp
align.sh
Definition: createJobs.py:716

◆ operator+()

mat4 mat4::operator+ ( const mat4 mat) const
inline

Definition at line 59 of file mat4.h.

References mps_fire::i, and createJobs::tmp.

59  {
60  mat4 tmp;
61  for (unsigned i = 0; i < 12; ++i)
62  tmp[i] = (*this)[i] + mat[i];
63 
64  return tmp;
65  }
Definition: mat4.h:9
tmp
align.sh
Definition: createJobs.py:716

◆ operator=()

mat4& mat4::operator= ( const mat4 mat)
default

◆ operator[]() [1/2]

float& mat4::operator[] ( unsigned  i)
inline

Definition at line 75 of file mat4.h.

References data, and mps_fire::i.

75 { return data[i]; }
float data[12]
Definition: mat4.h:11

◆ operator[]() [2/2]

float mat4::operator[] ( unsigned  i) const
inline

Definition at line 77 of file mat4.h.

References data, and mps_fire::i.

77 { return data[i]; }
float data[12]
Definition: mat4.h:11

Member Data Documentation

◆ data

float mat4::data[12]