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.

seduce_element_add_point

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

Description: Adds a point shaped element.

seduce_element_add_line

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

Description: Adds a line segment shaped element.

seduce_element_add_triangle

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

Description: Adds a triangle shaped element.

seduce_element_add_quad

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.

seduce_element_add_rectangle

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.

seduce_element_add_surface

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

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

seduce_element_colission_test

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

seduce_element_pointer_id

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

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

seduce_element_pointer_down_click_id

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.

seduce_element_pointer

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

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

seduce_element_selected_id

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

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

seduce_element_primary_axis

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.

seduce_element_surface_project

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.

seduce_element_active

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

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

seduce_element_position_get

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.

seduce_element_user_exclusive_begin

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)

seduce_element_user_exclusive_end

void seduce_element_user_exclusive_end();

Description: Ends the exclusivity set by seduce_element_user_exclusive_begin.