add FRotator overloads for every method that accepts or returns FQuat and some other bug fixes
This commit is contained in:
@@ -374,7 +374,8 @@ public:
|
||||
return MoveTemp(ImplArray);
|
||||
}
|
||||
|
||||
template<typename T1, typename T2, const T2&(T1::*ToUnderlyingTypeMethod)() const, typename S, TArray<T1> S::*InnerArray>
|
||||
template<typename T1, typename T2, const T2&(T1::*ToUnderlyingTypeMethod)() const, typename S, TArray<T1> S::*
|
||||
InnerArray>
|
||||
static TArray<TArray<T2>> ToImplType(const TArray<S>& Array)
|
||||
{
|
||||
TArray<TArray<T2>> ImplArray;
|
||||
@@ -388,7 +389,8 @@ public:
|
||||
return MoveTemp(ImplArray);
|
||||
}
|
||||
|
||||
template<typename T1, typename T2, const T2&(T1::*ToUnderlyingTypeMethod)() const, typename S, TArray<T1*> S::*InnerArray>
|
||||
template<typename T1, typename T2, const T2&(T1::*ToUnderlyingTypeMethod)() const, typename S, TArray<T1*> S::*
|
||||
InnerArray>
|
||||
static TArray<TArray<T2>> ToImplType(const TArray<S>& Array)
|
||||
{
|
||||
TArray<TArray<T2>> ImplArray;
|
||||
@@ -429,7 +431,6 @@ public:
|
||||
return MoveTemp(BPNestedArray);
|
||||
}
|
||||
|
||||
|
||||
template<typename T, typename S>
|
||||
static TArray<S> ToBPNestedArray(const TArray<TArray<T*>>& NestedArray)
|
||||
{
|
||||
@@ -444,6 +445,94 @@ public:
|
||||
return MoveTemp(BPNestedArray);
|
||||
}
|
||||
|
||||
static TArray<FRotator> QuatsToRotators(const TArray<FQuat>& QuatsArray);
|
||||
static TArray<TArray<FRotator>> QuatsToRotators(const TArray<TArray<FQuat>>& QuatsNestedArray);
|
||||
|
||||
template<typename S, TArray<FQuat> S::*InnerArray>
|
||||
static TArray<TArray<FRotator>> QuatsToRotators(const TArray<S>& QuatsNestedArray)
|
||||
{
|
||||
TArray<TArray<FRotator>> RotatorsNestedArray;
|
||||
|
||||
for (const S& BPQuatsInnerArrayContainer: QuatsNestedArray)
|
||||
{
|
||||
RotatorsNestedArray.Add(QuatsToRotators(BPQuatsInnerArrayContainer.*InnerArray));
|
||||
}
|
||||
|
||||
return MoveTemp(RotatorsNestedArray);
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
static TArray<S> QuatsToRotators(const TArray<TArray<FQuat>>& QuatsNestedArray)
|
||||
{
|
||||
TArray<S> BPRotatorsNestedArray;
|
||||
|
||||
for (const TArray<FQuat>& QuatsInnerArray: QuatsNestedArray)
|
||||
{
|
||||
S BPRotatorsInnerArrayContainer{QuatsToRotators(QuatsInnerArray)};
|
||||
BPRotatorsNestedArray.Add(MoveTemp(BPRotatorsInnerArrayContainer));
|
||||
}
|
||||
|
||||
return MoveTemp(BPRotatorsNestedArray);
|
||||
}
|
||||
|
||||
template<typename Q, typename R, TArray<FQuat> Q::*InnerArray>
|
||||
static TArray<R> QuatsToRotators(const TArray<Q>& QuatsNestedArray)
|
||||
{
|
||||
TArray<R> BPRotatorsNestedArray;
|
||||
|
||||
for (const Q& QuatsInnerArrayContainer: QuatsNestedArray)
|
||||
{
|
||||
R BPRotatorsInnerArrayContainer{QuatsToRotators(QuatsInnerArrayContainer.*InnerArray)};
|
||||
BPRotatorsNestedArray.Add(MoveTemp(BPRotatorsInnerArrayContainer));
|
||||
}
|
||||
|
||||
return MoveTemp(BPRotatorsNestedArray);
|
||||
}
|
||||
|
||||
static TArray<FQuat> RotatorsToQuats(const TArray<FRotator>& RotatorsArray);
|
||||
static TArray<TArray<FQuat>> RotatorsToQuats(const TArray<TArray<FRotator>>& RotatorsNestedArray);
|
||||
|
||||
template<typename S, TArray<FRotator> S::*InnerArray>
|
||||
static TArray<TArray<FQuat>> RotatorsToQuats(const TArray<S>& RotatorsNestedArray)
|
||||
{
|
||||
TArray<TArray<FQuat>> QuatsNestedArray;
|
||||
|
||||
for (const S& BPRotatorsInnerArrayContainer: RotatorsNestedArray)
|
||||
{
|
||||
QuatsNestedArray.Add(RotatorsToQuats(BPRotatorsInnerArrayContainer.*InnerArray));
|
||||
}
|
||||
|
||||
return MoveTemp(QuatsNestedArray);
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
static TArray<S> RotatorsToQuats(const TArray<TArray<FRotator>>& RotatorsNestedArray)
|
||||
{
|
||||
TArray<S> BPQuatsNestedArray;
|
||||
|
||||
for (const TArray<FRotator>& RotatorsInnerArray: RotatorsNestedArray)
|
||||
{
|
||||
S BPQuatsInnerArrayContainer{RotatorsToQuats(RotatorsInnerArray)};
|
||||
BPQuatsNestedArray.Add(MoveTemp(BPQuatsInnerArrayContainer));
|
||||
}
|
||||
|
||||
return MoveTemp(BPQuatsNestedArray);
|
||||
}
|
||||
|
||||
template<typename Q, typename R, TArray<FRotator> Q::*InnerArray>
|
||||
static TArray<R> RotatorsToQuats(const TArray<Q>& RotatorsNestedArray)
|
||||
{
|
||||
TArray<R> BPQuatsNestedArray;
|
||||
|
||||
for (const Q& RotatorsInnerArrayContainer: RotatorsNestedArray)
|
||||
{
|
||||
R BPQuatsInnerArrayContainer{RotatorsToQuats(RotatorsInnerArrayContainer.*InnerArray)};
|
||||
BPQuatsNestedArray.Add(MoveTemp(BPQuatsInnerArrayContainer));
|
||||
}
|
||||
|
||||
return MoveTemp(BPQuatsNestedArray);
|
||||
}
|
||||
|
||||
public:
|
||||
FSGArrayUtils() = delete;
|
||||
virtual ~FSGArrayUtils() = delete;
|
||||
|
||||
Reference in New Issue
Block a user