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

ランタイム

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

- File List
- File Members

Vector4.h
Go to the documentation of this file.
1 #pragma once
2
5
6 namespace Mix{
7
8 class Vector3;
9
12 class _MIX_DLL_API Vector4
13 {
14 public:
15 union
16 {
17 struct
18 {
19 Float32 x;
20 Float32 y;
21 Float32 z;
22 Float32 w;
23 };
24
25 struct
26 {
27 Float32 r;
28 Float32 g;
29 Float32 b;
30 Float32 a;
31 };
32
33 Float32 data[4];
34 };
35
36 public:
38 Vector4( void );
41 Vector4( const Vector4& v );
44 Vector4( const Vector3& v );
49 Vector4( Float32 vx, Float32 vy, Float32 vz );
55 Vector4( Float32 vx, Float32 vy, Float32 vz, Float32 vw );
56
60 Boolean operator == ( const Vector4& v ) const;
64 Boolean operator != ( const Vector4& v ) const;
65
69 Vector4& operator = ( const Vector4& v );
73 Vector4& operator = ( const Vector3& v );
77 Vector4& operator += ( const Vector4& v );
81 Vector4& operator -= ( const Vector4& v );
85 Vector4& operator *= ( const Vector4& v );
89 Vector4& operator *= ( Float32 s );
93 Vector4& operator /= ( const Vector4& v );
97 Vector4& operator /= ( Float32 s );
98
102 Vector4 operator + ( const Vector4& v ) const;
106 Vector4 operator - ( const Vector4& v ) const;
110 Vector4 operator * ( const Vector4& v ) const;
114 Vector4 operator * ( Float32 s ) const;
118 Vector4 operator / ( const Vector4& v ) const;
122 Vector4 operator / ( Float32 s ) const;
123
126 Vector4 operator +( void ) const;
129 Vector4 operator -( void ) const;
130
135 friend const Vector4 operator * ( Float32 s, const Vector4& v )
136 {
137 Vector4 tmp( v );
138 tmp *= s;
139 return tmp;
140 }
141
146 friend const Vector4 operator / ( Float32 s, const Vector4& v )
147 {
148 Vector4 tmp( v );
149 tmp /= s;
150 return tmp;
151 }
152
158 void Set( Float32 vx, Float32 vy, Float32 vz, Float32 vw );
159
162 Float32 Normalize( void );
166 Vector4 ToNormalize( Float32* pLength = NULL ) const;
167
169 void Saturate( void );
172 Vector4 ToSaturate( void ) const;
173
176 Float32 GetLengthSqr( void ) const;
179 Float32 GetLength( void ) const;
183 Float32 GetLengthF( void ) const;
184
189 static Float32 Dot( const Vector4& lv, const Vector4& rv );
194 static Vector4 Cross( const Vector4& lv, const Vector4& rv );
195
198 static Vector4 Rand( void );
202 static Vector4 Rand( const Vector4& v );
207 static Vector4 Rand( const Vector4& v0, const Vector4& v1 );
208
213 static Vector4 Min( const Vector4& v0, const Vector4& v1 );
218 static Vector4 Max( const Vector4& v0, const Vector4& v1 );
219
225 static Vector4 Lerp( const Vector4& vs, const Vector4& ve, Float32 t );
231 static Vector4 Slerp( const Vector4& vs, const Vector4& ve, Float32 t );
232
233 public:
236 static const Vector4& Zero( void )
237 {
238 static const Vector4 zero( 0.0f, 0.0f, 0.0f, 1.0f );
239 return zero;
240 }
241
244 static const Vector4& XAxis( void )
245 {
246 static const Vector4 xAxis( 1.0f, 0.0f, 0.0f, 1.0f );
247 return xAxis;
248 }
249
252 static const Vector4& YAxis( void )
253 {
254 static const Vector4 yAxis( 0.0f, 1.0f, 0.0f, 1.0f );
255 return yAxis;
256 }
257
260 static const Vector4& ZAxis( void )
261 {
262 static const Vector4 zAxis( 0.0f, 0.0f, 1.0f, 1.0f );
263 return zAxis;
264 }
265 };
266
267 }
Mix::Vector4::a
Float32 a
A成分
Definition: Vector4.h:30
Mix::Vector3
3次元浮動小数点ベクトルクラス
Definition: Vector3.h:12
Mix::Vector4::Zero
static const Vector4 & Zero(void)
初期値( 0.0, 0.0, 0.0, 1.0 )を取得します
Definition: Vector4.h:236
Mix::Vector4::YAxis
static const Vector4 & YAxis(void)
Y軸( 0.0, 1.0, 0.0, 1.0 )を取得します
Definition: Vector4.h:252
Mix::Vector4::y
Float32 y
Y座標
Definition: Vector4.h:20
Mix::Vector4::x
Float32 x
X座標
Definition: Vector4.h:19
Mix::Vector4::w
Float32 w
W座標
Definition: Vector4.h:22
Mix::Vector4::ZAxis
static const Vector4 & ZAxis(void)
Z軸( 0.0, 0.0, 1.0, 1.0 )を取得します
Definition: Vector4.h:260
Mix::Vector4::XAxis
static const Vector4 & XAxis(void)
X軸( 1.0, 0.0, 0.0, 1.0 )を取得します
Definition: Vector4.h:244
Mix
ミックス
Definition: AtomicValue.h:6
Mix::Vector4::r
Float32 r
R成分
Definition: Vector4.h:27
Mix::Vector4::g
Float32 g
G成分
Definition: Vector4.h:28
Float32
float Float32
32ビット浮動小数点
Definition: Common.h:83
Mix::Vector4::b
Float32 b
B成分
Definition: Vector4.h:29
Mix::Vector4
4次元浮動小数点ベクトルクラス
Definition: Vector4.h:12
Boolean
BOOL Boolean
32ビットブーリアン
Definition: Common.h:102
Mix::Vector4::z
Float32 z
Z座標
Definition: Vector4.h:21
_MIX_DLL_API
#define _MIX_DLL_API
DLLインポート定義
Definition: Common.h:38
Mix::Rand
_MIX_DLL_API UInt32 Rand(void)
整数の乱数を取得します