So as long as the empty method clears the array I know that the values have changed, but the change is not reflected in what I see. when I call my updating function It is the same or empty or gone
This is not the code I am intending to use, I gust want to get things working. I have tried different variations of this code and tried to do this in blueprints.
void AMainPawn::BeginPlay()
{
Super::BeginPlay();
Vertices.Empty();
UVs.Empty();
Triangles.Empty();
UVPos.Add(0);
UVPos.Add(0);
UVPos.Add(0);
int cnt = 0;
int xcnt = 0;
int ycnt = 0;
for (int i = 0; i < 120; i++) {
UVPos.Add(32);
xcnt++;
if (xcnt > 39) {
ycnt++;
xcnt = 0;
}
}
int32 chnums[18] = { 69, 110, 116, 101, 114, 32, 52, 32, 100, 105, 103, 105, 116, 32, 112, 105, 110, 58 };
for (int i = 0; i < 18; i++) {
int addv = chnums[i];
UVPos.Add(addv);
xcnt++;
if (xcnt > 39) {
ycnt++;
xcnt++;
}
}
while (ycnt < 26) {
while (xcnt < 40) {
UVPos.Add(32);
xcnt++;
}
ycnt++;
}
while (UVPos.Num() < 1200) UVPos.Add(32);
float x1 = 0, x2 = 0, y1 = 0, y2 = 0;
int tcnt = 0;
for (float y = .807844; y > 0; y -= 0.03231376) {
for (float x = -0.546391; x < 0.546; x += 0.02731955) {
float yz = y - 0.03231376;
float xp = x + 0.02731955;
Vertices.Add(FVector(0, x * 100, yz * 100));
Vertices.Add(FVector(0, x * 100, y * 100));
Vertices.Add(FVector(0, xp * 100, yz * 100));
Vertices.Add(FVector(0, xp * 100, y * 100));
Vertices1.Add(FVector(0, x * 100, yz * 100));
Vertices1.Add(FVector(0, x * 100, y * 100));
Vertices1.Add(FVector(0, xp * 100, yz * 100));
Vertices1.Add(FVector(0, xp * 100, y * 100));
x1 = .03125 * (UVPos[tcnt + 3] % 32);
y1 = .0625 * (floor(UVPos[tcnt + 3] / 32));
x2 = x1 + .03125;
y2 = y1 + .0625;
UVs.Add(FVector2D(x1, y2));
UVs.Add(FVector2D(x1, y1));
UVs.Add(FVector2D(x2, y2));
UVs.Add(FVector2D(x2, y1));
for (int i = 0; i < 6; i++) Triangles.Add(inds[i] + tcnt * 4);
tcnt++;
}
}
//computerMesh->CreateMeshSection(0, Vertices, Triangles, TArray<FVector>(), UVs, TArray<FColor>(), TArray<FProcMeshTangent>(), true);
//computerMesh->SetMaterial(0, mat);
callrut = true;
}
void AMainPawn::Hankey(FString key)
{
if (key.Len() == 1 && key.IsNumeric()) {
UVs.Empty();
UVPos.Empty();
UVPos.Add(0);
UVPos.Add(0);
UVPos.Add(0);
int cnt = 0;
int xcnt = 0;
int ycnt = 0;
for (int i = 0; i < 120; i++) {
UVPos.Add(32);
xcnt++;
if (xcnt > 39) {
ycnt++;
xcnt = 0;
}
}
int32 chnums[18] = { 69, 110, 116, 101, 114, 32, 52, 32, 100, 105, 103, 105, 116, 32, 112, 105, 110, 58 };
for (int i = 0; i < 18; i++) {
int addv = chnums[i];
UVPos.Add(addv);
xcnt++;
if (xcnt > 39) {
ycnt++;
xcnt++;
}
}
FString digits = "0123456789";
int dsel = -1;
for (int i = 0; i < 10; i++) {
if (key.Equals(digits.Mid(i, 1))) {
dsel = i + 48;
UVPos.Add(i + 48);
}
}
for (int i = 65; i < 70; i++) UVPos.Add(i);
while (ycnt < 26) {
while (xcnt < 40) {
UVPos.Add(32);
xcnt++;
}
ycnt++;
}
while (UVPos.Num() < 1200) UVPos.Add(32);
float x1 = 0, x2 = 0, y1 = 0, y2 = 0;
Vertices1.Empty();
int tcnt = 0;
for (float y = .807844; y > 0; y -= 0.03231376) {
for (float x = -0.546391; x < 0.546391; x += 0.02731955) {
float yz = y - 0.03231376;
float xp = x + 0.02731955;
x1 = .03125 * (UVPos[tcnt + 3] % 32);
y1 = .0625 * (floor(UVPos[tcnt + 3] / 32));
x2 = x1 + .03125;
y2 = y1 + .0625;
Vertices1.Add(FVector(0, x * 100, yz * 100));
Vertices1.Add(FVector(0, x * 100, y * 100));
Vertices1.Add(FVector(0, xp * 100, yz * 100));
Vertices1.Add(FVector(0, xp * 100, y * 100));
UVs.Add(FVector2D(x2, y2));
UVs.Add(FVector2D(x2, y1));
UVs.Add(FVector2D(x1, y2));
UVs.Add(FVector2D(x1, y1));
tcnt++;
}
}
//computerMesh->ClearMeshSection(0);
//computerMesh->CreateMeshSection(0, Vertices, Triangles, TArray<FVector>(), UVs, TArray<FColor>(), TArray<FProcMeshTangent>(), true);
//computerMesh->UpdateMeshSection(0, Vertices1, FOccluderVertexArray(), UVs, TArray<FColor>(), TArray<FProcMeshTangent>());
//computerMesh->UpdateMeshSection(0, Vertices, Triangles, TArray<FVector>(), UVs, TArray<FColor>(), TArray<FProcMeshTangent>());
//computerMesh->SetMaterial(0, mat);
callrut = true;
}
}