Matrix occupancy quadtree
[Internals - not intended for the libstage end user]

Detailed Description

Occupancy quadtree underlying Stage's sensing and collision models.

Data Structures

struct  stg_cell
struct  _stg_matrix
struct  stg_line_t


typedef stg_cell stg_cell_t
typedef _stg_matrix stg_matrix_t


stg_cell_tstg_cell_locate (stg_cell_t *cell, double x, double y)
void stg_cell_unrender (stg_cell_t *cell)
void stg_cell_render (stg_cell_t *cell)
void stg_cell_render_tree (stg_cell_t *cell)
void stg_cell_unrender_tree (stg_cell_t *cell)
stg_matrix_tstg_matrix_create (double ppm, double width, double height)
void stg_matrix_destroy (stg_matrix_t *matrix)
void stg_matrix_clear (stg_matrix_t *matrix)
void * stg_matrix_cell_get (stg_matrix_t *matrix, int r, double x, double y)
void stg_matrix_cell_append (stg_matrix_t *matrix, double x, double y, void *object)
void stg_matrix_remove_obect (stg_matrix_t *matrix, void *object)
void stg_matrix_cell_remove (stg_matrix_t *matrix, double x, double y, void *object)
void stg_matrix_rectangle (stg_matrix_t *matrix, double px, double py, double pth, double dx, double dy, void *object)
void stg_matrix_line (stg_matrix_t *matrix, double x1, double y1, double x2, double y2, void *object)
void stg_matrix_lines (stg_matrix_t *matrix, stg_line_t *lines, int num_lines, void *object)
void stg_matrix_polygons (stg_matrix_t *matrix, double x, double y, double a, stg_polygon_t *polys, int num_polys, void *object)
void stg_matrix_remove_object (stg_matrix_t *matrix, void *object)

Typedef Documentation

typedef struct stg_cell stg_cell_t

A node in the occupancy quadtree

typedef struct _stg_matrix stg_matrix_t

Occupancy quadtree structure

Function Documentation

stg_cell_t* stg_cell_locate stg_cell_t cell,
double  x,
double  y

in the cell-tree which contains cell, return the smallest cell that contains the point x,y. cell need not be the root of the tree

void stg_cell_unrender stg_cell_t cell  ) 

void stg_cell_render stg_cell_t cell  ) 

void stg_cell_render_tree stg_cell_t cell  ) 

void stg_cell_unrender_tree stg_cell_t cell  ) 

stg_matrix_t* stg_matrix_create double  ppm,
double  width,
double  height

Create a new matrix structure

void stg_matrix_destroy stg_matrix_t matrix  ) 

Frees all memory allocated by the matrix; first the cells, then the cell array.

void stg_matrix_clear stg_matrix_t matrix  ) 

removes all pointers from every cell in the matrix

void* stg_matrix_cell_get stg_matrix_t matrix,
int  r,
double  x,
double  y

Get the pointer from the cell at x,y (in meters).

void stg_matrix_cell_append stg_matrix_t matrix,
double  x,
double  y,
void *  object

append the pointer [object] to the list of pointers in the [matrix] cell at location [x,y]

void stg_matrix_remove_obect stg_matrix_t matrix,
void *  object

remove [object] from all cells it occupies in the matrix

void stg_matrix_cell_remove stg_matrix_t matrix,
double  x,
double  y,
void *  object

if [object] appears in the cell's list, remove it

void stg_matrix_rectangle stg_matrix_t matrix,
double  px,
double  py,
double  pth,
double  dx,
double  dy,
void *  object

Append to the [object] pointer to the cells on the edge of a rectangle, described in meters about a center point.

void stg_matrix_line stg_matrix_t matrix,
double  x1,
double  y1,
double  x2,
double  y2,
void *  object

Render [object] as a line in the matrix.

void stg_matrix_lines stg_matrix_t matrix,
stg_line_t lines,
int  num_lines,
void *  object

Call stg_matrix_line for each of [num_lines] lines

void stg_matrix_polygons stg_matrix_t matrix,
double  x,
double  y,
double  a,
stg_polygon_t polys,
int  num_polys,
void *  object

render an array of polygons into the matrix

void stg_matrix_remove_object stg_matrix_t matrix,
void *  object

remove all reference to an object from the matrix

Generated on Thu Aug 11 13:08:10 2005 for Stage by  doxygen 1.4.0