Colission elements

Seduce uses an id based colission system. In order to build custom widgets that use the same colission system, seduce provides a set of functionality for using it. When execution is set to BAM_DRAW, functions can be called to create coliders. Later execution is set to BAM_EVENT the colission system can be queried to test if an element is accessabel.


void seduce_element_add_point(BInputState *input, void *id, uint part, float *pos, float size);

Description: Adds a point shaped element.


void seduce_element_add_line(BInputState *input, void *id, uint part, float *a, float *b, float size);

Description: Adds a line segment shaped element.


void seduce_element_add_triangle(BInputState *input, void *id, uint part, float *a, float *b, float *c);

Description: Adds a triangle shaped element.


void seduce_element_add_quad(BInputState *input, void *id, uint part, float *a, float *b, float *c, float *d);

Description: Adds a quad shaped element.


void seduce_element_add_rectangle(BInputState *input, void *id, uint part, float pos_x, float pos_y, float size_x, float size_y);

Description: Adds an axis aligned rectangle shaped element.


void seduce_element_add_surface(BInputState *input, void *id);

Description: creates alocal surface at a matrix space that can be used for local interactions.


void *seduce_element_colission_test(float *pos, uint *part, uint user_id);


void *seduce_element_pointer_id(BInputState *input, uint pointer, uint *part);

Description: Returns the id and part colliding with a specific pointer


void *seduce_element_pointer_down_click_id(BInputState *input, uint pointer, uint *part);

Description: Returns the id and part that a specific pointer was coliding with last time it was activated.


uint seduce_element_pointer(BInputState *input, void *id, uint *part);

Description: return the id of a pointer colliding with an id / part.


void *seduce_element_selected_id(uint user_id, float *pos, uint *part);

Description: return the selected if of a specific user id.


uint seduce_element_primary_axis(BInputState *input, uint user_id);

Description: retuyrns the primary axis used by a specific user for non pointer based interaction with UI emelents.


boolean seduce_element_surface_project(BInputState *input, void *id, float *output, uint axis, float pointer_x, float pointer_y);

Description: transforma an xy coordinate in to the local space of an id.


boolean seduce_element_active(BInputState *input, void *id, void *part);

Description: Returns TRUE or FALSE is a specific id / part is active.


boolean seduce_element_position_get(void *id, float *pos);

Description: finds the location of an id and sets pos to it. returns TRUE if sucsessful, or FALSE if it fails.


void seduce_element_user_exclusive_begin(uint user_id);

Description: Begins the creation of elements, that are only acessable to a single users input. (useful for popup menus)


void seduce_element_user_exclusive_end();

Description: Ends the exclusivity set by seduce_element_user_exclusive_begin.