Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
NodeRecord Struct Reference

Record structure used in A* pathfinding algorithm. More...

#include <graph.h>

Public Member Functions

float total_cost () const noexcept
 

Public Attributes

GraphPosition pos
 
float cost_from_start = FLT_MAX
 
float heuristic = 0.f
 
GraphPosition parent
 
bool has_parent = false
 

Detailed Description

Record structure used in A* pathfinding algorithm.

Parameters
posThe graph position of the node.
gThe cost from the start node to this node.
hThe heuristic cost estimate from this node to the target node.
parentThe graph position of the parent node in the path.
has_parentFlag indicating whether this node has a parent.
Returns
f() The total estimated cost (f) from start to target through this node.

Member Function Documentation

◆ total_cost()

float NodeRecord::total_cost ( ) const
inlinenoexcept

Member Data Documentation

◆ cost_from_start

float NodeRecord::cost_from_start = FLT_MAX

◆ has_parent

bool NodeRecord::has_parent = false

◆ heuristic

float NodeRecord::heuristic = 0.f

◆ parent

GraphPosition NodeRecord::parent

◆ pos

GraphPosition NodeRecord::pos

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