Class TSectorList
Unit
Declaration
type TSectorList = class(specialize TObjectList<TSector>)
Description
This item has no description.
Hierarchy
- TObject
- TList
- TObjectList
- TSectorList
Overview
Methods
procedure LinkToWaypoints(Waypoints: TWaypointList); |
|
function SectorWithPoint(const Point: TVector3): TSector; |
|
class function FindWay(SectorBegin, SectorEnd: TSector; Waypoints: TWaypointList): boolean; |
Description
Methods
procedure LinkToWaypoints(Waypoints: TWaypointList); |
|
Connect sectors and waypoints into a graph. Adds appropriate waypoints to sectors and sectors to waypoints, knowing which waypoint belongs (presumably, lies at the border of) to which sector. A waypoint belongs to the sector simply when TWaypoint.Box collides with one of the sector boxes.
Exceptions raised
|
function SectorWithPoint(const Point: TVector3): TSector; |
|
Returns sector with given point (using TSector.Contains of each sector). Returns nil if no such sector. |
class function FindWay(SectorBegin, SectorEnd: TSector; Waypoints: TWaypointList): boolean; |
|
This sets Waypoints contents to the list of waypoints that must be passed to travel from sector SectorBegin to SectorEnd. Special cases: when either SectorBegin or SectorEnd are nil (this can easily happen if you pass here results of SectorWithPoint method), or when SectorBegin = SectorEnd, or when there is no possible way, it returns Otherwise (if a way is found) it returns (So the result of this function is actually just a comfortable thing, you can get the same result just checking Waypoints.Count <> 0) TODO: This should use breadth-first search. Right now it uses depth-first search. For small sectors+waypoints graphs it doesn't matter. |
Generated by PasDoc 0.16.0-snapshot.