6#include "Misc/AssertionMacros.h"
7#include "Math/UnrealMathUtility.h"
8#include "Containers/UnrealString.h"
9#include "Math/Vector.h"
12
13
30
31
32
33
34
35 FORCEINLINE FTwoVectors( FVector In1, FVector In2 );
38
39
40
41
47
48
49
50
51
52 FORCEINLINE FTwoVectors operator+(
const FTwoVectors& V )
const;
55
56
57
58
59
60 FORCEINLINE FTwoVectors operator-(
const FTwoVectors& V )
const;
63
64
65
66
67
68 FORCEINLINE FTwoVectors operator*(
float Scale )
const;
71
72
73
74
75
76 FTwoVectors operator/(
float Scale )
const;
79
80
81
82
83
84 FORCEINLINE FTwoVectors operator*(
const FTwoVectors& V )
const;
87
88
89
90
91
92 FORCEINLINE FTwoVectors operator/(
const FTwoVectors& V )
const;
97
98
99
100
101
102 bool operator==(
const FTwoVectors& V )
const;
105
106
107
108
109
110 bool operator!=(
const FTwoVectors& V )
const;
113
114
115
116
117
118
124
125
126
127
133
134
135
136
137
138 FORCEINLINE FTwoVectors operator+=(
const FTwoVectors& V );
141
142
143
144
145
146 FORCEINLINE FTwoVectors operator-=(
const FTwoVectors& V );
149
150
151
152
153
157
158
159
160
161
162 FTwoVectors operator/=(
float V );
165
166
167
168
169
170 FTwoVectors operator*=(
const FTwoVectors& V );
173
174
175
176
177
178 FTwoVectors operator/=(
const FTwoVectors& V );
181
182
183
184
185
186
187 FVector::FReal& operator[]( int32 i );
192
193
194
195
196 FVector::FReal GetMax()
const;
199
200
201
202
203 FVector::FReal GetMin()
const;
206
207
208
209
210 FString ToString()
const;
215
216
217
218
219
220
221 friend FArchive& operator<<( FArchive& Ar, FTwoVectors& TwoVectors )
223 return Ar << TwoVectors.v1 << TwoVectors.v2;
226 bool Serialize( FArchive& Ar )
235
239 return V.operator*( Scale );
261FORCEINLINE FTwoVectors FTwoVectors::operator+(
const FTwoVectors& V )
const
270FORCEINLINE FTwoVectors FTwoVectors::operator-(
const FTwoVectors& V )
const
279FORCEINLINE FTwoVectors FTwoVectors::operator*(
float Scale )
const
288FORCEINLINE FTwoVectors FTwoVectors::operator/(
float Scale )
const
290 const float RScale = 1.f / Scale;
293 FVector(v1 * RScale),
299FORCEINLINE FTwoVectors FTwoVectors::operator*(
const FTwoVectors& V )
const
308FORCEINLINE FTwoVectors FTwoVectors::operator/(
const FTwoVectors& V )
const
317FORCEINLINE bool FTwoVectors::operator==(
const FTwoVectors& V )
const
319 return ((v1 == V.v1) && (v2 == V.v2));
323FORCEINLINE bool FTwoVectors::operator!=(
const FTwoVectors& V )
const
325 return ((v1 != V.v1) || (v2 != V.v2));
329FORCEINLINE bool FTwoVectors::Equals(
const FTwoVectors& V,
float Tolerance )
const
331 return v1.Equals(V.v1, Tolerance) && v2.Equals(V.v2, Tolerance);
344FORCEINLINE FTwoVectors FTwoVectors::operator+=(
const FTwoVectors& V )
353FORCEINLINE FTwoVectors FTwoVectors::operator-=(
const FTwoVectors& V )
373 const float RV = 1.f/V;
382FORCEINLINE FTwoVectors FTwoVectors::operator*=(
const FTwoVectors& V )
390FORCEINLINE FTwoVectors FTwoVectors::operator/=(
const FTwoVectors& V )
401 const FVector::FReal MaxMax = FMath::Max(FMath::Max(v1.X, v1.Y), v1.Z);
402 const FVector::FReal MaxMin = FMath::Max(FMath::Max(v2.X, v2.Y), v2.Z);
404 return FMath::Max(MaxMax, MaxMin);
410 const FVector::FReal MinMax = FMath::Min(FMath::Min(v1.X, v1.Y), v1.Z);
411 const FVector::FReal MinMin = FMath::Min(FMath::Min(v2.X, v2.Y), v2.Z);
413 return FMath::Min(MinMax, MinMin);
429 default:
return v2.Z;
436 return FString::Printf(
TEXT(
"V1=(%s) V2=(%s)"), *v1.ToString(), *v2.ToString());
439template <>
struct TIsPODType<FTwoVectors> {
enum {
Value =
true }; };
FORCEINLINE FTwoVectors operator*(float Scale, const FTwoVectors &V)
#define UE_KINDA_SMALL_NUMBER