OpenVSP API Documentation 3.52.0
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 <cmath>
11
12#include <cstring>
13#include "Vec3d.h"
14
15
22class Matrix4d
23{
24public:
25 Matrix4d();
26
48
50
56 void print( const std::string &header = "" );
57
64 static void setIdentity( double *m );
65
95
96 void translatef( const double &x, const double &y, const double &z );
97
121
122 void translatev( const vec3d &v );
123
151
152 void rotateX( const double &ang );
153
181
182 void rotateY( const double &ang );
183
211
212 void rotateZ( const double &ang );
213
244
245 void rotate( const double &angle, const vec3d &axis );
246
247
268
269 void rotatealongX( const vec3d &dir1 );
270
293
295
334
336
364
365 void scale( const double &scale );
366
390
391 void scalex( const double &scalex );
392
416
417 void scaley( const double &scaley );
418
442
443 void scalez( const double &scalez );
444
467
468 void flipx();
469
473 void getMat( double *m ) const;
474
478 void matMult( const double *m );
479
483 void postMult( const double *m );
484
511
512 void matMult( const Matrix4d &m );
513
540
541 void postMult( const Matrix4d &m );
542
543
547 void initMat( const double *m );
548
572
573 void initMat( const Matrix4d &m );
574
578 void mult( const double in[ 4 ], double out[ 4 ] ) const;
579
585 double *data()
586 {
587 return mat;
588 }
589
590 const double *const_data() const
591 {
592 return mat;
593 }
594
621
622 void loadXZRef();
623
650
651 void loadXYRef();
652
679
680 void loadYZRef();
681
682
709
710 void mirrory();
711
747
748 vec3d xform( const vec3d &in ) const;
749
775
776 void xformvec( std::vector < vec3d > &in ) const;
777
803
804 void xformmat( std::vector < std::vector < vec3d > > &in ) const;
805
830
831 vec3d xformnorm( const vec3d &in ) const;
832
856
857 void xformnormvec( std::vector < vec3d > &in ) const;
858
882
883 void xformnormmat( std::vector < std::vector < vec3d > > &in ) const;
884
916
918
938
940
964
966
1008
1009 void buildXForm( const vec3d &pos, const vec3d &rot, const vec3d &cent_rot );
1010
1011
1039
1040 void getBasis( vec3d &xdir, vec3d &ydir, vec3d &zdir ) const;
1041
1065
1066 void setBasis( const vec3d &xdir, const vec3d &ydir, const vec3d &zdir );
1067
1098
1099 void getRotationAxis( vec3d &axis_dir, vec3d &axis_pnt, double &angle_out ) const;
1100
1130
1131 void toQuat( double &qw_out, double &qx_out, double &qy_out, double &qz_out, double &tx_out, double &ty_out, double &tz_out ) const;
1132
1133private:
1134 double mat[ 16 ];
1135};
1136
1137#endif
void getRotationAxis(vec3d &axis_dir, vec3d &axis_pnt, double &angle_out) const
void xformvec(std::vector< vec3d > &in) const
void loadXZRef()
void rotatealongX(const vec3d &dir1)
void scalex(const double &scalex)
vec3d getArcballAngles() const
void rotate(const double &angle, const vec3d &axis)
void xformnormmat(std::vector< std::vector< vec3d > > &in) const
void scaley(const double &scaley)
vec3d getAngles() const
void mirrory()
void scalez(const double &scalez)
vec3d xformnorm(const vec3d &in) const
void zeroTranslations()
void initMat(const Matrix4d &m)
vec3d getTranslation() const
void matMult(const Matrix4d &m)
void loadXYRef()
void rotateX(const double &ang)
void rotateY(const double &ang)
void postMult(const Matrix4d &m)
vec3d xform(const vec3d &in) const
void flipx()
void toQuat(double &qw_out, double &qx_out, double &qy_out, double &qz_out, double &tx_out, double &ty_out, double &tz_out) const
void xformnormvec(std::vector< vec3d > &in) const
void getBasis(vec3d &xdir, vec3d &ydir, vec3d &zdir) const
void buildXForm(const vec3d &pos, const vec3d &rot, const vec3d &cent_rot)
void translatev(const vec3d &v)
void loadYZRef()
void scale(const double &scale)
void loadIdentity()
void xformmat(std::vector< std::vector< vec3d > > &in) const
void setBasis(const vec3d &xdir, const vec3d &ydir, const vec3d &zdir)
void affineInverse()
void rotateZ(const double &ang)
void translatef(const double &x, const double &y, const double &z)
Definition Vec3d.h:238
double angle(const vec3d &a, const vec3d &b)