65 :
mMatrix(a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33)
82 int MatrixImpl::Compare(
const MatrixImpl& m)
const 88 bool MatrixImpl::Valid()
const 94 bool MatrixImpl::IsNaN()
const 106 void MatrixImpl::Set(
float const *
const ptr)
112 void MatrixImpl::Set(
double const *
const ptr)
123 mMatrix.set(a00, a01, a02, a03, a10, a11, a12, a13,
124 a20, a21, a22, a23, a30, a31, a32, a33);
128 MatrixImpl::value_type* MatrixImpl::Ptr()
134 const MatrixImpl::value_type* MatrixImpl::Ptr()
const 140 void MatrixImpl::MakeIdentity()
146 void MatrixImpl::MakeScale(
const Vec3f& v)
152 void MatrixImpl::MakeScale(
const Vec3d& v)
164 void MatrixImpl::MakeTranslate(
const Vec3f& v)
170 void MatrixImpl::MakeTranslate(
const Vec3d& v)
178 mMatrix.makeTranslate(x, y, z);
182 void MatrixImpl::MakeRotate(
const Vec3f& from,
const Vec3f& to)
188 void MatrixImpl::MakeRotate(
const Vec3d& from,
const Vec3d& to)
194 void MatrixImpl::MakeRotate(
value_type angle,
const Vec3f& axis)
196 mMatrix.makeRotate(angle, axis);
200 void MatrixImpl::MakeRotate(
value_type angle,
const Vec3d& axis)
202 mMatrix.makeRotate(angle, axis);
208 mMatrix.makeRotate(angle, x, y, z);
212 void MatrixImpl::MakeRotate(
const Quat& q)
220 mMatrix.makeRotate(angle1, axis1, angle2, axis2, angle3, axis3);
226 mMatrix.makeRotate(angle1, axis1, angle2, axis2, angle3, axis3);
230 void MatrixImpl::Decompose(Vec3f& translation, Quat& rotation, Vec3f& scale, Quat& so)
const 232 mMatrix.decompose(translation, rotation, scale, so);
236 void MatrixImpl::Decompose(Vec3d& translation, Quat& rotation, Vec3d& scale, Quat& so)
const 238 mMatrix.decompose(translation, rotation, scale, so);
244 mMatrix.makeOrtho(left, right, bottom, top, zNear, zFar);
250 return mMatrix.getOrtho(left, right, bottom, top, zNear, zFar);
256 mMatrix.makeOrtho(left, right, bottom, top, -1.0, 1.0);
262 mMatrix.makeFrustum(left, right, bottom, top, zNear, zFar);
268 return mMatrix.getFrustum(left, right, bottom, top, zNear, zFar);
274 mMatrix.makePerspective(fovy, aspectRatio, zNear, zFar);
280 return mMatrix.getPerspective(fovy, aspectRatio, zNear, zFar);
284 void MatrixImpl::MakeLookAt(
const Vec3f& eye,
const Vec3f& center,
const Vec3f& up)
286 mMatrix.makeLookAt(eye.GetOSGVector(), center.GetOSGVector(), up.GetOSGVector());
290 void MatrixImpl::MakeLookAt(
const Vec3d& eye,
const Vec3d& center,
const Vec3d& up)
292 mMatrix.makeLookAt(eye, center, up);
296 void MatrixImpl::GetLookAt(Vec3f& eye, Vec3f& center, Vec3f& up,
value_type lookDistance)
const 298 mMatrix.getLookAt(eye, center, up, lookDistance);
302 void MatrixImpl::GetLookAt(Vec3d& eye, Vec3d& center, Vec3d& up,
value_type lookDistance)
const 304 mMatrix.getLookAt(eye, center, up, lookDistance);
308 bool MatrixImpl::Invert(
const MatrixImpl& rhs)
314 bool MatrixImpl::Invert_4x3(
const MatrixImpl& rhs)
316 return mMatrix.invert_4x3(rhs);
320 bool MatrixImpl::Invert_4x4(
const MatrixImpl& rhs)
322 return mMatrix.invert_4x4(rhs);
326 void MatrixImpl::OrthoNormalize(
const MatrixImpl& rhs)
332 void MatrixImpl::SetRotate(
const Quat& q)
338 Quat MatrixImpl::GetRotate()
const 350 void MatrixImpl::SetTrans(
const Vec3f& v)
356 void MatrixImpl::SetTrans(
const Vec3d& v)
362 Vec3d MatrixImpl::GetTrans()
const 368 Vec3d MatrixImpl::GetScale()
const 382 void MatrixImpl::SetScale(
const Vec3f& v)
388 void MatrixImpl::SetScale(
const Vec3d& v)
394 Vec3f MatrixImpl::PreMult(
const Vec3f& v)
const 400 Vec3d MatrixImpl::PreMult(
const Vec3d& v)
const 406 Vec3f MatrixImpl::PostMult(
const Vec3f& v)
const 412 Vec3d MatrixImpl::PostMult(
const Vec3d& v)
const 418 Vec4f MatrixImpl::PreMult(
const Vec4f& v)
const 424 Vec4d MatrixImpl::PreMult(
const Vec4d& v)
const 430 Vec4f MatrixImpl::PostMult(
const Vec4f& v)
const 436 Vec4d MatrixImpl::PostMult(
const Vec4d& v)
const 454 void MatrixImpl::PostMult(
const MatrixImpl& m)
460 void MatrixImpl::PreMultTranslate(
const Vec3d& v)
466 void MatrixImpl::PreMultTranslate(
const Vec3f& v)
472 void MatrixImpl::PostMultTranslate(
const Vec3d& v)
478 void MatrixImpl::PostMultTranslate(
const Vec3f& v)
484 void MatrixImpl::PreMultScale(
const Vec3d& v)
490 void MatrixImpl::PreMultScale(
const Vec3f& v)
496 void MatrixImpl::PostMultScale(
const Vec3d& v)
502 void MatrixImpl::PostMultScale(
const Vec3f& v)
508 void MatrixImpl::PreMultRotate(
const Quat& q)
514 void MatrixImpl::PostMultRotate(
const Quat& q)
522 return std::string(
"[" + trUtil::StringUtils::ToString<value_type>(
mMatrix(0, 0), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(0, 1), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(0, 2), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(0, 3), precision) +
523 "] [" + trUtil::StringUtils::ToString<value_type>(
mMatrix(1, 0), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(1, 1), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(1, 2), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(1, 3), precision) +
524 "] [" + trUtil::StringUtils::ToString<value_type>(
mMatrix(2, 0), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(2, 1), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(2, 2), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(2, 3), precision) +
525 "] [" + trUtil::StringUtils::ToString<value_type>(
mMatrix(3, 0), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(3, 1), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(3, 2), precision) +
", " + trUtil::StringUtils::ToString<value_type>(
mMatrix(3, 3), precision) +
557 m.MakeScale(sx, sy, sz);
562 MatrixImpl MatrixImpl::Translate(
const Vec3f& dv)
570 MatrixImpl MatrixImpl::Translate(
const Vec3d& dv)
581 m.MakeTranslate(x, y, z);
586 MatrixImpl MatrixImpl::Rotate(
const Vec3f& from,
const Vec3f& to)
589 m.MakeRotate(from, to);
594 MatrixImpl MatrixImpl::Rotate(
const Vec3d& from,
const Vec3d& to)
597 m.MakeRotate(from, to);
605 m.MakeRotate(angle, x, y, z);
613 m.MakeRotate(angle, axis);
621 m.MakeRotate(angle, axis);
629 m.MakeRotate(angle1, axis1, angle2, axis2, angle3, axis3);
637 m.MakeRotate(angle1, axis1, angle2, axis2, angle3, axis3);
642 MatrixImpl MatrixImpl::Rotate(
const Quat& quat)
661 m.OrthoNormalize(matrix);
669 m.MakeOrtho(left, right, bottom, top, zNear, zFar);
677 m.MakeOrtho2D(left, right, bottom, top);
685 m.MakeFrustum(left, right, bottom, top, zNear, zFar);
693 m.MakePerspective(fovy, aspectRatio, zNear, zFar);
698 MatrixImpl MatrixImpl::LookAt(
const Vec3f& eye,
const Vec3f& center,
const Vec3f& up)
701 m.MakeLookAt(eye, center, up);
706 MatrixImpl MatrixImpl::LookAt(
const Vec3d& eye,
const Vec3d& center,
const Vec3d& up)
709 m.MakeLookAt(eye, center, up);
714 Vec3f MatrixImpl::Transform3x3(
const Vec3f& v,
const MatrixImpl& m)
716 return osg::MatrixImpl::transform3x3(v, m);
720 Vec3d MatrixImpl::Transform3x3(
const Vec3d& v,
const MatrixImpl& m)
722 return osg::MatrixImpl::transform3x3(v, m);
726 Vec3f MatrixImpl::Transform3x3(
const MatrixImpl& m,
const Vec3f& v)
728 return osg::MatrixImpl::transform3x3(m, v);
732 Vec3d MatrixImpl::Transform3x3(
const MatrixImpl& m,
const Vec3d& v)
734 return osg::MatrixImpl::transform3x3(m, v);
740 if (&rhs ==
this)
return *
this;
746 bool MatrixImpl::operator > (
const MatrixImpl& m)
const 752 bool MatrixImpl::operator < (
const MatrixImpl& m)
const 770 Vec3f MatrixImpl::operator* (
const Vec3f& v)
const 776 Vec3d MatrixImpl::operator* (
const Vec3d& v)
const 782 Vec4f MatrixImpl::operator* (
const Vec4f& v)
const 788 Vec4d MatrixImpl::operator* (
const Vec4d& v)
const 794 void MatrixImpl::operator *= (
const MatrixImpl& other)
816 MatrixImpl MatrixImpl::operator * (MatrixImpl::value_type rhs)
const 838 MatrixImpl& MatrixImpl::operator *= (MatrixImpl::value_type rhs)
860 MatrixImpl MatrixImpl::operator / (MatrixImpl::value_type rhs)
const 882 MatrixImpl& MatrixImpl::operator /= (MatrixImpl::value_type rhs)
992 MatrixImpl::value_type& MatrixImpl::operator()(
int row,
int col)
998 MatrixImpl::value_type MatrixImpl::operator()(
int row,
int col)
const 1030 ios <<
"[" << m(0, 0) <<
", " << m(0, 1) <<
", " << m(0, 2) <<
", " << m(0, 3) <<
1031 "] [" << m(1, 0) <<
", " << m(1, 1) <<
", " << m(1, 2) <<
", " << m(1, 3) <<
1032 "] [" << m(2, 0) <<
", " << m(2, 1) <<
", " << m(2, 2) <<
", " << m(2, 3) <<
1033 "] [" << m(3, 0) <<
", " << m(3, 1) <<
", " << m(3, 2) <<
", " << m(3, 3) <<
std::string operator+(const std::string &s1, const RefStr &s2)
bool operator==(const std::string &s1, const RefStr &s2)
int Compare(const Matrixf &m) const
Compare the current Matrix to the passed in one.
bool operator!=(const std::string &s1, const RefStr &s2)
TR_BASE_EXPORT std::ostream & operator<<(std::ostream &ios, const Matrixd &q)
Stream insertion operator.
std::string ToString(const T &t, int precision=-1)
A utility function to convert a basic type into a string.
Vec3f PostMult(const Vec3f &v) const
PostMultiply the matrix by the passed in vector.
void SetScale(value_type x, value_type y, value_type z)
Sets the scale values of the matrix.
void Set(const Matrixf &rhs)
Set the current Matrix from a passed in one.