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

ランタイム

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

- File List
- File Members

Quaternion.h
Go to the documentation of this file.
1 #pragma once
2
5
6 namespace Mix{
7
10 class _MIX_DLL_API Quaternion
11 {
12 public:
13 union
14 {
15 Float32 data[4];
16
17 struct
18 {
19 Float32 x;
20 Float32 y;
21 Float32 z;
22 Float32 w;
23 };
24 };
25
26 public:
28 Quaternion( void );
31 Quaternion( const Quaternion& q );
37 Quaternion( Float32 qx, Float32 qy, Float32 qz, Float32 qw );
41 Quaternion( const Mix::Vector3& axis, Float32 angle );
43 ~Quaternion( void );
44
45 public:
49 void SetRotationAxis( const Mix::Vector3& axis, Float32 angle );
53 void RotationAxis( const Mix::Vector3& axis, Float32 angle );
54
57 Mix::Vector3 GetAxis( void ) const;
60 Float32 GetAngle( void ) const;
61
63 void Normalize( void );
66 Quaternion ToNormalize( void ) const;
67
69 void Inverse( void );
72 Quaternion ToInverse( void ) const;
73
74 public:
78 Boolean operator == ( const Quaternion& q ) const;
82 Boolean operator != ( const Quaternion& q ) const;
83
87 Quaternion& operator = ( const Quaternion& q );
91 Quaternion& operator += ( const Quaternion& q );
95 Quaternion& operator -= ( const Quaternion& q );
99 Quaternion& operator *= ( const Quaternion& q );
103 Quaternion& operator *= ( Float32 v );
104
108 Quaternion operator + ( const Quaternion& q ) const;
112 Quaternion operator - ( const Quaternion& q ) const;
116 Quaternion operator * ( const Quaternion& q ) const;
120 Quaternion operator * ( Float32 v ) const;
121
124 Quaternion operator -( void ) const;
125
126 public:
131 static Float32 Dot( const Mix::Quaternion& l, const Mix::Quaternion& r );
136 static Mix::Quaternion Cross( const Mix::Quaternion& l, const Mix::Quaternion& r );
137
142 static Mix::Quaternion Difference( const Mix::Quaternion& from, const Mix::Quaternion& to );
143
149 static Quaternion Slerp( const Mix::Quaternion& qs, const Mix::Quaternion& qd, Float32 t );
150
151 public:
154 static const Mix::Quaternion& Identity( void )
155 {
156 static const Mix::Quaternion identity( 0.0f, 0.0f, 0.0f, 1.0f );
157
158 return identity;
159 }
160 };
161
162 }
Mix::Vector3
3次元浮動小数点ベクトルクラス
Definition: Vector3.h:12
Mix::Quaternion::z
Float32 z
Z成分
Definition: Quaternion.h:21
Mix::Quaternion
クォータニオンクラス
Definition: Quaternion.h:10
Mix::Quaternion::x
Float32 x
X成分
Definition: Quaternion.h:19
Mix::Quaternion::w
Float32 w
W成分
Definition: Quaternion.h:22
Mix
ミックス
Definition: AtomicValue.h:6
Float32
float Float32
32ビット浮動小数点
Definition: Common.h:83
Boolean
BOOL Boolean
32ビットブーリアン
Definition: Common.h:102
Mix::Quaternion::Identity
static const Mix::Quaternion & Identity(void)
初期値( 0.0f, 0.0f, 0.0f, 1.0f )を取得します
Definition: Quaternion.h:154
Mix::Quaternion::y
Float32 y
Y成分
Definition: Quaternion.h:20
_MIX_DLL_API
#define _MIX_DLL_API
DLLインポート定義
Definition: Common.h:38