Gorilla.Utils.Pathfinding
Unit Gorilla.Utils.Pathfinding.pasClasses
- EPathFindingException = class ( Exception )
- EPathFindingAbort = class ( EAbort )
- TGorillaPathfindingAlgorithm = class ( TGorillaControl )
Records
- record TGorillaPathfindingObstacle
TGorillaPathfindingObstacle
Fields
- public Control :
TControl3D
- public IsStatic :
Boolean
- public Bounds :
TBoundingBox
- public Computed :
Boolean
- public GridRect :
TRectF
Methods
- public constructor Create ( const AControl : TControl3D; const AIsStatic : Boolean = True ) ;
- public procedure Reset
(
)
;
Resets the Computed state of GridRect.
TGorillaPathfindingAlgorithm
Custom pathfinding algorithm class.
Remarks
This class do not have any computation algorithms. Those are implemented by the extended class. Here only obstacles and the agent are managed.Ancestors
Members
Fields
- protected FAgent :
TControl3D
- protected FObstacles :
TThreadList<Gorilla.Utils.Pathfinding.TGorillaPathfindingObstacle>
- protected FObstacleMargin :
TPoint3D
- protected FOnUpdate :
TOnPathfindingObstacleUpdate
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetAgentPosition ( ) : TPoint3D ;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public procedure AddObstacle
(
const
ACtrl :
TControl3D; const
AIsStatic :
Boolean
=
True
)
;
overload virtual;
Adds a visual component managed as obstacle on path finder grids
Parameters
- const ACtrl : TControl3D - Visual component that should be handled as obstacle. Do this obstacle moves? Prefer not-moving obstacles, which increses performance a lot.
- const AIsStatic : Boolean = True - Visual component that should be handled as obstacle. Do this obstacle moves? Prefer not-moving obstacles, which increses performance a lot.
- public procedure AddObstacle ( const ACtrl : TControl3D; const ABounds : TBoundingBox; const AIsStatic : Boolean = True ) ; overload virtual;
- public procedure RemoveObstacle
(
const
ACtrl :
TControl3D
)
;
virtual;
Removes a visual component from managed list of path finder.
Parameters
- const ACtrl : TControl3D - Visual component that should be handled as obstacle.
- public procedure ClearObstacles
(
)
;
virtual;
Removes all registered obstacles from managed list of path finder.
- public procedure ResetObstacles
(
)
;
virtual;
Resets computed rectangles and boundaries of each obstacle.
- public function CountObstacles
(
)
: Integer
;
virtual;
Returns the number of registered obstacles.
Properties
- public AgentPosition : TPoint3D
- published Agent : TControl3D
- published ObstacleMargin : TPoint3D
Get or set a margin around an obstacle. This can be used to define a buffer area around an obstacle to prevent intersections.
read FObstacleMargin
write FObstacleMargin