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 (const mat4 &mat)
 
 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)
 
void MulVec (const float *vecIn, float *vecOut)
 
mat4operator& (const mat4 &mat)
 
mat4 operator* (float s) const
 
mat4 operator+ (const mat4 &mat) const
 
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.

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  }

References data, x, y, and z.

◆ mat4() [3/3]

mat4::mat4 ( const mat4 mat)
inline

Definition at line 44 of file mat4.h.

44  {
45  for (unsigned i = 0; i < 12; ++i)
46  data[i] = mat[i];
47  }

References data, and mps_fire::i.

Member Function Documentation

◆ BuildOrthographicMatrix()

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

Definition at line 86 of file mat4.h.

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

References data.

Referenced by SiPixelPhase1Analyzer::SiPixelPhase1Analyzer().

◆ MulVec()

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

Definition at line 77 of file mat4.h.

77  {
78  for (unsigned i = 0; i < 3; ++i) {
79  float temp = 0;
80  for (unsigned j = 0; j < 3; ++j) {
81  temp += data[3 * j + i] * vecIn[j];
82  }
83  vecOut[i] = temp + data[9 + i];
84  }
85  }

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

Referenced by SiPixelPhase1Analyzer::BookForwardBins().

◆ operator&()

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

Definition at line 49 of file mat4.h.

49  {
50  if (this != &mat) {
51  for (unsigned i = 0; i < 12; ++i)
52  data[i] = mat[i];
53  }
54  return *this;
55  }

References data, and mps_fire::i.

◆ operator*()

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

Definition at line 65 of file mat4.h.

65  {
66  mat4 tmp;
67  for (unsigned i = 0; i < 12; ++i)
68  tmp[i] = (*this)[i] * s;
69 
70  return tmp;
71  }

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

◆ operator+()

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

Definition at line 57 of file mat4.h.

57  {
58  mat4 tmp;
59  for (unsigned i = 0; i < 12; ++i)
60  tmp[i] = (*this)[i] + mat[i];
61 
62  return tmp;
63  }

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

◆ operator[]() [1/2]

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

Definition at line 73 of file mat4.h.

73 { return data[i]; }

References data, and mps_fire::i.

◆ operator[]() [2/2]

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

Definition at line 75 of file mat4.h.

75 { return data[i]; }

References data, and mps_fire::i.

Member Data Documentation

◆ data

float mat4::data[12]
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
DDAxes::x
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDAxes::z
mat4
Definition: mat4.h:9
mat4::data
float data[12]
Definition: mat4.h:11
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66