AcresCoreScene.h#
Core/Source/AcresCoreScene.h Generated
The static obstacles of the ACRE map for ACRES Core: buildings, grain bins and trees as simplified shapes (Core/Data/acre_scene.json, written by Core/Scripts/build_scene.py from building_models.json and the level's tree instances), for the ray-cast LiDAR (AcresCoreLidar.h) and the vehicles' collision test.
Geometry: triangles (walls, roofs, bin cones), vertical capped cylinders (bin walls, tree trunks) and axis-aligned ellipsoids (tree crowns), in one bounding volume hierarchy (binned SAH, 16 bins, up to 4 primitives per leaf). Crowns report only rays that enter them from outside, so a crown is one foliage layer (the LiDAR decides whether the beam passes it, AcresCoreLidar.h). Collision footprints are the buildings' measured outlines and the bins' circles (polygons with a z range) plus the trunk circles, on a uniform 8 m grid.
Frames: Core ENU metres (x east, y north, z up). Read-only after Load: any number of threads may query it.
FAcresSceneMaterial#
LiDAR optics of a material (sensors_polaris.json lidar.materials; AcresLidarModel.h in the game).
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
Reflectivity, Transmission, Specular, SpecularWidthDeg, IncidenceExponent, WetDarkening |
double |
Diffuse reflectance at 905 nm, 0-1; share of a beam a foliage layer lets through, 0-1; specular lobe peak and width, deg; Minnaert exponent; darkening when wet, 0-1. |
FAcresScene#
The static obstacle scene.
Example
FAcresScene Scene;
Scene.Load("Core/Data/acre_scene.json");
FRayHit Hit;
int Material = -1;
if (Scene.RayCast(Origin, Direction, 100, Hit, Material)) ...
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
BoundsMin, BoundsMax |
FVec3 |
Bounds of all primitives, m. |
FAcresScene::Load#
Reads a scene file (schema acres-core-scene-1) and builds the hierarchy and the collision grid.
| Argument | Description |
|---|---|
Path |
The JSON file. |
Error |
Why it failed (may be null). |
Returns: True on success.
FAcresScene::LoadObstacles#
Replaces the collision obstacles with the scouting map's (Acres/Content/Simulation/ACRE/Scouting/obstacles.json, schema acres-obstacles-1: the level's collision outlines of buildings, the structure, props and the parked car, the bin cylinders and the 6,984 tree trunks; the geometry of the obstacle class of ground_classes.u8), so the Core's collisions and obstacle distances are the task's. For the LiDAR it adds the shapes the scene has no model of (bins, props, the parked car, the structure and buildings outside the scene's footprints) as extrusions of a nominal height on the terrain: buildings 6 m, bins 1.3 x their diameter (at least 4 m), props 2.5 m, vehicles 1.3 m, the structure 30 m. Obstacles are 2D, so they collide at every height.
| Argument | Description |
|---|---|
Path |
obstacles.json. |
Terrain |
For the extrusions' ground. |
Error |
Why it failed (may be null). |
Returns: True on success (the scene is unchanged on failure).
FAcresScene::ObstacleName#
Id of a collision obstacle (Overlaps' ObstacleId): the obstacles.json id, "trunk" or the scene's footprint kind.
FAcresScene::RayCast#
Closest hit along a ray.
| Argument | Description |
|---|---|
Origin |
Ray start, m. |
Direction |
Direction (any length; T is in its units). |
MaxT |
Farthest T. |
Hit |
Receives the hit (normal faces the ray). |
Material |
Receives the material index (MaterialCount() lists them). |
MinT |
Nearest T accepted (to continue a ray past a foliage layer). |
Returns: True on a hit with MinT < T <= MaxT.
FAcresScene::Occluded#
True when anything blocks the ray within MaxT (foliage included).
FAcresScene::RayCastBruteForce#
RayCast over every primitive without the hierarchy (tests).
FAcresScene::Overlaps#
Whether an oriented box on the ground touches an obstacle.
The box is a rectangle in plan (centre, yaw about z counter-clockwise from east, half length along its heading and half width across it) swept between ZMin and ZMax; it is tested against the building and bin footprints and the trunk circles whose z ranges overlap.
| Argument | Description |
|---|---|
Centre |
Box centre, m (z unused). |
Yaw |
Heading, rad. HalfLengthM, HalfWidthM: Half extents in plan, m. ZMin, ZMax: Height range, m. |
ObstacleId |
Receives the first obstacle touched (index into the footprints, then the trunks; may be null). |
Returns: True on contact.
FAcresScene::NearestObstacleM#
Distance in plan from a point to the nearest obstacle footprint or trunk within MaxM (MaxM when none).
FAcresScene::TriangleCount#
Counts: triangles, cylinders, ellipsoids, all primitives, collision obstacles (footprints + trunks), BVH nodes.
FAcresScene::MaterialCount#
Materials, indexed by the Material of a hit.
FAcresScene::FindMaterial#
Index of a material by name, or -1.
EPrimitive#
Primitive kinds.
| Value | Description |
|---|---|
Triangle |
|
Cylinder |
|
Ellipsoid |