50 Matrix4D (
float a11,
float a12,
float a13,
float a14,
51 float a21,
float a22,
float a23,
float a24,
52 float a31,
float a32,
float a33,
float a34,
53 float a41,
float a42,
float a43,
float a44 );
55 Matrix4D (
double a11,
double a12,
double a13,
double a14,
56 double a21,
double a22,
double a23,
double a24,
57 double a31,
double a32,
double a33,
double a34,
58 double a41,
double a42,
double a43,
double a44 );
87 inline bool operator != (
const Matrix4D& rclMtrx)
const;
89 inline bool operator == (
const Matrix4D& rclMtrx)
const;
91 inline double* operator [] (
unsigned short usNdx);
93 inline const double* operator[] (
unsigned short usNdx)
const;
95 double determinant()
const;
97 std::string analyse(
void)
const;
106 void getMatrix (
double dMtrx[16])
const;
107 void setMatrix (
const double dMtrx[16]);
109 void getGLMatrix (
double dMtrx[16])
const;
111 void setGLMatrix (
const double dMtrx[16]);
113 unsigned long getMemSpace (
void);
117 void setToUnity(
void);
122 void move (
float x,
float y,
float z)
124 void move (
double x,
double y,
double z)
130 void scale (
float x,
float y,
float z)
132 void scale (
double x,
double y,
double z)
135 void scale (
const Vector3f& rclVct);
136 void scale (
const Vector3d& rclVct);
138 int hasScale(
double tol=0.0)
const;
140 void rotX (
double fAngle);
142 void rotY (
double fAngle);
144 void rotZ (
double fAngle);
146 void rotLine (
const Vector3f& rclVct,
float fAngle);
148 void rotLine (
const Vector3d& rclVct,
double fAngle);
150 void rotLine (
const Vector3f& rclBase,
const Vector3f& rclDir,
float fAngle);
152 void rotLine (
const Vector3d& rclBase,
const Vector3d& rclDir,
double fAngle);
154 bool toAxisAngle (
Vector3f& rclBase,
Vector3f& rclDir,
float& fAngle,
float& fTranslation)
const;
155 bool toAxisAngle (
Vector3d& rclBase,
Vector3d& rclDir,
double& fAngle,
double& fTranslation)
const;
162 void inverseOrthogonal(
void);
164 void inverseGauss (
void);
165 void transpose (
void);
168 void Print (
void)
const;
170 std::string toString(
void)
const;
172 void fromString (
const std::string &str);
175 double dMtrx4D[4][4];
181 unsigned short iz, is;
183 for (iz = 0; iz < 4; iz++) {
184 for (is = 0; is < 4; is++) {
185 clMat.dMtrx4D[iz][is] = dMtrx4D[iz][is] + rclMtrx[iz][is];
194 unsigned short iz, is;
196 for (iz = 0; iz < 4; iz++) {
197 for (is = 0; is < 4; is++) {
198 dMtrx4D[iz][is] += rclMtrx[iz][is];
208 unsigned short iz, is;
210 for (iz = 0; iz < 4; iz++) {
211 for (is = 0; is < 4; is++) {
212 clMat.dMtrx4D[iz][is] = dMtrx4D[iz][is] - rclMtrx[iz][is];
221 unsigned short iz, is;
223 for (iz = 0; iz < 4; iz++) {
224 for (is = 0; is < 4; is++) {
225 dMtrx4D[iz][is] -= rclMtrx[iz][is];
235 unsigned short ie, iz, is;
237 for (iz = 0; iz < 4; iz++)
238 for (is = 0; is < 4; is++) {
239 clMat.dMtrx4D[iz][is] = 0;
240 for (ie = 0; ie < 4; ie++)
241 clMat.dMtrx4D[iz][is] += dMtrx4D[iz][ie] *
242 rclMtrx.dMtrx4D[ie][is];
253 unsigned short ie, iz, is;
255 for (iz = 0; iz < 4; iz++)
256 for (is = 0; is < 4; is++) {
257 clMat.dMtrx4D[iz][is] = 0;
258 for (ie = 0; ie < 4; ie++)
259 clMat.dMtrx4D[iz][is] += dMtrx4D[iz][ie] *
260 rclMtrx.dMtrx4D[ie][is];
268 unsigned short iz, is;
270 for (iz = 0; iz < 4; iz++) {
271 for (is = 0; is < 4; is++) {
272 dMtrx4D[iz][is] = rclMtrx.dMtrx4D[iz][is];
281 double x = static_cast<double>(rclVct.
x);
282 double y = static_cast<double>(rclVct.
y);
283 double z = static_cast<double>(rclVct.
z);
285 static_cast<float>(dMtrx4D[0][0]*x + dMtrx4D[0][1]*y +
286 dMtrx4D[0][2]*z + dMtrx4D[0][3]),
287 static_cast<float>(dMtrx4D[1][0]*x + dMtrx4D[1][1]*y +
288 dMtrx4D[1][2]*z + dMtrx4D[1][3]),
289 static_cast<float>(dMtrx4D[2][0]*x + dMtrx4D[2][1]*y +
290 dMtrx4D[2][2]*z + dMtrx4D[2][3])
296 return Vector3d((dMtrx4D[0][0]*rclVct.
x + dMtrx4D[0][1]*rclVct.
y +
297 dMtrx4D[0][2]*rclVct.
z + dMtrx4D[0][3]),
298 (dMtrx4D[1][0]*rclVct.
x + dMtrx4D[1][1]*rclVct.
y +
299 dMtrx4D[1][2]*rclVct.
z + dMtrx4D[1][3]),
300 (dMtrx4D[2][0]*rclVct.
x + dMtrx4D[2][1]*rclVct.
y +
301 dMtrx4D[2][2]*rclVct.
z + dMtrx4D[2][3]));
306 double x = (dMtrx4D[0][0]*src.
x + dMtrx4D[0][1]*src.
y +
307 dMtrx4D[0][2]*src.
z + dMtrx4D[0][3]);
308 double y = (dMtrx4D[1][0]*src.
x + dMtrx4D[1][1]*src.
y +
309 dMtrx4D[1][2]*src.
z + dMtrx4D[1][3]);
310 double z = (dMtrx4D[2][0]*src.
x + dMtrx4D[2][1]*src.
y +
311 dMtrx4D[2][2]*src.
z + dMtrx4D[2][3]);
317 double sx = static_cast<double>(src.
x);
318 double sy = static_cast<double>(src.
y);
319 double sz = static_cast<double>(src.
z);
321 double x = (dMtrx4D[0][0]*sx + dMtrx4D[0][1]*sy +
322 dMtrx4D[0][2]*sz + dMtrx4D[0][3]);
323 double y = (dMtrx4D[1][0]*sx + dMtrx4D[1][1]*sy +
324 dMtrx4D[1][2]*sz + dMtrx4D[1][3]);
325 double z = (dMtrx4D[2][0]*sx + dMtrx4D[2][1]*sy +
326 dMtrx4D[2][2]*sz + dMtrx4D[2][3]);
327 dst.
Set(static_cast<float>(x),
328 static_cast<float>(y),
329 static_cast<float>(z));
334 unsigned short iz, is;
336 for (iz = 0; iz < 4; iz++) {
337 for (is = 0; is < 4; is++) {
348 return !( (*this) == rclMtrx );
354 rclVect = rclMtrx * rclVect;
360 return dMtrx4D[usNdx];
365 return dMtrx4D[usNdx];
371 #endif // BASE_MATRIX_H _Precision z
Definition: Vector3D.h:89
Matrix4D & operator+=(const Matrix4D &rclMtrx)
Definition: Matrix.h:192
_Precision y
Definition: Vector3D.h:88
bool operator==(const Matrix4D &rclMtrx) const
Comparison.
Definition: Matrix.h:332
Matrix4D operator *(const Matrix4D &rclMtrx) const
Matrix multiplication.
Definition: Matrix.h:250
const double * operator[](unsigned short usNdx) const
Index operator.
Definition: Matrix.h:358
Vector3f & operator *=(Vector3f &rclVect, const Matrix4D &rclMtrx)
Definition: Matrix.h:351
Definition: Vector3D.h:69
Matrix4D operator+(const Matrix4D &rclMtrx) const
Matrix addition.
Definition: Matrix.h:178
Matrix4D operator -(const Matrix4D &rclMtrx) const
Matrix subtraction.
Definition: Matrix.h:205
constexpr bool operator!=(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) ENTT_NOEXCEPT
Compares two hashed strings.
Definition: entt.hpp:570
Matrix4D & operator *=(const Matrix4D &rclMtrx)
Matrix multiplication.
Definition: Matrix.h:232
Vector3< double > Vector3d
Definition: Vector3D.h:248
_Precision x
Definition: Vector3D.h:87
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:29
Vector3< float > Vector3f
Definition: Vector3D.h:247
DualNumber operator+(DualNumber a, DualNumber b)
Definition: DualNumber.h:51
Matrix4D & operator=(const Matrix4D &rclMtrx)
Assignment.
Definition: Matrix.h:266
void scale(float x, float y, float z)
scale for the vector
Definition: Matrix.h:130
void move(float x, float y, float z)
moves the coordinatesystem for the x,y,z value
Definition: Matrix.h:122
Matrix4D & operator -=(const Matrix4D &rclMtrx)
Definition: Matrix.h:219
Definition: AbstractXMLReader.h:5
void move(double x, double y, double z)
Definition: Matrix.h:124
Definition: Vector3D.h:78
void scale(double x, double y, double z)
Definition: Matrix.h:132
void Set(_Precision fX, _Precision fY, _Precision fZ)
static float_type epsilon()
Definition: Vector3D.h:72
~Matrix4D()
Destruction.
Definition: Matrix.h:65
DualNumber operator *(DualNumber a, DualNumber b)
Definition: DualNumber.h:71
void multVec(const Vector3d &src, Vector3d &dst) const
Definition: Matrix.h:304