Nudge Physics
A single file, header-only 3D physics library
|
Contact processing is designed to be done directly in the contact_data field of the context_t struct, so here is just a handy function to detect which collider (i.e. collision shape) of each body is involved in a specific collision. More...
Functions | |
void | nudge::contact_data_find_colliders (const context_t *c, unsigned contact_data_index, int16_t *box_collider_index_for_body_a, int16_t *sphere_collider_index_for_body_a, int16_t *box_collider_index_for_body_b, int16_t *sphere_collider_index_for_body_b, int use_relative_values_for_output_indices=0) |
Find out which collider belonging to body_a and body_b is involved in the collision determined by a ContactData index. | |
Contact processing is designed to be done directly in the contact_data field of the context_t struct, so here is just a handy function to detect which collider (i.e. collision shape) of each body is involved in a specific collision.
void nudge::contact_data_find_colliders | ( | const context_t * | c, |
unsigned | contact_data_index, | ||
int16_t * | box_collider_index_for_body_a, | ||
int16_t * | sphere_collider_index_for_body_a, | ||
int16_t * | box_collider_index_for_body_b, | ||
int16_t * | sphere_collider_index_for_body_b, | ||
int | use_relative_values_for_output_indices = 0 |
||
) |
Find out which collider belonging to body_a and body_b is involved in the collision determined by a ContactData index.
contact_data_index | in [0,c->contact_data.count) |
box_collider_index_for_body_a | out param, index in c->colliders.boxes, -1 means that sphere_collider_index_for_body_a>=0 |
sphere_collider_index_for_body_a | out param, index in c->colliders.spheres, -1 means that box_collider_index_for_body_a>=0 |
box_collider_index_for_body_b | out param, index in c->colliders.boxes, -1 means that sphere_collider_index_for_body_b>=0 |
sphere_collider_index_for_body_b | out param, index in c->colliders.spheres, -1 means that box_collider_index_for_body_b>=0 |
use_relative_values_for_output_indices | 0 or 1. Absolute values can't be stored. Relative values are relative to the first collider index of the body |