13using namespace Triton;
17#ifndef TRITON_MATRIX3_H
18#define TRITON_MATRIX3_H
39 Matrix3(
double e11,
double e12,
double e13,
40 double e21,
double e22,
double e23,
41 double e31,
double e32,
double e33) {
53 for (
int row = 0; row < 3; row++) {
54 for (
int col = 0; col < 3; col++) {
55 elem[row][col] = m[i++];
67 for (
int row = 0; row < 3; row++) {
68 for (
int col = 0; col < 3; col++) {
69 val[i++] = (float)
elem[row][col];
88 void TRITONAPI
FromXYZ(
double Rx,
double Ry,
double Rz);
Implements a 3x3 matrix and its operations.
Memory allocation interface for SilverLining.
A 3D Vector class and its operations.
A simple 3x3 matrix class and its operations.
Definition: Matrix3.h:30
void TRITONAPI ToFloatArray(float val[9]) const
Returns a static 3x3 float array in row major order.
Definition: Matrix3.h:65
Matrix3(double *m)
Constructor that takes an array of 9 doubles in row-major order.
Definition: Matrix3.h:51
void TRITONAPI FromXYZ(double Rx, double Ry, double Rz)
Populates the matrix as a series of rotations about the X, Y, and Z axes (in that order) by specified...
void TRITONAPI FromRz(double rad)
Populates the matrix to model a rotation about the Z axis by a give amount, in radians.
Matrix3()
Default contructor; performs no initialization for efficiency.
Definition: Matrix3.h:35
void TRITONAPI FromRy(double rad)
Populates the matrix to model a rotation about the Y axis by a given amount, in radians.
Matrix3 TRITONAPI Transpose() const
Caculate the inverse of the matrix.
void TRITONAPI FromRx(double rad)
Populates the matrix to model a rotation about the X axis by a given amount, in radians.
double elem[3][3]
The data members are public for convenience.
Definition: Matrix3.h:103
~Matrix3()
Destructor.
Definition: Matrix3.h:61
friend Vector3 TRITONAPI operator*(const Vector3 &vec, const Matrix3 &mat)
Multiplies a 1x3 vector by a matrix, yielding a 1x3 vector.
Matrix3(double e11, double e12, double e13, double e21, double e22, double e23, double e31, double e32, double e33)
Constructor that instantiates the 3x3 matrix with initial values.
Definition: Matrix3.h:39
This base class for all Triton objects intercepts the new and delete operators, routing them through ...
Definition: MemAlloc.h:71
A 3D double-precision Vector class and its operations.
Definition: Vector3.h:36