OpenVSP API Documentation 3.41.2
 
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
20{
21public:
22
23 Matrix4d();
24
48
49 static void setIdentity( double* m );
79 void translatef( const double &x, const double &y, const double &z );
80
81 void translatev( const vec3d &v );
108 void rotateX( const double &ang );
109
136 void rotateY( const double &ang );
137
164 void rotateZ( const double &ang );
165
195 void rotate( const double &angle, const vec3d & axis );
196
197
198 void rotatealongX( const vec3d & dir1 );
199
200 void zeroTranslations();
239
266 void scale( const double &scale );
267
268 void scalex( const double &scalex );
269 void scaley( const double &scaley );
270 void scalez( const double &scalez );
271
272 void flipx();
273
274 void getMat( double* m ) const;
275 void matMult( const double* m );
276 void postMult( const double* m );
277 void matMult( const Matrix4d &m );
278 void postMult( const Matrix4d & m );
279
280
281 void initMat( const double* m );
282 void initMat( const Matrix4d & m );
283 void mult( const double in[4], double out[4] ) const;
284 double * data()
285 {
286 return mat;
287 }
288
314 void loadXZRef();
315
341 void loadXYRef();
342
368 void loadYZRef();
369
370
397 vec3d xform( const vec3d & in ) const;
398
399 void xformvec( std::vector < vec3d > & in ) const;
400 void xformmat( std::vector < std::vector < vec3d > > & in ) const;
401 vec3d xformnorm( const vec3d & in ) const;
402 void xformnormvec( std::vector < vec3d > & in ) const;
403 void xformnormmat( std::vector < std::vector < vec3d > > & in ) const;
404
436
437 vec3d getTranslation() const;
438
446 void buildXForm( const vec3d & pos, const vec3d & rot, const vec3d & cent_rot );
447
448
449 void getBasis( vec3d &xdir, vec3d &ydir, vec3d &zdir );
450 void setBasis( const vec3d &xdir, const vec3d &ydir, const vec3d &zdir );
451
452 void toQuat( double &qw, double &qx, double &qy, double &qz, double &tx, double &ty, double &tz ) const;
453
454private:
455
456 double mat[16];
457};
458
459#endif
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)
Definition Vec3d.h:235
double angle(const vec3d &a, const vec3d &b)