Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
GenericPlatformMath.h
Go to the documentation of this file.
1// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
2
3
4/*=============================================================================================
5 GenericPlatformMath.h: Generic platform Math classes, mostly implemented with ANSI C++
6==============================================================================================*/
7
8#pragma once
9
10#include "../BasicTypes.h"
11
14
15class FString;
16
17template<typename T, typename Allocator = FDefaultAllocator> class TArray;
18
19
20/**
21 * Generic implementation for most platforms
22 */
24{
25 /**
26 * Converts a float to an integer with truncation towards zero.
27 * @param F Floating point value to convert
28 * @return Truncated integer.
29 */
30 static CONSTEXPR FORCEINLINE int32 TruncToInt(float F)
31 {
32 return (int)F;
33 }
34
35 /**
36 * Converts a float to an integer value with truncation towards zero.
37 * @param F Floating point value to convert
38 * @return Truncated integer value.
39 */
40 static CONSTEXPR FORCEINLINE float TruncToFloat(float F)
41 {
42 return (float)TruncToInt(F);
43 }
44
45 /**
46 * Converts a float to a nearest less or equal integer.
47 * @param F Floating point value to convert
48 * @return An integer less or equal to 'F'.
49 */
50 static FORCEINLINE int32 FloorToInt(float F)
51 {
52 return TruncToInt(floorf(F));
53 }
54
55 /**
56 * Converts a float to the nearest less or equal integer.
57 * @param F Floating point value to convert
58 * @return An integer less or equal to 'F'.
59 */
60 static FORCEINLINE float FloorToFloat(float F)
61 {
62 return floorf(F);
63 }
64
65 /**
66 * Converts a double to a less or equal integer.
67 * @param F Floating point value to convert
68 * @return The nearest integer value to 'F'.
69 */
70 static FORCEINLINE double FloorToDouble(double F)
71 {
72 return floor(F);
73 }
74
75 /**
76 * Converts a float to the nearest integer. Rounds up when the fraction is .5
77 * @param F Floating point value to convert
78 * @return The nearest integer to 'F'.
79 */
80 static FORCEINLINE int32 RoundToInt(float F)
81 {
82 return FloorToInt(F + 0.5f);
83 }
84
85 /**
86 * Converts a float to the nearest integer. Rounds up when the fraction is .5
87 * @param F Floating point value to convert
88 * @return The nearest integer to 'F'.
89 */
90 static FORCEINLINE float RoundToFloat(float F)
91 {
92 return FloorToFloat(F + 0.5f);
93 }
94
95 /**
96 * Converts a double to the nearest integer. Rounds up when the fraction is .5
97 * @param F Floating point value to convert
98 * @return The nearest integer to 'F'.
99 */
100 static FORCEINLINE double RoundToDouble(double F)
101 {
102 return FloorToDouble(F + 0.5);
103 }
104
105 /**
106 * Converts a float to the nearest greater or equal integer.
107 * @param F Floating point value to convert
108 * @return An integer greater or equal to 'F'.
109 */
110 static FORCEINLINE int32 CeilToInt(float F)
111 {
112 return TruncToInt(ceilf(F));
113 }
114
115 /**
116 * Converts a float to the nearest greater or equal integer.
117 * @param F Floating point value to convert
118 * @return An integer greater or equal to 'F'.
119 */
120 static FORCEINLINE float CeilToFloat(float F)
121 {
122 return ceilf(F);
123 }
124
125 /**
126 * Converts a double to the nearest greater or equal integer.
127 * @param F Floating point value to convert
128 * @return An integer greater or equal to 'F'.
129 */
130 static FORCEINLINE double CeilToDouble(double F)
131 {
132 return ceil(F);
133 }
134
135 /**
136 * Returns signed fractional part of a float.
137 * @param Value Floating point value to convert
138 * @return A float between >=0 and < 1 for nonnegative input. A float between >= -1 and < 0 for negative input.
139 */
140 static FORCEINLINE float Fractional(float Value)
141 {
142 return Value - TruncToFloat(Value);
143 }
144
145 /**
146 * Returns the fractional part of a float.
147 * @param Value Floating point value to convert
148 * @return A float between >=0 and < 1.
149 */
150 static FORCEINLINE float Frac(float Value)
151 {
152 return Value - FloorToFloat(Value);
153 }
154
155 /**
156 * Breaks the given value into an integral and a fractional part.
157 * @param InValue Floating point value to convert
158 * @param OutIntPart Floating point value that receives the integral part of the number.
159 * @return The fractional part of the number.
160 */
161 static FORCEINLINE float Modf(const float InValue, float* OutIntPart)
162 {
163 return modff(InValue, OutIntPart);
164 }
165
166 /**
167 * Breaks the given value into an integral and a fractional part.
168 * @param InValue Floating point value to convert
169 * @param OutIntPart Floating point value that receives the integral part of the number.
170 * @return The fractional part of the number.
171 */
172 static FORCEINLINE double Modf(const double InValue, double* OutIntPart)
173 {
174 return modf(InValue, OutIntPart);
175 }
176
177 // Returns e^Value
178 static FORCEINLINE float Exp( float Value ) { return expf(Value); }
179 // Returns 2^Value
180 static FORCEINLINE float Exp2( float Value ) { return powf(2.f, Value); /*exp2f(Value);*/ }
181 static FORCEINLINE float Loge( float Value ) { return logf(Value); }
182 static FORCEINLINE float LogX( float Base, float Value ) { return Loge(Value) / Loge(Base); }
183 // 1.0 / Loge(2) = 1.4426950f
184 static FORCEINLINE float Log2( float Value ) { return Loge(Value) * 1.4426950f; }
185
186 /**
187 * Returns the floating-point remainder of X / Y
188 * Warning: Always returns remainder toward 0, not toward the smaller multiple of Y.
189 * So for example Fmod(2.8f, 2) gives .8f as you would expect, however, Fmod(-2.8f, 2) gives -.8f, NOT 1.2f
190 * Use Floor instead when snapping positions that can be negative to a grid
191 */
192 static FORCEINLINE float Fmod(float X, float Y)
193 {
194 if (fabsf(Y) <= 1.e-8f)
195 {
196 return 0.f;
197 }
198 const float Quotient = TruncToFloat(X / Y);
199 float IntPortion = Y * Quotient;
200
201 // Rounding and imprecision could cause IntPortion to exceed X and cause the result to be outside the expected range.
202 // For example Fmod(55.8, 9.3) would result in a very small negative value!
203 if (fabsf(IntPortion) > fabsf(X))
204 {
205 IntPortion = X;
206 }
207
208 const float Result = X - IntPortion;
209 return Result;
210 }
211
212 static FORCEINLINE float Sin( float Value ) { return sinf(Value); }
213 static FORCEINLINE float Asin( float Value ) { return asinf( (Value<-1.f) ? -1.f : ((Value<1.f) ? Value : 1.f) ); }
214 static FORCEINLINE float Sinh(float Value) { return sinhf(Value); }
215 static FORCEINLINE float Cos( float Value ) { return cosf(Value); }
216 static FORCEINLINE float Acos( float Value ) { return acosf( (Value<-1.f) ? -1.f : ((Value<1.f) ? Value : 1.f) ); }
217 static FORCEINLINE float Tan( float Value ) { return tanf(Value); }
218 static FORCEINLINE float Atan( float Value ) { return atanf(Value); }
219 static FORCEINLINE float Sqrt( float Value ) { return sqrtf(Value); }
220 static FORCEINLINE float Pow( float A, float B ) { return powf(A,B); }
221
222 /** Computes a fully accurate inverse square root */
223 static FORCEINLINE float InvSqrt( float F )
224 {
225 return 1.0f / sqrtf( F );
226 }
227
228 /** Computes a faster but less accurate inverse square root */
229 static FORCEINLINE float InvSqrtEst( float F )
230 {
231 return InvSqrt( F );
232 }
233
234 /** Return true if value is NaN (not a number). */
235 static FORCEINLINE bool IsNaN( float A )
236 {
237 return ((*(uint32*)&A) & 0x7FFFFFFF) > 0x7F800000;
238 }
239 /** Return true if value is finite (not NaN and not Infinity). */
240 static FORCEINLINE bool IsFinite( float A )
241 {
242 return ((*(uint32*)&A) & 0x7F800000) != 0x7F800000;
243 }
244 static FORCEINLINE bool IsNegativeFloat(const float& A)
245 {
246 return ( (*(uint32*)&A) >= (uint32)0x80000000 ); // Detects sign bit.
247 }
248
249 static FORCEINLINE bool IsNegativeDouble(const double& A)
250 {
251 return ( (*(uint64*)&A) >= (uint64)0x8000000000000000 ); // Detects sign bit.
252 }
253
254 /** Returns a random integer between 0 and RAND_MAX, inclusive */
255 static FORCEINLINE int32 Rand() { return rand(); }
256
257 /** Seeds global random number functions Rand() and FRand() */
258 static FORCEINLINE void RandInit(int32 Seed) { srand( Seed ); }
259
260 /** Returns a random float between 0 and 1, inclusive. */
261 static FORCEINLINE float FRand() { return Rand() / (float)RAND_MAX; }
262
263 /**
264 * Computes the base 2 logarithm for an integer value that is greater than 0.
265 * The result is rounded down to the nearest integer.
266 *
267 * @param Value The value to compute the log of
268 * @return Log2 of Value. 0 if Value is 0.
269 */
270 static FORCEINLINE uint32 FloorLog2(uint32 Value)
271 {
272/* // reference implementation
273 // 1500ms on test data
274 uint32 Bit = 32;
275 for (; Bit > 0;)
276 {
277 Bit--;
278 if (Value & (1<<Bit))
279 {
280 break;
281 }
282 }
283 return Bit;
284*/
285 // same output as reference
286
287 // see http://codinggorilla.domemtech.com/?p=81 or http://en.wikipedia.org/wiki/Binary_logarithm but modified to return 0 for a input value of 0
288 // 686ms on test data
289 uint32 pos = 0;
290 if (Value >= 1<<16) { Value >>= 16; pos += 16; }
291 if (Value >= 1<< 8) { Value >>= 8; pos += 8; }
292 if (Value >= 1<< 4) { Value >>= 4; pos += 4; }
293 if (Value >= 1<< 2) { Value >>= 2; pos += 2; }
294 if (Value >= 1<< 1) { pos += 1; }
295 return (Value == 0) ? 0 : pos;
296
297 // even faster would be method3 but it can introduce more cache misses and it would need to store the table somewhere
298 // 304ms in test data
299 /*int LogTable256[256];
300
301 void prep()
302 {
303 LogTable256[0] = LogTable256[1] = 0;
304 for (int i = 2; i < 256; i++)
305 {
306 LogTable256[i] = 1 + LogTable256[i / 2];
307 }
308 LogTable256[0] = -1; // if you want log(0) to return -1
309 }
310
311 int _forceinline method3(uint32 v)
312 {
313 int r; // r will be lg(v)
314 uint32 tt; // temporaries
315
316 if ((tt = v >> 24) != 0)
317 {
318 r = (24 + LogTable256[tt]);
319 }
320 else if ((tt = v >> 16) != 0)
321 {
322 r = (16 + LogTable256[tt]);
323 }
324 else if ((tt = v >> 8 ) != 0)
325 {
326 r = (8 + LogTable256[tt]);
327 }
328 else
329 {
330 r = LogTable256[v];
331 }
332 return r;
333 }*/
334 }
335
336 /**
337 * Computes the base 2 logarithm for a 64-bit value that is greater than 0.
338 * The result is rounded down to the nearest integer.
339 *
340 * @param Value The value to compute the log of
341 * @return Log2 of Value. 0 if Value is 0.
342 */
343 static FORCEINLINE uint64 FloorLog2_64(uint64 Value)
344 {
345 uint64 pos = 0;
346 if (Value >= 1ull<<32) { Value >>= 32; pos += 32; }
347 if (Value >= 1ull<<16) { Value >>= 16; pos += 16; }
348 if (Value >= 1ull<< 8) { Value >>= 8; pos += 8; }
349 if (Value >= 1ull<< 4) { Value >>= 4; pos += 4; }
350 if (Value >= 1ull<< 2) { Value >>= 2; pos += 2; }
351 if (Value >= 1ull<< 1) { pos += 1; }
352 return (Value == 0) ? 0 : pos;
353 }
354
355 /**
356 * Counts the number of leading zeros in the bit representation of the value
357 *
358 * @param Value the value to determine the number of leading zeros for
359 *
360 * @return the number of zeros before the first "on" bit
361 */
362 static FORCEINLINE uint32 CountLeadingZeros(uint32 Value)
363 {
364 if (Value == 0) return 32;
365 return 31 - FloorLog2(Value);
366 }
367
368 /**
369 * Counts the number of leading zeros in the bit representation of the 64-bit value
370 *
371 * @param Value the value to determine the number of leading zeros for
372 *
373 * @return the number of zeros before the first "on" bit
374 */
375 static FORCEINLINE uint64 CountLeadingZeros64(uint64 Value)
376 {
377 if (Value == 0) return 64;
378 return 63 - FloorLog2_64(Value);
379 }
380
381 /**
382 * Counts the number of trailing zeros in the bit representation of the value
383 *
384 * @param Value the value to determine the number of trailing zeros for
385 *
386 * @return the number of zeros after the last "on" bit
387 */
388 static FORCEINLINE uint32 CountTrailingZeros(uint32 Value)
389 {
390 if (Value == 0)
391 {
392 return 32;
393 }
394 uint32 Result = 0;
395 while ((Value & 1) == 0)
396 {
397 Value >>= 1;
398 ++Result;
399 }
400 return Result;
401 }
402
403 /**
404 * Returns smallest N such that (1<<N)>=Arg.
405 * Note: CeilLogTwo(0)=0 because (1<<0)=1 >= 0.
406 */
407 static FORCEINLINE uint32 CeilLogTwo( uint32 Arg )
408 {
409 int32 Bitmask = ((int32)(CountLeadingZeros(Arg) << 26)) >> 31;
410 return (32 - CountLeadingZeros(Arg - 1)) & (~Bitmask);
411 }
412
413 static FORCEINLINE uint64 CeilLogTwo64( uint64 Arg )
414 {
415 int64 Bitmask = ((int64)(CountLeadingZeros64(Arg) << 57)) >> 63;
416 return (64 - CountLeadingZeros64(Arg - 1)) & (~Bitmask);
417 }
418
419 /** @return Rounds the given number up to the next highest power of two. */
420 static FORCEINLINE uint32 RoundUpToPowerOfTwo(uint32 Arg)
421 {
422 return 1 << CeilLogTwo(Arg);
423 }
424
425 /** Spreads bits to every other. */
426 static FORCEINLINE uint32 MortonCode2( uint32 x )
427 {
428 x &= 0x0000ffff;
429 x = (x ^ (x << 8)) & 0x00ff00ff;
430 x = (x ^ (x << 4)) & 0x0f0f0f0f;
431 x = (x ^ (x << 2)) & 0x33333333;
432 x = (x ^ (x << 1)) & 0x55555555;
433 return x;
434 }
435
436 /** Reverses MortonCode2. Compacts every other bit to the right. */
437 static FORCEINLINE uint32 ReverseMortonCode2( uint32 x )
438 {
439 x &= 0x55555555;
440 x = (x ^ (x >> 1)) & 0x33333333;
441 x = (x ^ (x >> 2)) & 0x0f0f0f0f;
442 x = (x ^ (x >> 4)) & 0x00ff00ff;
443 x = (x ^ (x >> 8)) & 0x0000ffff;
444 return x;
445 }
446
447 /** Spreads bits to every 3rd. */
448 static FORCEINLINE uint32 MortonCode3( uint32 x )
449 {
450 x &= 0x000003ff;
451 x = (x ^ (x << 16)) & 0xff0000ff;
452 x = (x ^ (x << 8)) & 0x0300f00f;
453 x = (x ^ (x << 4)) & 0x030c30c3;
454 x = (x ^ (x << 2)) & 0x09249249;
455 return x;
456 }
457
458 /** Reverses MortonCode3. Compacts every 3rd bit to the right. */
459 static FORCEINLINE uint32 ReverseMortonCode3( uint32 x )
460 {
461 x &= 0x09249249;
462 x = (x ^ (x >> 2)) & 0x030c30c3;
463 x = (x ^ (x >> 4)) & 0x0300f00f;
464 x = (x ^ (x >> 8)) & 0xff0000ff;
465 x = (x ^ (x >> 16)) & 0x000003ff;
466 return x;
467 }
468
469 /**
470 * Returns value based on comparand. The main purpose of this function is to avoid
471 * branching based on floating point comparison which can be avoided via compiler
472 * intrinsics.
473 *
474 * Please note that we don't define what happens in the case of NaNs as there might
475 * be platform specific differences.
476 *
477 * @param Comparand Comparand the results are based on
478 * @param ValueGEZero Return value if Comparand >= 0
479 * @param ValueLTZero Return value if Comparand < 0
480 *
481 * @return ValueGEZero if Comparand >= 0, ValueLTZero otherwise
482 */
483 static CONSTEXPR FORCEINLINE float FloatSelect( float Comparand, float ValueGEZero, float ValueLTZero )
484 {
485 return Comparand >= 0.f ? ValueGEZero : ValueLTZero;
486 }
487
488 /**
489 * Returns value based on comparand. The main purpose of this function is to avoid
490 * branching based on floating point comparison which can be avoided via compiler
491 * intrinsics.
492 *
493 * Please note that we don't define what happens in the case of NaNs as there might
494 * be platform specific differences.
495 *
496 * @param Comparand Comparand the results are based on
497 * @param ValueGEZero Return value if Comparand >= 0
498 * @param ValueLTZero Return value if Comparand < 0
499 *
500 * @return ValueGEZero if Comparand >= 0, ValueLTZero otherwise
501 */
502 static CONSTEXPR FORCEINLINE double FloatSelect( double Comparand, double ValueGEZero, double ValueLTZero )
503 {
504 return Comparand >= 0.f ? ValueGEZero : ValueLTZero;
505 }
506
507 /** Computes absolute value in a generic way */
508 template< class T >
509 static CONSTEXPR FORCEINLINE T Abs( const T A )
510 {
511 return (A>=(T)0) ? A : -A;
512 }
513
514 /** Returns 1, 0, or -1 depending on relation of T to 0 */
515 template< class T >
516 static CONSTEXPR FORCEINLINE T Sign( const T A )
517 {
518 return (A > (T)0) ? (T)1 : ((A < (T)0) ? (T)-1 : (T)0);
519 }
520
521 /** Returns higher value in a generic way */
522 template< class T >
523 static CONSTEXPR FORCEINLINE T Max( const T A, const T B )
524 {
525 return (A>=B) ? A : B;
526 }
527
528 /** Returns lower value in a generic way */
529 template< class T >
530 static CONSTEXPR FORCEINLINE T Min( const T A, const T B )
531 {
532 return (A<=B) ? A : B;
533 }
534
535 /**
536 * Min of Array
537 * @param Array of templated type
538 * @param Optional pointer for returning the index of the minimum element, if multiple minimum elements the first index is returned
539 * @return The min value found in the array or default value if the array was empty
540 */
541 template< class T >
542 static FORCEINLINE T Min(const TArray<T>& Values, int32* MinIndex = NULL)
543 {
544 if (Values.Num() == 0)
545 {
546 if (MinIndex)
547 {
549 }
550 return T();
551 }
552
553 T CurMin = Values[0];
554 int32 CurMinIndex = 0;
555 for (int32 v = 1; v < Values.Num(); ++v)
556 {
557 const T Value = Values[v];
558 if (Value < CurMin)
559 {
560 CurMin = Value;
561 CurMinIndex = v;
562 }
563 }
564
565 if (MinIndex)
566 {
568 }
569 return CurMin;
570 }
571
572 /**
573 * Max of Array
574 * @param Array of templated type
575 * @param Optional pointer for returning the index of the maximum element, if multiple maximum elements the first index is returned
576 * @return The max value found in the array or default value if the array was empty
577 */
578 template< class T >
579 static FORCEINLINE T Max(const TArray<T>& Values, int32* MaxIndex = NULL)
580 {
581 if (Values.Num() == 0)
582 {
583 if (MaxIndex)
584 {
586 }
587 return T();
588 }
589
590 T CurMax = Values[0];
591 int32 CurMaxIndex = 0;
592 for (int32 v = 1; v < Values.Num(); ++v)
593 {
594 const T Value = Values[v];
595 if (CurMax < Value)
596 {
597 CurMax = Value;
598 CurMaxIndex = v;
599 }
600 }
601
602 if (MaxIndex)
603 {
605 }
606 return CurMax;
607 }
608
609 static FORCEINLINE int32 CountBits(uint64 Bits)
610 {
611 // https://en.wikipedia.org/wiki/Hamming_weight
612 Bits -= (Bits >> 1) & 0x5555555555555555ull;
613 Bits = (Bits & 0x3333333333333333ull) + ((Bits >> 2) & 0x3333333333333333ull);
614 Bits = (Bits + (Bits >> 4)) & 0x0f0f0f0f0f0f0f0full;
615 return (Bits * 0x0101010101010101) >> 56;
616 }
617};
618
619/** Float specialization */
620template<>
621FORCEINLINE float FGenericPlatformMath::Abs( const float A )
622{
623 return fabsf( A );
624}
625
626using FPlatformMath = FGenericPlatformMath;
static unsigned int GetBuildUniqueId()
Definition Atlas.h:30
ARK_API LPVOID GetDataAddress(const std::string &name)
Definition Base.cpp:15
ARK_API BitField GetBitField(LPVOID base, const std::string &name)
Definition Base.cpp:25
ARK_API BitField GetBitField(const void *base, const std::string &name)
Definition Base.cpp:20
#define ARK_API
Definition Base.h:9
ARK_API DWORD64 GetAddress(const void *base, const std::string &name)
Definition Base.cpp:5
ARK_API LPVOID GetAddress(const std::string &name)
Definition Base.cpp:10
FPlatformTypes::CHAR16 UCS2CHAR
A 16-bit character containing a UCS2 (Unicode, 16-bit, fixed-width) code unit, used for compatibility...
Definition BasicTypes.h:124
@ INDEX_NONE
Definition BasicTypes.h:144
FWindowsPlatformTypes FPlatformTypes
Definition BasicTypes.h:94
#define PLATFORM_LITTLE_ENDIAN
Definition BasicTypes.h:12
FPlatformTypes::CHAR8 UTF8CHAR
An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.
Definition BasicTypes.h:122
ENoInit
Definition BasicTypes.h:151
@ NoInit
Definition BasicTypes.h:151
#define check(expr)
Definition BasicTypes.h:14
FPlatformTypes::CHAR16 UTF16CHAR
A 16-bit character containing a UTF16 (Unicode, 16-bit, variable-width) code unit.
Definition BasicTypes.h:126
#define CONSTEXPR
Definition BasicTypes.h:7
EForceInit
Definition BasicTypes.h:147
@ ForceInitToZero
Definition BasicTypes.h:149
@ ForceInit
Definition BasicTypes.h:148
FPlatformTypes::CHAR32 UTF32CHAR
A 32-bit character containing a UTF32 (Unicode, 32-bit, fixed-width) code unit.
Definition BasicTypes.h:128
#define THRESH_VECTOR_NORMALIZED
#define THRESH_NORMALS_ARE_PARALLEL
#define THRESH_POINTS_ARE_SAME
#define SMALL_NUMBER
#define THRESH_POINT_ON_PLANE
#define PI
#define THRESH_NORMALS_ARE_ORTHOGONAL
#define KINDA_SMALL_NUMBER
#define BIG_NUMBER
#define FASTASIN_HALF_PI
#define HALF_PI
#define INV_PI
FORCEINLINE float ComputeSquaredDistanceFromBoxToPoint(const FVector &Mins, const FVector &Maxs, const FVector &Point)
Definition Vector.h:893
FORCEINLINE FVector ClampVector(const FVector &V, const FVector &Min, const FVector &Max)
Definition Vector.h:1646
FORCEINLINE FVector operator*(float Scale, const FVector &V)
Definition Vector.h:870
ApiUtils & operator=(ApiUtils &&)=delete
ApiUtils()=default
void SetCheatManager(UShooterCheatManager *cheatmanager)
Definition ApiUtils.cpp:44
void SetWorld(UWorld *uworld)
Definition ApiUtils.cpp:9
ApiUtils & operator=(const ApiUtils &)=delete
void SetShooterGameMode(AShooterGameMode *shooter_game_mode)
Definition ApiUtils.cpp:21
std::unordered_map< uint64, AShooterPlayerController * > steam_id_map_
Definition ApiUtils.h:38
UShooterCheatManager * GetCheatManager() const override
Returns a point to URCON CheatManager.
Definition ApiUtils.cpp:93
UWorld * u_world_
Definition ApiUtils.h:34
ApiUtils(ApiUtils &&)=delete
AShooterGameMode * shooter_game_mode_
Definition ApiUtils.h:35
AShooterGameMode * GetShooterGameMode() const override
Returns a pointer to AShooterGameMode.
Definition ApiUtils.cpp:26
void RemovePlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:62
UShooterCheatManager * cheatmanager_
Definition ApiUtils.h:37
void SetPlayerController(AShooterPlayerController *player_controller)
Definition ApiUtils.cpp:49
ServerStatus GetStatus() const override
Returns the current server status.
Definition ApiUtils.cpp:38
ServerStatus status_
Definition ApiUtils.h:36
AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const override
Definition ApiUtils.cpp:75
~ApiUtils() override=default
void SetStatus(ServerStatus status)
Definition ApiUtils.cpp:33
UWorld * GetWorld() const override
Returns a pointer to UWorld.
Definition ApiUtils.cpp:14
ApiUtils(const ApiUtils &)=delete
static FString GetSteamName(AController *player_controller)
Returns the steam name of player.
static FORCEINLINE FString GetItemBlueprint(UPrimalItem *item)
Returns blueprint from UPrimalItem.
static FVector GetPosition(APlayerController *player_controller)
Returns the position of a player.
uint64 GetSteamIDForPlayerID(int player_id) const
static FORCEINLINE FString GetClassBlueprint(UClass *the_class)
Returns blueprint path from any UClass.
void SendServerMessageToAll(FLinearColor msg_color, const T *msg, Args &&... args)
Sends server message to all players. Using fmt::format.
virtual UShooterCheatManager * GetCheatManager() const =0
Returns a point to URCON CheatManager.
UPrimalGameData * GetGameData()
Returns pointer to Primal Game Data.
static bool IsRidingDino(AShooterPlayerController *player_controller)
Returns true if character is riding a dino, false otherwise.
AShooterGameState * GetGameState()
Get Shooter Game State.
virtual ~IApiUtils()=default
AShooterPlayerController * FindPlayerFromSteamName(const FString &steam_name) const
Finds player from the given steam name.
static UShooterCheatManager * GetCheatManagerByPC(AShooterPlayerController *SPC)
Get UShooterCheatManager* of player controller.
static uint64 GetPlayerID(AController *controller)
static bool IsPlayerDead(AShooterPlayerController *player)
Returns true if player is dead, false otherwise.
void SendNotificationToAll(FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
Sends notification (on-screen message) to all players. Using fmt::format.
APrimalDinoCharacter * SpawnDino(AShooterPlayerController *player, FString blueprint, FVector *location, int lvl, bool force_tame, bool neutered) const
Spawns a dino near player or at specific coordinates.
TArray< AShooterPlayerController * > FindPlayerFromCharacterName(const FString &character_name, ESearchCase::Type search, bool full_match) const
Finds all matching players from the given character name.
static FORCEINLINE FString GetBlueprint(UObjectBase *object)
Returns blueprint path from any UObject.
static FString GetCharacterName(AShooterPlayerController *player_controller, bool include_first_name=true, bool include_last_name=true)
Returns the character name of player.
TArray< AActor * > GetAllActorsInRange(FVector location, float radius, EServerOctreeGroup::Type ActorType)
Gets all actors in radius at location.
void SendChatMessageToAll(const FString &sender_name, const T *msg, Args &&... args)
Sends chat message to all players. Using fmt::format.
TArray< AActor * > GetAllActorsInRange(FVector location, float radius, EServerOctreeGroup::Type ActorType, TArray< AActor * > ignores)
Gets all actors in radius at location, with ignore actors.
virtual AShooterGameMode * GetShooterGameMode() const =0
Returns a pointer to AShooterGameMode.
static uint64 GetSteamIdFromController(AController *controller)
Returns Steam ID from player controller.
virtual UWorld * GetWorld() const =0
Returns a pointer to UWorld.
static bool TeleportToPos(AShooterPlayerController *player_controller, const FVector &pos)
Teleports player to the given position.
void SendNotification(AShooterPlayerController *player_controller, FLinearColor color, float display_scale, float display_time, UTexture2D *icon, const T *msg, Args &&... args)
Sends notification (on-screen message) to the specific player. Using fmt::format.
static uint64 GetPlayerID(APrimalCharacter *character)
virtual AShooterPlayerController * FindPlayerFromSteamId_Internal(uint64 steam_id) const =0
AShooterPlayerController * FindControllerFromCharacter(AShooterCharacter *character) const
Finds player controller from the given player character.
static APrimalDinoCharacter * GetRidingDino(AShooterPlayerController *player_controller)
Returns the dino the character is riding.
static FString GetIPAddress(AShooterPlayerController *player_controller)
Returns IP address of player.
AShooterPlayerController * FindPlayerFromSteamId(uint64 steam_id) const
Finds player from the given steam id.
virtual ServerStatus GetStatus() const =0
Returns the current server status.
void SendServerMessage(AShooterPlayerController *player_controller, FLinearColor msg_color, const T *msg, Args &&... args)
Sends server message to the specific player. Using fmt::format.
static std::optional< FString > TeleportToPlayer(AShooterPlayerController *me, AShooterPlayerController *him, bool check_for_dino, float max_dist)
Teleport one player to another.
static int GetInventoryItemCount(AShooterPlayerController *player_controller, const FString &item_name)
Counts a specific items quantity.
void SendChatMessage(AShooterPlayerController *player_controller, const FString &sender_name, const T *msg, Args &&... args)
Sends chat message to the specific player. Using fmt::format.
FString Replace(const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
Definition FString.h:2766
FORCEINLINE bool FindChar(TCHAR InChar, int32 &Index) const
Definition FString.h:1169
FORCEINLINE FString Mid(int32 Start, int32 Count=INT_MAX) const
Definition FString.h:1099
FORCEINLINE friend bool operator==(const FString &Lhs, const FString &Rhs)
Definition FString.h:994
FORCEINLINE bool FindLastChar(TCHAR InChar, int32 &Index) const
Definition FString.h:1181
FORCEINLINE FString(const CharType *Src, typename TEnableIf< TIsCharType< CharType >::Value >::Type *Dummy=nullptr)
Definition FString.h:98
FORCEINLINE friend FString operator+(const TCHAR *Lhs, FString &&Rhs)
Definition FString.h:687
bool StartsWith(const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
Definition FString.h:2143
FORCEINLINE bool Equals(const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
Definition FString.h:1221
bool EndsWith(const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
Definition FString.h:2155
FORCEINLINE bool IsEmpty() const
Definition FString.h:241
FORCEINLINE int32 Len() const
Definition FString.h:1069
FORCEINLINE friend FString operator+(FString &&Lhs, const TCHAR *Rhs)
Definition FString.h:713
FORCEINLINE int32 Add(const ElementType &Item)
Definition TArray.h:1564
int32 Remove(const ElementType &Item)
Definition TArray.h:1709
FORCEINLINE ObjectType * Get() const
IApiUtils & GetApiUtils()
Definition ApiUtils.cpp:99
@ CaseSensitive
Definition FString.h:28
Definition json.hpp:4518
FVector & DefaultActorLocationField()
Definition Actor.h:920
int & TargetingTeamField()
Definition Actor.h:902
USceneComponent * RootComponentField()
Definition Actor.h:911
APlayerState * PlayerStateField()
Definition Actor.h:2062
UCheatManager * CheatManagerField()
Definition Actor.h:2133
FString * GetPlayerNetworkAddress(FString *result)
Definition Actor.h:2292
FUniqueNetIdRepl & UniqueIdField()
Definition Actor.h:1782
FString & PlayerNameField()
Definition Actor.h:1776
bool TeleportTo(FVector *DestLocation, FRotator *DestRotation, bool bIsATest, bool bNoCheck)
Definition Actor.h:4554
UPrimalInventoryComponent * MyInventoryComponentField()
Definition Actor.h:3798
bool IsDead()
Definition Actor.h:4360
void DoNeuter_Implementation()
Definition Actor.h:7051
static UClass * GetPrivateStaticClass()
Definition Actor.h:6963
void TameDino(AShooterPlayerController *ForPC, bool bIgnoreMaxTameLimit, int OverrideTamingTeamID)
Definition Actor.h:7328
int & TamingTeamIDField()
Definition Actor.h:6194
FString & TamerStringField()
Definition Actor.h:6057
int & AbsoluteBaseLevelField()
Definition Actor.h:6324
UPrimalPlayerData * GetPlayerData()
Definition Actor.h:5166
APrimalDinoCharacter * GetRidingDino()
Definition Actor.h:5159
unsigned __int64 GetSteamIDForPlayerID(int playerDataID)
Definition GameMode.h:1620
void AddPlayerID(int playerDataID, unsigned __int64 netUniqueID)
Definition GameMode.h:1534
__int64 & LinkedPlayerIDField()
Definition Actor.h:2504
void SetPlayerPos(float X, float Y, float Z)
Definition Actor.h:3202
AActor * SpawnActor(FString *blueprintPath, float spawnDistance, float spawnYOffset, float ZOffset, bool bDoDeferBeginPlay)
Definition Actor.h:3222
AShooterCharacter * GetPlayerCharacter()
Definition Actor.h:2916
FString * GetPlayerName(FString *result)
Definition Actor.h:1902
void SetTribeTamingDinoSettings(APrimalDinoCharacter *aDinoChar)
Definition Actor.h:1986
DWORD64 offset
Definition Base.h:674
DWORD bit_position
Definition Base.h:675
ULONGLONG length
Definition Base.h:677
ULONGLONG num_bits
Definition Base.h:676
Definition Base.h:181
Definition Actor.h:10035
ECanvasAllowModes
Definition Base.h:316
@ Allow_DeleteOnRender
Definition Base.h:318
@ Allow_Flush
Definition Base.h:317
EElementType
Definition Base.h:309
@ ET_MAX
Definition Base.h:312
@ ET_Line
Definition Base.h:310
@ ET_Triangle
Definition Base.h:311
Definition Other.h:244
Definition Actor.h:349
static FORCEINLINE double CeilToDouble(double F)
static FORCEINLINE float CeilToFloat(float F)
static FORCEINLINE float Fractional(float Value)
static FORCEINLINE float RoundToFloat(float F)
static CONSTEXPR FORCEINLINE double FloatSelect(double Comparand, double ValueGEZero, double ValueLTZero)
static FORCEINLINE float InvSqrtEst(float F)
static FORCEINLINE float Acos(float Value)
static FORCEINLINE uint32 ReverseMortonCode3(uint32 x)
static FORCEINLINE uint32 ReverseMortonCode2(uint32 x)
static FORCEINLINE int32 CeilToInt(float F)
static FORCEINLINE uint32 CountTrailingZeros(uint32 Value)
static FORCEINLINE T Max(const TArray< T > &Values, int32 *MaxIndex=NULL)
static FORCEINLINE T Min(const TArray< T > &Values, int32 *MinIndex=NULL)
static FORCEINLINE float InvSqrt(float F)
static FORCEINLINE float Modf(const float InValue, float *OutIntPart)
static CONSTEXPR FORCEINLINE T Min(const T A, const T B)
static FORCEINLINE float FRand()
static FORCEINLINE bool IsNaN(float A)
static FORCEINLINE double RoundToDouble(double F)
static FORCEINLINE float Sinh(float Value)
static CONSTEXPR FORCEINLINE float FloatSelect(float Comparand, float ValueGEZero, float ValueLTZero)
static FORCEINLINE uint32 CountLeadingZeros(uint32 Value)
static FORCEINLINE float Sqrt(float Value)
static FORCEINLINE float Exp(float Value)
static FORCEINLINE float FloorToFloat(float F)
static FORCEINLINE float LogX(float Base, float Value)
static FORCEINLINE double FloorToDouble(double F)
static FORCEINLINE float Atan(float Value)
static FORCEINLINE uint64 CeilLogTwo64(uint64 Arg)
static FORCEINLINE float Asin(float Value)
static FORCEINLINE int32 RoundToInt(float F)
static FORCEINLINE double Modf(const double InValue, double *OutIntPart)
static FORCEINLINE float Sin(float Value)
static FORCEINLINE float Frac(float Value)
static FORCEINLINE float Tan(float Value)
static FORCEINLINE uint32 RoundUpToPowerOfTwo(uint32 Arg)
static FORCEINLINE bool IsNegativeFloat(const float &A)
static CONSTEXPR FORCEINLINE T Max(const T A, const T B)
static FORCEINLINE bool IsFinite(float A)
static FORCEINLINE float Fmod(float X, float Y)
static FORCEINLINE uint32 MortonCode3(uint32 x)
static CONSTEXPR FORCEINLINE int32 TruncToInt(float F)
static FORCEINLINE float Cos(float Value)
static FORCEINLINE bool IsNegativeDouble(const double &A)
static CONSTEXPR FORCEINLINE float TruncToFloat(float F)
static FORCEINLINE uint64 CountLeadingZeros64(uint64 Value)
static FORCEINLINE int32 Rand()
static FORCEINLINE uint64 FloorLog2_64(uint64 Value)
static FORCEINLINE float Log2(float Value)
static FORCEINLINE uint32 CeilLogTwo(uint32 Arg)
static CONSTEXPR FORCEINLINE T Abs(const T A)
static CONSTEXPR FORCEINLINE T Sign(const T A)
static FORCEINLINE uint32 MortonCode2(uint32 x)
static FORCEINLINE float Pow(float A, float B)
static FORCEINLINE int32 CountBits(uint64 Bits)
static FORCEINLINE uint32 FloorLog2(uint32 Value)
static FORCEINLINE float Exp2(float Value)
static FORCEINLINE void RandInit(int32 Seed)
static FORCEINLINE int32 FloorToInt(float F)
static FORCEINLINE float Loge(float Value)
unsigned long long uint64
Definition BasicTypes.h:55
unsigned char uint8
Definition BasicTypes.h:52
decltype(nullptr) TYPE_OF_NULLPTR
Definition BasicTypes.h:77
signed short int int16
Definition BasicTypes.h:59
SelectIntPointerType< int32, int64, sizeof(void *)>::TIntPointe PTRINT)
Definition BasicTypes.h:72
unsigned short int uint16
Definition BasicTypes.h:53
unsigned int uint32
Definition BasicTypes.h:54
SelectIntPointerType< uint32, uint64, sizeof(void *)>::TIntPointe UPTRINT)
Definition BasicTypes.h:71
signed long long int64
Definition BasicTypes.h:61
Definition Actor.h:9443
int32 X
Definition IntPoint.h:17
int32 Y
Definition IntPoint.h:20
int32 Z
Definition IntVector.h:25
int32 Y
Definition IntVector.h:22
FIntVector(FVector InVector)
Definition Vector.h:936
int32 X
Definition IntVector.h:19
Definition Inventory.h:50
Definition Base.h:120
Definition Base.h:216
float G
Definition Color.h:36
float B
Definition Color.h:37
float R
Definition Color.h:35
static float UnwindRadians(float A)
static T InterpCircularOut(const T &A, const T &B, float Alpha)
static T InterpEaseInOut(const T &A, const T &B, float Alpha, float Exp)
static T InterpExpoInOut(const T &A, const T &B, float Alpha)
static FORCEINLINE double RoundToNegativeInfinity(double F)
static FORCEINLINE int32 RandRange(int32 Min, int32 Max)
static T BiLerp(const T &P00, const T &P10, const T &P01, const T &P11, const U &FracX, const U &FracY)
static T LerpStable(const T &A, const T &B, double Alpha)
static FORCEINLINE float RandRange(float InMin, float InMax)
static float UnwindDegrees(float A)
static FORCEINLINE float FastAsin(float Value)
static FORCEINLINE float RoundToNegativeInfinity(float F)
static float FindDeltaAngleRadians(float A1, float A2)
static U CubicCRSplineInterp(const U &P0, const U &P1, const U &P2, const U &P3, const float T0, const float T1, const float T2, const float T3, const float T)
static T InterpCircularInOut(const T &A, const T &B, float Alpha)
static float SmoothStep(float A, float B, float X)
static FORCEINLINE T Clamp(const T X, const T Min, const T Max)
static FORCEINLINE float RoundFromZero(float F)
static T CubicInterpSecondDerivative(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
static int32 LeastCommonMultiplier(int32 a, int32 b)
static FORCEINLINE T Square(const T A)
static T Lerp(const T &A, const T &B, const U &Alpha)
static FORCEINLINE T Max3(const T A, const T B, const T C)
static T InterpEaseOut(const T &A, const T &B, float Alpha, float Exp)
static FORCEINLINE T DivideAndRoundDown(T Dividend, T Divisor)
static FORCEINLINE float RoundToZero(float F)
static FORCEINLINE int32 RandHelper(int32 A)
static int32 GreatestCommonDivisor(int32 a, int32 b)
static T InterpSinOut(const T &A, const T &B, float Alpha)
static T InterpEaseIn(const T &A, const T &B, float Alpha, float Exp)
static FORCEINLINE float RoundToPositiveInfinity(float F)
static FORCEINLINE void PolarToCartesian(const float Rad, const float Ang, float &OutX, float &OutY)
static FORCEINLINE float FRandRange(float InMin, float InMax)
static float FindDeltaAngleDegrees(float A1, float A2)
static FORCEINLINE bool IsPowerOfTwo(T Value)
static FORCEINLINE auto RadiansToDegrees(T const &RadVal) -> decltype(RadVal *(180.f/PI))
static T InterpCircularIn(const T &A, const T &B, float Alpha)
static T InterpStep(const T &A, const T &B, float Alpha, int32 Steps)
static FORCEINLINE T DivideAndRoundUp(T Dividend, T Divisor)
static T InterpExpoOut(const T &A, const T &B, float Alpha)
static T CubicInterpDerivative(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
static T CubicInterp(const T &P0, const T &T0, const T &P1, const T &T1, const U &A)
static FORCEINLINE double RoundToPositiveInfinity(double F)
static FORCEINLINE void SinCos(float *ScalarSin, float *ScalarCos, float Value)
static FORCEINLINE T Min3(const T A, const T B, const T C)
static FORCEINLINE auto DegreesToRadians(T const &DegVal) -> decltype(DegVal *(PI/180.f))
static T LerpStable(const T &A, const T &B, float Alpha)
static T InterpExpoIn(const T &A, const T &B, float Alpha)
static FORCEINLINE double RoundToZero(double F)
static T InterpSinIn(const T &A, const T &B, float Alpha)
static FORCEINLINE double RoundFromZero(double F)
static T InterpSinInOut(const T &A, const T &B, float Alpha)
static FORCEINLINE bool RandBool()
Definition Other.h:87
Definition Actor.h:9709
Definition Actor.h:9701
Definition Base.h:191
unsigned __int64 & PlayerDataIDField()
Definition Actor.h:5466
Definition Base.h:360
FORCEINLINE FRotator(float InPitch, float InYaw, float InRoll)
Definition Rotator.h:375
TSharedPtr< FUniqueNetId > UniqueNetId
Definition Actor.h:190
float Y
Definition Vector2D.h:22
float X
Definition Vector2D.h:19
FORCEINLINE FVector operator+(float Bias) const
Definition Vector.h:1145
FORCEINLINE FVector operator*=(float Scale)
Definition Vector.h:1210
bool operator!=(const FVector &V) const
Definition Vector.h:1176
FORCEINLINE FVector()
Definition Vector.h:41
static float Triple(const FVector &X, const FVector &Y, const FVector &Z)
Definition Vector.h:1044
static bool Orthogonal(const FVector &Normal1, const FVector &Normal2, float OrthogonalCosineThreshold=THRESH_NORMALS_ARE_ORTHOGONAL)
Definition Vector.h:1031
static bool Parallel(const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
Definition Vector.h:1019
FORCEINLINE FVector operator-(const FVector &V) const
Definition Vector.h:1135
FORCEINLINE FVector operator-=(const FVector &V)
Definition Vector.h:1204
FVector GetSafeNormal(float Tolerance=SMALL_NUMBER) const
Definition Vector.h:1520
static FVector VectorPlaneProject(const FVector &V, const FVector &PlaneNormal)
Definition Vector.h:1014
FVector operator/=(const FVector &V)
Definition Vector.h:1229
static bool PointsAreSame(const FVector &P, const FVector &Q)
Definition Vector.h:968
FORCEINLINE FVector(float InF)
Definition Vector.h:1062
FORCEINLINE FVector operator+=(const FVector &V)
Definition Vector.h:1198
FORCEINLINE FVector operator-() const
Definition Vector.h:1192
FORCEINLINE FVector operator^(const FVector &V) const
Definition Vector.h:1105
bool IsUniform(float Tolerance=KINDA_SMALL_NUMBER) const
Definition Vector.h:1510
FORCEINLINE FVector operator-(float Bias) const
Definition Vector.h:1140
FRotator ToOrientationRotator() const
FVector(const FLinearColor &InColor)
Definition Vector.h:1072
FVector MirrorByVector(const FVector &MirrorNormal) const
Definition Vector.h:1515
FVector Reciprocal() const
Definition Vector.h:1476
static FORCEINLINE float DistSquaredXY(const FVector &V1, const FVector &V2)
Definition Vector.h:1627
float X
Definition Vector.h:27
static bool PointsAreNear(const FVector &Point1, const FVector &Point2, float Dist)
Definition Vector.h:987
bool InitFromString(const FString &InSourceString)
static FORCEINLINE float DotProduct(const FVector &A, const FVector &B)
Definition Vector.h:1125
float Y
Definition Vector.h:30
FVector ComponentMax(const FVector &Other) const
Definition Vector.h:1301
void ToDirectionAndLength(FVector &OutDir, float &OutLength) const
Definition Vector.h:1361
FORCEINLINE float operator|(const FVector &V) const
Definition Vector.h:1120
FRotator Rotation() const
FORCEINLINE FVector GetUnsafeNormal() const
Definition Vector.h:1392
FVector GetClampedToMaxSize(float MaxSize) const
Definition Vector.h:1428
FORCEINLINE FVector operator*(const FVector &V) const
Definition Vector.h:1161
void FindBestAxisVectors(FVector &Axis1, FVector &Axis2) const
float Size2D() const
Definition Vector.h:1321
FVector(FIntVector InVector)
Definition Vector.h:1077
static const FVector ZeroVector
Definition Vector.h:38
float SizeSquared2D() const
Definition Vector.h:1326
FVector GetSafeNormal2D(float Tolerance=SMALL_NUMBER) const
Definition Vector.h:1537
float & Component(int32 Index)
Definition Vector.h:1466
static FORCEINLINE float BoxPushOut(const FVector &Normal, const FVector &Size)
Definition Vector.h:1632
FVector operator/(float Scale) const
Definition Vector.h:1155
static FVector RadiansToDegrees(const FVector &RadVector)
Definition Vector.h:1052
float GetAbsMin() const
Definition Vector.h:1291
FVector2D UnitCartesianToSpherical() const
bool IsZero() const
Definition Vector.h:1339
FVector GetAbs() const
Definition Vector.h:1306
static float PointPlaneDist(const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
Definition Vector.h:997
FVector BoundToCube(float Radius) const
Definition Vector.h:1398
static FORCEINLINE float DistSquared(const FVector &V1, const FVector &V2)
Definition Vector.h:1622
FORCEINLINE FVector GetSignVector() const
Definition Vector.h:1376
FORCEINLINE FVector operator/(const FVector &V) const
Definition Vector.h:1166
static FORCEINLINE float Dist2D(const FVector &V1, const FVector &V2)
Definition Vector.h:751
FVector ComponentMin(const FVector &Other) const
Definition Vector.h:1296
float Size() const
Definition Vector.h:1311
float GetMin() const
Definition Vector.h:1286
float Z
Definition Vector.h:33
FString ToString() const
Definition Vector.h:1637
float & operator[](int32 Index)
Definition Vector.h:1235
static FORCEINLINE float Dist(const FVector &V1, const FVector &V2)
Definition Vector.h:1612
FVector GridSnap(const float &GridSz) const
static bool Coincident(const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
Definition Vector.h:1025
FVector Projection() const
Definition Vector.h:1386
static bool Coplanar(const FVector &Base1, const FVector &Normal1, const FVector &Base2, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
Definition Vector.h:1037
FORCEINLINE FVector ProjectOnTo(const FVector &A) const
Definition Vector.h:1572
static FVector PointPlaneProject(const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
Definition Vector.h:1007
bool IsNormalized() const
Definition Vector.h:1356
FORCEINLINE FVector ProjectOnToNormal(const FVector &Normal) const
Definition Vector.h:1577
static FVector PointPlaneProject(const FVector &Point, const FVector &A, const FVector &B, const FVector &C)
void UnwindEuler()
bool Equals(const FVector &V, float Tolerance=KINDA_SMALL_NUMBER) const
Definition Vector.h:1181
FQuat ToOrientationQuat() const
bool operator==(const FVector &V) const
Definition Vector.h:1171
FVector GetClampedToSize2D(float Min, float Max) const
Definition Vector.h:1418
float SizeSquared() const
Definition Vector.h:1316
float operator[](int32 Index) const
Definition Vector.h:1252
FVector GetClampedToSize(float Min, float Max) const
Definition Vector.h:1408
float GetAbsMax() const
Definition Vector.h:1281
static FORCEINLINE float DistSquared2D(const FVector &V1, const FVector &V2)
Definition Vector.h:770
FVector operator/=(float V)
Definition Vector.h:1216
float GetMax() const
Definition Vector.h:1276
FVector(FIntPoint A)
Definition Vector.h:1082
static FORCEINLINE FVector CrossProduct(const FVector &A, const FVector &B)
Definition Vector.h:1115
FVector operator*=(const FVector &V)
Definition Vector.h:1223
void Set(float InX, float InY, float InZ)
Definition Vector.h:1269
FORCEINLINE FVector operator+(const FVector &V) const
Definition Vector.h:1130
FORCEINLINE FVector operator*(float Scale) const
Definition Vector.h:1150
static FVector DegreesToRadians(const FVector &DegVector)
Definition Vector.h:1057
FORCEINLINE CONSTEXPR FVector(float InX, float InY, float InZ)
Definition Vector.h:1067
FORCEINLINE float CosineAngle2D(FVector B) const
Definition Vector.h:1562
bool AllComponentsEqual(float Tolerance=KINDA_SMALL_NUMBER) const
Definition Vector.h:1186
FVector GetClampedToMaxSize2D(float MaxSize) const
Definition Vector.h:1447
static FORCEINLINE float DistXY(const FVector &V1, const FVector &V2)
Definition Vector.h:1617
static void CreateOrthonormalBasis(FVector &XAxis, FVector &YAxis, FVector &ZAxis)
FORCEINLINE bool IsUnit(float LengthSquaredTolerance=KINDA_SMALL_NUMBER) const
Definition Vector.h:1590
FVector RotateAngleAxis(const float AngleDeg, const FVector &Axis) const
Definition Vector.h:942
bool ContainsNaN() const
Definition Vector.h:1583
float HeadingAngle() const
Definition Vector.h:1595
static float EvaluateBezier(const FVector *ControlPoints, int32 NumPoints, TArray< FVector > &OutPoints)
float Component(int32 Index) const
Definition Vector.h:1471
FORCEINLINE FVector(const FVector2D V, float InZ)
Definition Vector.h:931
bool IsNearlyZero(float Tolerance=KINDA_SMALL_NUMBER) const
Definition Vector.h:1331
FORCEINLINE FVector(EForceInit)
Definition Vector.h:1087
static FORCEINLINE float Distance(const FVector &V1, const FVector &V2)
Definition Vector.h:741
bool Normalize(float Tolerance=SMALL_NUMBER)
Definition Vector.h:1344
Definition UE.h:623
T * Get(bool bEvenIfPendingKill=false)
Definition UE.h:172
FORCEINLINE T * operator->()
Definition UE.h:167
Definition UE.h:399
UObject * GetDefaultObject(bool bCreateIfNeeded)
Definition UE.h:415
Definition UE.h:343
Definition Base.h:215
UClass * ClassField()
Definition UE.h:277
FString * GetFullName(FString *result, UObject *StopOuter)
Definition UE.h:296
bool IsA(UClass *SomeBase)
Definition UE.h:299
Definition UE.h:306
Definition Other.h:211
UPrimalGameData * PrimalGameDataOverrideField()
Definition GameMode.h:878
UPrimalGameData * PrimalGameDataField()
Definition GameMode.h:877
FPrimalPlayerDataStruct * MyDataField()
Definition Actor.h:5507
FVector * GetWorldLocation(FVector *result)
Definition Actor.h:523
Definition UE.h:355
Definition UE.h:817
static TArray< AActor * > * ServerOctreeOverlapActors(TArray< AActor * > *result, UWorld *theWorld, FVector AtLoc, float Radius, EServerOctreeGroup::Type OctreeType, bool bForceActorLocationDistanceCheck)
Definition Other.h:410
TArray< TAutoWeakObjectPtr< APlayerController > > & PlayerControllerListField()
Definition GameMode.h:425
APlayerController * GetFirstPlayerController()
Definition GameMode.h:538
AGameState * GameStateField()
Definition GameMode.h:409