Statistics
| Revision:

## root / branches / simulator / projects / simulator / simulator / core / world.h @ 1022

 1 ```/** ``` ``` * @file world.h ``` ``` * @author Colony Project ``` ``` * ``` ``` * @brief THE WHOLE WIDE WORLD ``` ``` * ``` ``` * Contains structures and function prototypes used ``` ``` * for managing the world. ``` ``` **/ ``` ```#ifndef __WORLD_H__ ``` ```#define __WORLD_H__ ``` ```#define ID_RECTANGLE 0 ``` ```#define ID_CIRCLE 1 ``` ```#define NUM_SHAPES 2 ``` ```typedef struct { ``` ``` double x; ``` ``` double y; ``` ```} point_t; ``` ```typedef struct { ``` ``` point_t p1; /* Lower left point */ ``` ``` point_t p2; /* Upper right point */ ``` ```} bbox_t; ``` ```typedef struct { ``` ``` point_t p; /* origin */ ``` ``` double d; /* direction */ ``` ```} ray_t; ``` ```typedef struct { ``` ``` int id; ``` ``` bbox_t *bbox; ``` ``` void *props; /* shape-specific properties */ ``` ```} object_t; ``` ```typedef struct { ``` ``` int num_objs; ``` ``` object_t *objs; ``` ``` bbox_t world; ``` ```} world_t; ``` ```/* Specific collision functions */ ``` ```double collide_circle(ray_t *ray, object_t *obj); ``` ```double collide_rect(ray_t *ray, object_t *obj); ``` ```/* Array of function pointers to the specific collide functions. ``` ``` * Must be listed in the same order as IDs */ ``` ```double (*collide_func[NUM_SHAPES])(ray_t *ray, object_t *obj) = ``` ``` { ``` ``` collide_rect, ``` ``` collide_circle ``` ``` }; ``` ```#endif ```