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).
Ready#
True when the look is on and the game renders. The first call for a level makes the state of that level.
Num#
Counters for the farm statistics: patches with the look now, and instance writes since the start.
Supports#
Can a patch with this mesh and these materials take the look? False for a crop without a mark material.
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). |
Remove#
The patch stands again or leaves the display. Returns true when it was here.
Has#
True when the patch is drawn here.
Hidden#
The transform that hides the instance of a patch in the component of its owner.
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. |