In my setup code I have this:
newTile->Transform = FTransform();
newTile->Transform.NormalizeRotation();
newTile->Dirty = true;
newTile->Valid = true;
And later on I am adding that tile to a Hierarchical Static Mesh Instance (HISM):
if (TileMeshInstances.Contains(tileMesh))
{
UHierarchicalInstancedStaticMeshComponent* hism = TileMeshInstances[tileMesh];
hism->AddInstance(tile->Transform);
}
else
{
int32 hismCount = TileMeshInstances.Num();
FString hismName = FString::Printf(TEXT("TileMeshInstance_%d"), hismCount);
UHierarchicalInstancedStaticMeshComponent* hism = NewObject<UHierarchicalInstancedStaticMeshComponent>(this, UHierarchicalInstancedStaticMeshComponent::StaticClass(), *hismName);
hism->RegisterComponent();
hism->AttachTo(RootComponent);
hism->AddInstance(tile->Transform);
TileMeshInstances.Add(tileMesh, hism);
}
However whenever I try to add a new Instance to the HISM, I get an exception complaining that my rotation is not normalized. So as you can see in the setup code I very specifically added a second call after adding the transform, to normalize the rotation (whatever the heck that means) but it still won’t work and says it isn’t normalized.