www.pudn.com > cad3d.zip > Matrices.h
#ifndef __Matrices_h__
#define __Matrices_h__
#include "3DMath/3DMatrix.h"
#include "3DMath/3DVector.h"
class MATH3D_API C3DTranslateMatrix : public C3DMatrix
{
public:
inline C3DTranslateMatrix(const C3DVector& rVec);
inline C3DTranslateMatrix(math_real x, math_real y, math_real z);
};
inline C3DTranslateMatrix::C3DTranslateMatrix(const C3DVector& rVec)
{
Identity();
(*this)(0,3) = rVec(0);
(*this)(1,3) = rVec(1);
(*this)(2,3) = rVec(2);
}
inline C3DTranslateMatrix::C3DTranslateMatrix(math_real x, math_real y, math_real z)
{
Identity();
(*this)(0,3) = x;
(*this)(1,3) = y;
(*this)(2,3) = z;
}
class MATH3D_API C3DScaleMatrix : public C3DMatrix
{
public:
inline C3DScaleMatrix(const C3DVector& rScale);
inline C3DScaleMatrix(math_real dScaleX, math_real dScaleY, math_real dScaleZ);
};
inline C3DScaleMatrix::C3DScaleMatrix(const C3DVector& rScale)
: C3DMatrix()
{
(*this)(0,0) = rScale(0);
(*this)(1,1) = rScale(1);
(*this)(2,2) = rScale(2);
(*this)(3,3) = 1.0;
}
inline C3DScaleMatrix::C3DScaleMatrix(math_real x, math_real y, math_real z)
: C3DMatrix()
{
(*this)(0,0) = x;
(*this)(1,1) = y;
(*this)(2,2) = z;
(*this)(3,3) = 1.0;
}
class MATH3D_API C3DRotateMatrix : public C3DMatrix
{
protected:
void SetRotationMatrix(math_real dAngle, math_real x, math_real y, math_real z);
public:
C3DRotateMatrix(math_real dAngle, math_real x, math_real y, math_real z);
C3DRotateMatrix(math_real dAngle, const C3DPoint &rAxe);
};
#endif//__Matrices_h__