28 #ifndef PXR_BASE_GF_MATRIX3F_H
29 #define PXR_BASE_GF_MATRIX3F_H
96 float m10,
float m11,
float m12,
97 float m20,
float m21,
float m22) {
134 explicit GfMatrix3f(
const std::vector< std::vector<double> >&
v);
143 explicit GfMatrix3f(
const std::vector< std::vector<float> >&
v);
173 return GfVec3f(_mtx[i][0], _mtx[i][1], _mtx[i][2]);
178 return GfVec3f(_mtx[0][i], _mtx[1][i], _mtx[2][i]);
185 float m10,
float m11,
float m12,
186 float m20,
float m21,
float m22) {
187 _mtx[0][0] = m00; _mtx[0][1] = m01; _mtx[0][2] = m02;
188 _mtx[1][0] = m10; _mtx[1][1] = m11; _mtx[1][2] = m12;
189 _mtx[2][0] = m20; _mtx[2][1] = m21; _mtx[2][2] = m22;
196 _mtx[0][0] = m[0][0];
197 _mtx[0][1] = m[0][1];
198 _mtx[0][2] = m[0][2];
199 _mtx[1][0] = m[1][0];
200 _mtx[1][1] = m[1][1];
201 _mtx[1][2] = m[1][2];
202 _mtx[2][0] = m[2][0];
203 _mtx[2][1] = m[2][1];
204 _mtx[2][2] = m[2][2];
229 float*
Get(
float m[3][3])
const;
291 return !(*
this == m);
297 return !(*
this == m);
415 return GfVec3f(vec[0] * m._mtx[0][0] + vec[1] * m._mtx[0][1] + vec[2] * m._mtx[0][2],
416 vec[0] * m._mtx[1][0] + vec[1] * m._mtx[1][1] + vec[2] * m._mtx[1][2],
417 vec[0] * m._mtx[2][0] + vec[1] * m._mtx[2][1] + vec[2] * m._mtx[2][2]);
422 return GfVec3f(vec[0] * m._mtx[0][0] + vec[1] * m._mtx[1][0] + vec[2] * m._mtx[2][0],
423 vec[0] * m._mtx[0][1] + vec[1] * m._mtx[1][1] + vec[2] * m._mtx[2][1],
424 vec[0] * m._mtx[0][2] + vec[1] * m._mtx[1][2] + vec[2] * m._mtx[2][2]);
479 void _SetRotateFromQuat(
float r,
const GfVec3f& i);
503 #endif // PXR_BASE_GF_MATRIX3F_H
GF_API GfQuaternion ExtractRotationQuaternion() const
const float * data() const
GfMatrix3f(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
friend GfMatrix3f operator/(const GfMatrix3f &m1, const GfMatrix3f &m2)
Divides matrix m1 by m2 (that is, m1 * inv(m2)).
friend GfMatrix3f operator*(const GfMatrix3f &m1, double d)
Returns the product of a matrix and a float.
static const size_t numColumns
*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
float * operator[](int i)
GfVec3f GetRow(int i) const
Gets a row of the matrix as a Vec3.
bool IsLeftHanded() const
GA_API const UT_StringHolder rot
float * GetArray()
Returns vector components as an array of float values.
GF_API GfMatrix3f GetTranspose() const
Returns the transpose of the matrix.
GfMatrix3f()=default
Default constructor. Leaves the matrix component values undefined.
GF_API GfRotation ExtractRotation() const
GfMatrix3f(const GfVec3f &v)
void SetRow(int i, const GfVec3f &v)
Sets a row of the matrix from a Vec3.
T * GetData()
Return a pointer to the start of all the data.
const float * GetArray() const
Returns vector components as a const array of float values.
GF_API bool Orthonormalize(bool issueWarning=true)
GfVec3f GetColumn(int i) const
Gets a column of the matrix as a Vec3.
GF_API GfMatrix3f & SetDiagonal(float s)
Sets the matrix to s times the identity matrix.
GfMatrix3f & SetIdentity()
Sets the matrix to the identity matrix.
bool IsRightHanded() const
GF_API friend GfMatrix3f operator-(const GfMatrix3f &m)
Returns the unary negation of matrix m.
GF_API GfMatrix3f GetInverse(double *det=NULL, double eps=0) const
GF_API GfMatrix3f & SetRotate(const GfQuatf &rot)
Sets the matrix to specify a rotation equivalent to rot.
bool operator!=(const GfMatrix3d &m) const
GF_API double GetDeterminant() const
Returns the determinant of the matrix.
GF_API bool GfIsClose(GfMatrix3f const &m1, GfMatrix3f const &m2, double tolerance)
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GF_API GfMatrix3f & SetScale(float scaleFactor)
Sets matrix to specify a uniform scaling by scaleFactor.
GF_API bool operator==(const GfMatrix3d &m) const
GfMatrix3f & SetZero()
Sets the matrix to zero.
#define PXR_NAMESPACE_CLOSE_SCOPE
GfMatrix3f(const float m[3][3])
GF_API GfMatrix3f & operator+=(const GfMatrix3f &m)
Adds matrix m to this matrix.
void SetColumn(int i, const GfVec3f &v)
Sets a column of the matrix from a Vec3.
GfMatrix3f & Set(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
friend size_t hash_value(GfMatrix3f const &m)
Hash.
GF_API GfVec3f DecomposeRotation(const GfVec3f &axis0, const GfVec3f &axis1, const GfVec3f &axis2) const
GF_API GfMatrix3f & operator*=(const GfMatrix3f &m)
Post-multiplies matrix m into this matrix.
GF_API std::ostream & operator<<(std::ostream &, GfMatrix3f const &)
GF_API double GetHandedness() const
GF_API float * Get(float m[3][3]) const
static const size_t numRows
GfMatrix3f & Set(const float m[3][3])
GF_API GfMatrix3f GetOrthonormalized(bool issueWarning=true) const
Returns an orthonormalized copy of the matrix.
GF_API GfMatrix3f & operator-=(const GfMatrix3f &m)
Subtracts matrix m from this matrix.
friend GfMatrix3f operator+(const GfMatrix3f &m1, const GfMatrix3f &m2)
Adds matrix m2 to m1.