matrix3d.h
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:1k
- // matrix3d.h
- //
- #ifndef MATRIX_3D_NCLUDE_H_
- #define MATRIX_3D_NCLUDE_H_
- class Matrix3D {
- void InitMatrix(void)
- {
- memset(m_rotation,0,(size_t)(sizeof(double)*3));
- memset(m_position,0,(size_t)(sizeof(double)*3));
- memset(m_scale,0,(size_t)(sizeof(double)*3));
- }
- protected:
- double m_rotation[3];
- double m_position[3];
- double m_scale[3];
- public:
- Matrix3D(void);
- Matrix3D(const Matrix3D& matrix);
- ~Matrix3D(void);
- void Copy(const Matrix3D& matrix);
- Matrix3D& operator = (const Matrix3D& matrix);
- void GetRotation(double& xrot, double& yrot, double& zrot)const;
- void GetPosition(double& x, double& y, double& z)const;
- void GetScale(double& xscale, double& yscale, double& zscale)const;
- void SetRotation(double xrot, double yrot, double zrot);
- void SetPosition(double x, double y, double z);
- void SetScale(double xscale, double yscale, double zscale);
- void AddRotation(double xrot, double yrot, double zrot);
- double X(void)const{ return m_position[0];}
- double Y(void)const{ return m_position[1];}
- double Z(void)const{ return m_position[2];}
- double XRot(void)const{ return m_rotation[0];}
- double YRot(void)const{ return m_rotation[1];}
- double ZRot(void)const{ return m_rotation[2];}
- double XScale(void)const{ return m_scale[0];}
- double YScale(void)const{ return m_scale[1];}
- double ZScale(void)const{ return m_scale[2];}
- };
- #endif