CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
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::mat4 ( )
inline

Definition at line 13 of file mat4.h.

13 {}
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::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

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

Definition at line 86 of file mat4.h.

References data.

Referenced by SiPixelPhase1Analyzer::SiPixelPhase1Analyzer().

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  }
float data[12]
Definition: mat4.h:11
void mat4::MulVec ( const float *  vecIn,
float *  vecOut 
)
inline

Definition at line 77 of file mat4.h.

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

Referenced by SiPixelPhase1Analyzer::BookForwardBins().

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  }
float data[12]
Definition: mat4.h:11
mat4& mat4::operator& ( const mat4 mat)
inline

Definition at line 49 of file mat4.h.

References data, and mps_fire::i.

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

Definition at line 65 of file mat4.h.

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

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

Definition at line 57 of file mat4.h.

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

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

Definition at line 73 of file mat4.h.

References data, and mps_fire::i.

73 { return data[i]; }
float data[12]
Definition: mat4.h:11
float mat4::operator[] ( unsigned  i) const
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

Member Data Documentation

float mat4::data[12]