ランタイム: Mix/Matrix3x3.h Source File

ランタイム

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

Matrix3x3.h
Go to the documentation of this file.
1 #pragma once
2
5
6 namespace Mix
7 {
10 class _MIX_DLL_API Matrix3x3
11 {
12 public:
13 union
14 {
15 struct
16 {
17 Float32 m00;
18 Float32 m01;
19 Float32 m02;
20 Float32 m10;
21 Float32 m11;
22 Float32 m12;
23 Float32 m20;
24 Float32 m21;
25 Float32 m22;
26 };
27
28 Float32 m[3][3];
29 };
30
31 public:
33 Matrix3x3( void );
44 Matrix3x3( Float32 _m00, Float32 _m01, Float32 _m02,
45 Float32 _m10, Float32 _m11, Float32 _m12,
46 Float32 _m20, Float32 _m21, Float32 _m22 );
49 Matrix3x3( const Matrix3x3& mat );
51 ~Matrix3x3( void );
52
53 public:
56 void SetScaling( Float32 s );
59 void SetScaling( const Mix::Vector2& s );
60
63 void SetSkew( const Mix::Vector2& s );
64
67 void SetRotation( Float32 theta );
68
71 void SetTranslation( const Mix::Vector2& t );
72
76 Mix::Vector3 GetColumn( UInt32 index ) const;
80 void SetColumn( UInt32 index, const Mix::Vector3& v );
81
85 Mix::Vector3 GetRow( UInt32 index ) const;
89 void SetRow( UInt32 index, const Mix::Vector3& v );
90
93 Boolean Inverse( void );
96 Mix::Matrix3x3 ToInverse( void ) const;
97
99 void Transpose( void );
102 Mix::Matrix3x3 ToTranspose( void ) const;
103
107 void Transform( Mix::Vector2* vectors, UInt32 count ) const;
112 void Transform( Mix::Vector3* vectors, UInt32 count ) const;
117 void Transform( const Mix::Vector2* srcVectors, Mix::Vector2* dstVectors, UInt32 count ) const;
123 void Transform( const Mix::Vector3* srcVectors, Mix::Vector3* dstVectors, UInt32 count ) const;
124
128 void TransformSR( Mix::Vector2* vectors, UInt32 count ) const;
133 void TransformSR( Mix::Vector3* vectors, UInt32 count ) const;
138 void TransformSR( const Mix::Vector2* srcVectors, Mix::Vector2* dstVectors, UInt32 count ) const;
144 void TransformSR( const Mix::Vector3* srcVectors, Mix::Vector3* dstVectors, UInt32 count ) const;
145
149 Boolean operator == ( const Matrix3x3& mat ) const;
153 Boolean operator != ( const Matrix3x3& mat ) const;
154
158 Matrix3x3& operator = ( const Matrix3x3& mat );
159
163 Matrix3x3& operator *= ( const Matrix3x3& mat );
167 Matrix3x3 operator * ( const Matrix3x3& mat ) const;
168
172 Vector2 operator * ( const Vector2& v ) const;
176 Vector3 operator * ( const Vector3& v ) const;
177
182 friend const Vector2 operator * ( const Vector2& v, const Matrix3x3& mat )
183 {
184 return ( mat * v );
185 }
186
191 friend const Vector3 operator * ( const Vector3& v, const Matrix3x3& mat )
192 {
193 return ( mat * v );
194 }
195
196 public:
199 static Matrix3x3 Zero( void )
200 {
201 static const Mix::Matrix3x3 mat( 0.0f, 0.0f, 0.0f,
202 0.0f, 0.0f, 0.0f,
203 0.0f, 0.0f, 0.0f );
204
205 return mat;
206 }
207
210 static const Matrix3x3& Identity( void )
211 {
212 static const Mix::Matrix3x3 mat( 1.0f, 0.0f, 0.0f,
213 0.0f, 1.0f, 0.0f,
214 0.0f, 0.0f, 1.0f );
215
216 return mat;
217 }
218 };
219
220 }
Mix::Vector3
3次元浮動小数点ベクトルクラス
Definition: Vector3.h:12
Mix::Matrix3x3::m21
Float32 m21
要素 ( 2, 1 ) の値
Definition: Matrix3x3.h:24
Mix::Matrix3x3::m10
Float32 m10
要素 ( 1, 0 ) の値
Definition: Matrix3x3.h:20
Mix::Matrix3x3
3x3行列クラス
Definition: Matrix3x3.h:10
Mix::Matrix3x3::m20
Float32 m20
要素 ( 2, 0 ) の値
Definition: Matrix3x3.h:23
Mix::Matrix3x3::Identity
static const Matrix3x3 & Identity(void)
単位行列を取得します
Definition: Matrix3x3.h:210
Mix::Matrix3x3::m22
Float32 m22
要素 ( 2, 2 ) の値
Definition: Matrix3x3.h:25
Mix::Matrix3x3::m12
Float32 m12
要素 ( 1, 2 ) の値
Definition: Matrix3x3.h:22
Mix::Matrix3x3::Zero
static Matrix3x3 Zero(void)
全ての要素が 0.0f の行列を取得します
Definition: Matrix3x3.h:199
Mix::Matrix3x3::m00
Float32 m00
要素 ( 0, 0 ) の値
Definition: Matrix3x3.h:17
UInt32
unsigned int UInt32
符号無し32ビット整数
Definition: Common.h:68
Mix::Matrix3x3::m01
Float32 m01
要素 ( 0, 1 ) の値
Definition: Matrix3x3.h:18
Mix
ミックス
Definition: AtomicValue.h:6
Mix::Matrix3x3::m11
Float32 m11
要素 ( 1, 1 ) の値
Definition: Matrix3x3.h:21
Mix::Vector2
2次元浮動小数点ベクトルクラス
Definition: Vector2.h:12
Float32
float Float32
32ビット浮動小数点
Definition: Common.h:83
Mix::Matrix3x3::m02
Float32 m02
要素 ( 0, 2 ) の値
Definition: Matrix3x3.h:19
Boolean
BOOL Boolean
32ビットブーリアン
Definition: Common.h:102
_MIX_DLL_API
#define _MIX_DLL_API
DLLインポート定義
Definition: Common.h:38