28 #ifndef PXR_BASE_GF_MATRIX3D_H
29 #define PXR_BASE_GF_MATRIX3D_H
41 #include <hboost/functional/hash.hpp>
97 double m10,
double m11,
double m12,
98 double m20,
double m21,
double m22) {
135 explicit GfMatrix3d(
const std::vector< std::vector<double> >&
v);
144 explicit GfMatrix3d(
const std::vector< std::vector<float> >&
v);
174 return GfVec3d(_mtx[i][0], _mtx[i][1], _mtx[i][2]);
179 return GfVec3d(_mtx[0][i], _mtx[1][i], _mtx[2][i]);
186 double m10,
double m11,
double m12,
187 double m20,
double m21,
double m22) {
188 _mtx[0][0] = m00; _mtx[0][1] = m01; _mtx[0][2] = m02;
189 _mtx[1][0] = m10; _mtx[1][1] = m11; _mtx[1][2] = m12;
190 _mtx[2][0] = m20; _mtx[2][1] = m21; _mtx[2][2] = m22;
197 _mtx[0][0] = m[0][0];
198 _mtx[0][1] = m[0][1];
199 _mtx[0][2] = m[0][2];
200 _mtx[1][0] = m[1][0];
201 _mtx[1][1] = m[1][1];
202 _mtx[1][2] = m[1][2];
203 _mtx[2][0] = m[2][0];
204 _mtx[2][1] = m[2][1];
205 _mtx[2][2] = m[2][2];
230 double*
Get(
double m[3][3])
const;
270 hboost::hash_combine(h, *p++);
287 return !(*
this ==
m);
293 return !(*
this ==
m);
411 return GfVec3d(vec[0] * m._mtx[0][0] + vec[1] * m._mtx[0][1] + vec[2] * m._mtx[0][2],
412 vec[0] * m._mtx[1][0] + vec[1] * m._mtx[1][1] + vec[2] * m._mtx[1][2],
413 vec[0] * m._mtx[2][0] + vec[1] * m._mtx[2][1] + vec[2] * m._mtx[2][2]);
418 return GfVec3d(vec[0] * m._mtx[0][0] + vec[1] * m._mtx[1][0] + vec[2] * m._mtx[2][0],
419 vec[0] * m._mtx[0][1] + vec[1] * m._mtx[1][1] + vec[2] * m._mtx[2][1],
420 vec[0] * m._mtx[0][2] + vec[1] * m._mtx[1][2] + vec[2] * m._mtx[2][2]);
485 void _SetRotateFromQuat(
double r,
const GfVec3d& i);
509 #endif // PXR_BASE_GF_MATRIX3D_H
GF_API bool Orthonormalize(bool issueWarning=true)
bool IsLeftHanded() const
GfMatrix3d(const GfVec3d &v)
GF_API GfMatrix3d & operator-=(const GfMatrix3d &m)
Subtracts matrix m from this matrix.
GF_API GfMatrix3d & operator+=(const GfMatrix3d &m)
Adds matrix m to this matrix.
GF_API GfMatrix3d GetOrthonormalized(bool issueWarning=true) const
Returns an orthonormalized copy of the matrix.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
bool operator!=(const GfMatrix3d &m) const
GF_API double GetHandedness() const
double * GetArray()
Returns vector components as an array of double values.
GA_API const UT_StringHolder rot
GfMatrix3d()=default
Default constructor. Leaves the matrix component values undefined.
GF_API GfMatrix3d & SetDiagonal(double s)
Sets the matrix to s times the identity matrix.
GF_API GfMatrix3d & SetRotate(const GfQuatd &rot)
Sets the matrix to specify a rotation equivalent to rot.
GfVec3d GetRow(int i) const
Gets a row of the matrix as a Vec3.
static const size_t numColumns
bool IsRightHanded() const
GF_API GfRotation ExtractRotation() const
friend GfMatrix3d operator*(const GfMatrix3d &m1, double d)
Returns the product of a matrix and a double.
GfMatrix3d(const double m[3][3])
T * GetData()
Return a pointer to the start of all the data.
GF_API GfVec3d DecomposeRotation(const GfVec3d &axis0, const GfVec3d &axis1, const GfVec3d &axis2) const
const double * data() const
GfMatrix3d & SetZero()
Sets the matrix to zero.
GF_API GfQuaternion ExtractRotationQuaternion() const
GF_API double GetDeterminant() const
Returns the determinant of the matrix.
GF_API GfMatrix3d & operator*=(const GfMatrix3d &m)
Post-multiplies matrix m into this matrix.
friend GfMatrix3d operator+(const GfMatrix3d &m1, const GfMatrix3d &m2)
Adds matrix m2 to m1.
GF_API friend GfMatrix3d operator-(const GfMatrix3d &m)
Returns the unary negation of matrix m.
GF_API GfMatrix3d GetInverse(double *det=NULL, double eps=0) const
double * operator[](int i)
GLfloat GLfloat GLfloat GLfloat h
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
void SetColumn(int i, const GfVec3d &v)
Sets a column of the matrix from a Vec3.
GF_API double * Get(double m[3][3]) const
GfVec3d GetColumn(int i) const
Gets a column of the matrix as a Vec3.
GfMatrix3d & Set(const double m[3][3])
GfMatrix3d(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
#define PXR_NAMESPACE_CLOSE_SCOPE
GLsizei const GLfloat * value
GfMatrix3d & Set(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
GF_API bool GfIsClose(GfMatrix3d const &m1, GfMatrix3d const &m2, double tolerance)
GF_API bool operator==(const GfMatrix3d &m) const
const double * GetArray() const
Returns vector components as a const array of double values.
GF_API GfMatrix3d GetTranspose() const
Returns the transpose of the matrix.
GF_API std::ostream & operator<<(std::ostream &, GfMatrix3d const &)
GF_API GfMatrix3d & SetScale(double scaleFactor)
Sets matrix to specify a uniform scaling by scaleFactor.
static const size_t numRows
friend GfMatrix3d operator/(const GfMatrix3d &m1, const GfMatrix3d &m2)
Divides matrix m1 by m2 (that is, m1 * inv(m2)).
GfMatrix3d & SetIdentity()
Sets the matrix to the identity matrix.
friend size_t hash_value(GfMatrix3d const &m)
Hash.
void SetRow(int i, const GfVec3d &v)
Sets a row of the matrix from a Vec3.