OpenVSP API Documentation 3.42.3
 
Loading...
Searching...
No Matches
Matrix4d.h
1//
2// This file is released under the terms of the NASA Open Source Agreement (NOSA)
3// version 1.3 as detailed in the LICENSE file which accompanies this software.
4//
5
6
7#ifndef __MATRIX_H_
8#define __MATRIX_H_
9
10#include "Defines.h"
11#include <cmath>
12#include <cstring>
13#include "Vec3d.h"
14
15
22class Matrix4d
23{
24public:
25 Matrix4d();
26
51
53
54 static void setIdentity( double *m );
55
87
88 void translatef( const double &x, const double &y, const double &z );
89
90 void translatev( const vec3d &v );
91
120
121 void rotateX( const double &ang );
122
151
152 void rotateY( const double &ang );
153
182
183 void rotateZ( const double &ang );
184
216
217 void rotate( const double &angle, const vec3d &axis );
218
219
220 void rotatealongX( const vec3d &dir1 );
221
222 void zeroTranslations();
223
263
265
294
295 void scale( const double &scale );
296
297 void scalex( const double &scalex );
298
299 void scaley( const double &scaley );
300
301 void scalez( const double &scalez );
302
303 void flipx();
304
305 void getMat( double *m ) const;
306
307 void matMult( const double *m );
308
309 void postMult( const double *m );
310
311 void matMult( const Matrix4d &m );
312
313 void postMult( const Matrix4d &m );
314
315
316 void initMat( const double *m );
317
318 void initMat( const Matrix4d &m );
319
320 void mult( const double in[ 4 ], double out[ 4 ] ) const;
321
322 double *data()
323 {
324 return mat;
325 }
326
354
355 void loadXZRef();
356
384
385 void loadXYRef();
386
414
415 void loadYZRef();
416
417
446
447 vec3d xform( const vec3d &in ) const;
448
449 void xformvec( std::vector < vec3d > &in ) const;
450
451 void xformmat( std::vector < std::vector < vec3d > > &in ) const;
452
453 vec3d xformnorm( const vec3d &in ) const;
454
455 void xformnormvec( std::vector < vec3d > &in ) const;
456
457 void xformnormmat( std::vector < std::vector < vec3d > > &in ) const;
458
491
493
494 vec3d getTranslation() const;
495
505
506 void buildXForm( const vec3d &pos, const vec3d &rot, const vec3d &cent_rot );
507
508
509 void getBasis( vec3d &xdir, vec3d &ydir, vec3d &zdir );
510
511 void setBasis( const vec3d &xdir, const vec3d &ydir, const vec3d &zdir );
512
513 void toQuat( double &qw, double &qx, double &qy, double &qz, double &tx, double &ty, double &tz ) const;
514
515private:
516 double mat[ 16 ];
517};
518
519#endif
Definition Vec3d.h:235
void loadXZRef()
void rotate(const double &angle, const vec3d &axis)
vec3d getAngles() const
void loadXYRef()
void rotateX(const double &ang)
void rotateY(const double &ang)
vec3d xform(const vec3d &in) const
void buildXForm(const vec3d &pos, const vec3d &rot, const vec3d &cent_rot)
void loadYZRef()
void scale(const double &scale)
void loadIdentity()
void affineInverse()
void rotateZ(const double &ang)
void translatef(const double &x, const double &y, const double &z)
double angle(const vec3d &a, const vec3d &b)