Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
Functions
LOS Namespace Reference

Functions

bool lineOfSight (Vec2 a, Vec2 b, Map *map)
 
bool lineLineIntersectionCheck (Vec2 a, Vec2 b, Vec2 c, Vec2 d, char axis)
 
void drawLineOfSight (Vec2 a, Vec2 b, Map *map, SDL_Renderer *renderer)
 
Vec2 getNewTarget (Vec2 a, Map *map)
 

Function Documentation

void LOS::drawLineOfSight ( Vec2  a,
Vec2  b,
Map map,
SDL_Renderer *  renderer 
)

Check if two positions can see each other and draw the tested tiles

Parameters
Vec2Position a
Vec2Position b
Map* A pointer to the map
SDL_Renderer* A pointer to the renderer

Here is the call graph for this function:

Here is the caller graph for this function:

Vec2 LOS::getNewTarget ( Vec2  a,
Map map 
)

Find a new target position to go to

Parameters
Vec2Position a
Map* A pointer to the map
Returns
Vec2 The new target position

Here is the call graph for this function:

Here is the caller graph for this function:

bool LOS::lineLineIntersectionCheck ( Vec2  a,
Vec2  b,
Vec2  c,
Vec2  d,
char  axis 
)

Check if two lines intersect

Parameters
Vec2Position a (line 1)
Vec2Position b (line 1)
Vec2Position c (line 2)
Vec2Position c (line 2)
charAxis that the second line being tested is on
Returns
bool If the lines intersect

Here is the caller graph for this function:

bool LOS::lineOfSight ( Vec2  a,
Vec2  b,
Map map 
)

Check if two positions can see each other

Parameters
Vec2Position a
Vec2Position b
Map* A pointer to the map
Returns
bool If the position can see each other

Here is the call graph for this function:

Here is the caller graph for this function: