Hi, what I’m trying to achieve is creating a TArray of FVectors (named R_ijk) from the first element in a TArray of Existing FVectors (called TempState). TempState holds position FVectors and velocity FVectors so basically I’d like to create a separate TArray with just the Position information. Here is my code.
.cpp
void ASatellite::BeginPlay()
{
Super::BeginPlay();
FindSemiLatusRectum(SemiMajorAxis, Eccentricity);
TArray<float> temp = CreateNuArray();
TArray<FVector> TempState;
for (int i = 0; i < temp.Num(); i++)
{
TempState = COE2RV(p, Eccentricity, Inclination, RAAN, ArgOfPeriapsis,temp[i]);
R_ijk.Append(TempState[0]); // Here is where Im getting the error
V_ijk.Append(TempState[1]);
}
for (int i = 0; i < TempState.Num(); i++)
{
UE_LOG(LogTemp, Warning, TEXT("Final State Vector %s"), *TempState[i].ToString());
}
}
.h
// Final State Vectors in IJK frame
TArray<FVector> R_ijk;
TArray<FVector> V_ijk;
The error given is: "Severity Code Description Project File Line Suppression State
Error C2664 ‘void TArray<FVector,FDefaultAllocator>::Append(std::initializer_list)’: cannot convert argument 1 from ‘FVector’ to ‘std::initializer_list’ TableTopSat G:\UnrealProjects\TableTopSat\Source\TableTopSat\Satellite.cpp 30
"
Any help is really appreciated!