tess 0.4.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
tess::DistanceFieldProduct Class Reference

#include <tess/path/field_product_cache.h>

Public Member Functions

void reserve_goals (std::size_t count)
void reserve_nodes (std::size_t node_count)
void reserve_dependencies (std::size_t count)
void clear () noexcept
template<typename World>
auto is_valid (const World &world) const noexcept -> bool
auto status () const noexcept -> PathStatus
auto goals () const noexcept -> std::span< const Coord3 >
auto dependencies () const noexcept -> std::span< const ChunkVersionDependencies::ChunkVersionDependency >
auto expanded_nodes () const noexcept -> std::size_t
auto reached_nodes () const noexcept -> std::size_t
auto byte_size () const noexcept -> std::size_t

Friends

template<typename World, typename Tag>
auto build_distance_field_product (const World &world, const GoalSet &goals, DistanceFieldScratch &scratch, DistanceFieldProduct &product) -> DistanceFieldResult
 Builds a dense multi-goal field into caller-owned reusable storage.
template<typename World, typename Tag>
auto distance_field_product_path (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch) -> PathResult
 Reconstructs a borrowed path from a valid multi-goal product.
template<typename World, typename Tag>
auto nearest_target (const World &world, Coord3 start, const DistanceFieldProduct &product, DistanceFieldScratch &scratch) -> NearestTargetResult
 Finds the nearest reachable goal represented by a valid product.

Detailed Description

Owns a reusable dense-world multi-goal distance field and dependencies.

Building may allocate; reserve goals, nodes, and dependencies for a warm allocation-free rebuild. A product is invalid after relevant chunk edits.

◆ build_distance_field_product

template<typename World, typename Tag>
auto build_distance_field_product ( const World & world,
const GoalSet & goals,
DistanceFieldScratch & scratch,
DistanceFieldProduct & product ) -> DistanceFieldResult
friend

Builds a dense multi-goal field into caller-owned reusable storage.

Builds a dense-world multi-goal field into caller-owned product.

Invalid goals return InvalidGoal. Reusing reserved product and scratch capacity avoids steady-state allocation.

◆ distance_field_product_path

template<typename World, typename Tag>
auto distance_field_product_path ( const World & world,
Coord3 start,
const DistanceFieldProduct & product,
DistanceFieldScratch & scratch ) -> PathResult
friend

Reconstructs a borrowed path from a valid multi-goal product.

Reconstructs a path from start through a valid dense-world product.

The returned path borrows scratch storage until its next mutation.

◆ nearest_target

template<typename World, typename Tag>
auto nearest_target ( const World & world,
Coord3 start,
const DistanceFieldProduct & product,
DistanceFieldScratch & scratch ) -> NearestTargetResult
friend

Finds the nearest reachable goal represented by a valid product.

Finds the closest reachable goal represented by a valid dense product.

The returned path borrows scratch storage until its next mutation.


The documentation for this class was generated from the following file: