This problem seems to occur because Rotation is not taken into account when calculating Weight.
I have confirmed that it can be solved by calculating the rotation as follows.
float ULandscapeComponent::GetLayerWeightAtLocation(const FVector& InLocation, ULandscapeLayerInfoObject* LayerInfo, TArray<uint8>* LayerCache) { ... 1991 // Find location // TODO: Root landscape isn't always loaded, would Proxy suffice? if (ALandscape* Landscape = GetLandscapeActor()) { const FVector DrawScale = Landscape->GetRootComponent()->GetRelativeScale3D(); const FRotator DrawRotator = Landscape->GetRootComponent()->GetRelativeRotation(); //add FVector TestPosition = ((DrawRotator.UnrotateVector(InLocation - Landscape->GetActorLocation())) / DrawScale); //add float TestX = TestPosition.X - (float)GetSectionBase().X; //add float TestY = TestPosition.Y - (float)GetSectionBase().Y; //add // Abort if the test location is not on this component if (TestX < 0 || TestY < 0 || TestX > ComponentSizeQuads || TestY > ComponentSizeQuads) { return 0.0f; } ... }
1. Open Landscape.umap in Content Example
[Link Removed]
2. Set Soil to Landscape Layers of Foliage
[Link Removed]
3. At this time, we should be able to generate Foliage only for the Soil part, but if the rotation value is set to Landscape, it will be an incorrect generation position.
How does TextureRenderTarget2D get TArray<uint8> type data?
How would I go about lerping the rotation instead of it snapping when turning (pls dont sue me epic)
How do I set a material as a post-processing material?
How to delete some elements correctly when deleting an array loop?
Why does the REMOVE method of map container remove elements have memory leaks?
UMG RichText not appear image when packaged
What is the difference between Camera and CineCamera?
Does media player's OpenFile method support dynamically opening a video file?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-89079 in the post.
0 |
Component | UE - LD & Modeling - Terrain - Landscape |
---|---|
Affects Versions | 4.23, 4.24 |
Target Fix | 4.26 |
Created | Feb 19, 2020 |
---|---|
Resolved | Mar 23, 2020 |
Updated | Jun 22, 2020 |