UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ArrayFaceND.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4// HEADER_UNIT_SKIP - Bad include. Some headers are in Chaos while this is in ChaosCore
5
6#include "Chaos/ArrayND.h"
7#include "Chaos/UniformGrid.h"
8#include "Chaos/Vector.h"
9
10namespace Chaos
11{
12template<class T, int d>
14{
16 {
17 MArray.SetNum(d); // @todo(mlentine): This should not be needed
18 const auto& Counts = Grid.Counts();
19 for (int32 i = 0; i < d; ++i)
20 {
21 MArray[i] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(i));
22 }
23 }
24 TArrayFaceND(const TVec3<int32>& Counts)
25 {
26 MArray.SetNum(d); // @todo(mlentine): This should not be needed
27 for (int32 i = 0; i < d; ++i)
28 {
29 MArray[i] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(i));
30 }
31 }
32 TArrayFaceND(const TArrayFaceND<T, d>& Other) = delete;
34 : MArray(MoveTemp(Other.MArray)) {}
35
36 private:
38};
39
40template<class T>
41class TArrayFaceND<T, 3>
42{
43 public:
45 {
46 MArray.SetNum(3); // @todo(mlentine): This should not be needed
47 const auto& Counts = Grid.Counts();
48 MArray[0] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(0));
49 MArray[1] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(1));
50 MArray[2] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(2));
51 }
53 {
54 MArray.SetNum(3); // @todo(mlentine): This should not be needed
55 MArray[0] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(0));
56 MArray[1] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(1));
57 MArray[2] = TArrayND<T, 3>(Counts + TVec3<int32>::AxisVector(2));
58 }
63 {
64 return TArrayFaceND(MArray);
65 }
66 T& operator()(const Pair<int32, TVec3<int32>>& Index) { return MArray[Index.First](Index.Second[0], Index.Second[1], Index.Second[2]); }
67 const T& operator()(const Pair<int32, TVec3<int32>>& Index) const { return MArray[Index.First](Index.Second[0], Index.Second[1], Index.Second[2]); }
68 T& operator()(const int32 Axis, const int32& x, const int32& y, const int32& z) { return MArray[Axis](x, y, z); }
69 const T& operator()(const int32 Axis, const int32& x, const int32& y, const int32& z) const { return MArray[Axis](x, y, z); }
70 void Fill(const T& Scalar)
71 {
72 MArray[0].Fill(Scalar);
73 MArray[1].Fill(Scalar);
74 MArray[2].Fill(Scalar);
75 }
76 const TArrayND<T, 3>& GetComponent(const int32 Axis) const { return MArray[Axis]; }
77 TArrayND<T, 3>& GetComponent(const int32 Axis) { return MArray[Axis]; }
78
79 private:
81 {
82 MArray.SetNum(3); // @todo(mlentine): This should not be needed
83 MArray[0] = Array[0].Copy();
84 MArray[1] = Array[1].Copy();
85 MArray[2] = Array[2].Copy();
86 }
88};
89}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
TArrayND< T, 3 > & GetComponent(const int32 Axis)
Definition ArrayFaceND.h:77
TArrayFaceND(const TVec3< int32 > &Counts)
Definition ArrayFaceND.h:52
const TArrayND< T, 3 > & GetComponent(const int32 Axis) const
Definition ArrayFaceND.h:76
TArrayFaceND(TArrayFaceND< T, 3 > &&Other)
Definition ArrayFaceND.h:60
TArrayFaceND< T, 3 > Copy()
Definition ArrayFaceND.h:62
const T & operator()(const int32 Axis, const int32 &x, const int32 &y, const int32 &z) const
Definition ArrayFaceND.h:69
T & operator()(const int32 Axis, const int32 &x, const int32 &y, const int32 &z)
Definition ArrayFaceND.h:68
T & operator()(const Pair< int32, TVec3< int32 > > &Index)
Definition ArrayFaceND.h:66
TArrayFaceND(const TArrayFaceND< T, 3 > &Other)=delete
TArrayFaceND(const TUniformGrid< FReal, 3 > &Grid)
Definition ArrayFaceND.h:44
const T & operator()(const Pair< int32, TVec3< int32 > > &Index) const
Definition ArrayFaceND.h:67
void Fill(const T &Scalar)
Definition ArrayFaceND.h:70
Definition ArrayFaceND.h:14
Definition ArrayND.h:194
Definition UniformGrid.h:267
Definition Vector.h:1000
Definition Array.h:670
Definition ContainerAllocationPolicies.h:1276
Definition SkeletalMeshComponent.h:307
U16 Index
Definition radfft.cpp:71
Definition Pair.h:8