A* Pathfinding Project  4.1.20
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
GraphHitInfo Struct Reference

Returned by graph ray- or linecasts containing info about the hit. More...

Detailed Description

Returned by graph ray- or linecasts containing info about the hit.

This is the return value by the Pathfinding.IRaycastableGraph.Linecast methods. Some members will also be initialized even if nothing was hit, see the individual member descriptions for more info.

Public Member Functions

 GraphHitInfo (Vector3 point)
 

Public Attributes

GraphNode node
 Node which contained the edge which was hit.
 
Vector3 origin
 Start of the line/ray.
 
Vector3 point
 Hit point.
 
Vector3 tangent
 Tangent of the edge which was hit.
 
Vector3 tangentOrigin
 Where the tangent starts.
 

Properties

float distance [get]
 Distance from origin to point.
 

Constructor & Destructor Documentation

GraphHitInfo ( Vector3  point)

Member Data Documentation

GraphNode node

Node which contained the edge which was hit.

If the linecast did not hit anything then this will be set to the last node along the line's path (the one which contains the endpoint).

For layered grid graphs the linecast will return true (i.e: no free line of sight) if when walking the graph we ended up at X,Z coordinate for the end node but the end node was on a different level (e.g the floor below or above in a building). In this case no node edge was really hit so this field will still be null.

Vector3 origin

Start of the line/ray.

Note that the point passed to the Linecast method will be clamped to the closest point on the navmesh.

Vector3 point

Hit point.

In case no obstacle was hit then this will be set to the endpoint of the line.

Vector3 tangent

Tangent of the edge which was hit.

Vector3 tangentOrigin

Where the tangent starts.

tangentOrigin and tangent together actually describes the edge which was hit.

Property Documentation

float distance
get

Distance from origin to point.


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