Skip to content

AcresCropMarks.h#

Acres/Source/Acres/AcresCropMarks.h Generated

Render-only look of the crop patches that a machine changed, for each sample of a patch.

A crop patch (1.52 m x 1.0 m) is one mesh instance, and the farm keeps a crushed and a harvested bit for each of its 4 x 4 samples. The old display gave the instance one height scale and one tilt from the two shares, so a wheel that crushed two samples leaned all the plants of the patch. This class draws a changed patch in its own instanced component with a material that moves each vertex to the look of its own sample (Acres/Shaders/AcresCropMarks.ush, built by Tools/ACRE/Tools/make_crop_mark_materials.py): the plants stand, lean, lie in the wheel track, are stubble with residue, or are below tilled soil.

The instance in the component of this class has the transform of the old rule. The ray-tracing scene (the LiDAR) does not move vertices, so it sees the crop as before. The owner of the patch (FAcresFarmRuntime for the tile, AAcresDriveRegionGround for the regional fields) hides the instance of the patch in its own component while the patch is here.

Two of the four masks are not a state of the farm. FAcresSoilVisuals::SampleMarks gives them from the cells of the ground: pressed (a crushed sample on a cell with a wheel rut) and buried (a sample on a tilled cell).

Game thread only. Potato has no material for this look and keeps the old display.

Get#

The one instance of the game. -NoCropMarks turns the look off (the old display, for a comparison).

static FAcresCropMarks& Get();

Ready#

True when the look is on and the game renders. The first call for a level makes the state of that level.

bool Ready(UWorld* World) ;

Num#

Counters for the farm statistics: patches with the look now, and instance writes since the start.

int Num() const ;

Supports#

Can a patch with this mesh and these materials take the look? False for a crop without a mark material.

bool Supports(UWorld* World, const UStaticMesh* Mesh, TConstArrayView<UMaterialInterface*> Materials);

Set#

Draw the patch with the look of its samples, or change its look.

Argument Description
World The level.
Key Identity of the patch: the tile patch index, or AcresFields::RegionPatchBase + the regional ordinal.
Kind Crop kind (AcresCrops). Mesh, Materials: The mesh of the patch and the materials of its component, by slot.
Standing World transform of the untouched patch, with the height scale of its growth.
Flat World transform of the old rule for its state (FAcresFarmRuntime::UpdateVisuals).
State The masks and the lay direction. CullStartCm, CullEndCm: Instance cull distances of the component of the patch (0: none).
void Set(UWorld* World, int64 Key, int Kind, UStaticMesh* Mesh, TConstArrayView<UMaterialInterface*> Materials, const FTransform& Standing, const FTransform& Flat, const FState& State, int32 CullStartCm, int32 CullEndCm);

Remove#

The patch stands again or leaves the display. Returns true when it was here.

bool Remove(int64 Key);

Has#

True when the patch is drawn here.

bool Has(int64 Key) const ;

Hidden#

The transform that hides the instance of a patch in the component of its owner.

static FTransform Hidden(const FTransform& Standing);

FState#

struct FState

The look of one changed patch.

Name Type Unit Default Description
Crushed uint16 0 See above.
Pressed uint16 0 Crushed samples in a wheel track.
Harvested uint16 0 The state of the farm.
Buried uint16 0 Samples in a tilled strip.
LayYaw float 0 Direction in which crushed plants lie, Unreal yaw, rad.
RutCm float cm 0 Depth of the wheel rut below the pressed samples, cm.