C# Класс FlatRedBall.AI.Pathfinding.PathfindingFunctions

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
IsInLineOfSight ( Vector3 position1, Vector3 position2, PositionedObjectList collisionMap ) : bool

Tests if two vector positions are within line of sight given a collision map.

IsInLineOfSight ( Vector3 position1, Vector3 position2, float collisionThreshold, PositionedObjectList collisionMap ) : bool

Tests if two vector positions are within line of sight given a collision map.

IsInLineOfSight ( Vector3 position1, Vector3 position2, float collisionThreshold, ShapeCollection shapeCollection ) : bool
Midpoint ( Vector3 position1, Vector3 position2 ) : Vector3

Returns the midpoint between two Vector3s.

OptimalVisiblePoint ( Vector3 currentPosition, Vector3 inSightPosition, Vector3 outOfSightPosition, int numberOfOptimizations, float collisionThreshold, PositionedObjectList collisionMap ) : Vector3

Calculates the closest visible point to outOfSightPosition given the currentPosition.

Описание методов

IsInLineOfSight() публичный статический Метод

Tests if two vector positions are within line of sight given a collision map.
public static IsInLineOfSight ( Vector3 position1, Vector3 position2, PositionedObjectList collisionMap ) : bool
position1 Vector3 The first world-coordinate position.
position2 Vector3 The second world-coordinate position.
collisionMap PositionedObjectList The list of polygons used to test if the two positions are within line of sight.
Результат bool

IsInLineOfSight() публичный статический Метод

Tests if two vector positions are within line of sight given a collision map.
public static IsInLineOfSight ( Vector3 position1, Vector3 position2, float collisionThreshold, PositionedObjectList collisionMap ) : bool
position1 Vector3 The first world-coordinate position.
position2 Vector3 The second world-coordinate position.
collisionThreshold float Distance from position2 to the polygon it's colliding against. /// If a polygon is within this threshold, this will return false.
collisionMap PositionedObjectList The list of polygons used to test if the two positions are within line of sight.
Результат bool

IsInLineOfSight() публичный статический Метод

public static IsInLineOfSight ( Vector3 position1, Vector3 position2, float collisionThreshold, ShapeCollection shapeCollection ) : bool
position1 Vector3
position2 Vector3
collisionThreshold float
shapeCollection ShapeCollection
Результат bool

Midpoint() публичный статический Метод

Returns the midpoint between two Vector3s.
public static Midpoint ( Vector3 position1, Vector3 position2 ) : Vector3
position1 Vector3 The first position.
position2 Vector3 The connecting position.
Результат Vector3

OptimalVisiblePoint() публичный статический Метод

Calculates the closest visible point to outOfSightPosition given the currentPosition.
public static OptimalVisiblePoint ( Vector3 currentPosition, Vector3 inSightPosition, Vector3 outOfSightPosition, int numberOfOptimizations, float collisionThreshold, PositionedObjectList collisionMap ) : Vector3
currentPosition Vector3 The position with which to test Line Of Sight
inSightPosition Vector3 The connector to the outOfSightPosition with which to find midpoint optimizations.
outOfSightPosition Vector3 The guide to find the optimal in sight position.
numberOfOptimizations int The number of times we will midpoint optimize, higher means closer to optimal.
collisionThreshold float Usually the object using the path will be larger than 0, use the size of the collision for testing line of sight.
collisionMap PositionedObjectList Polygon list which we will use for collision (without it, everything is straight line of sight).
Результат Vector3