Loading...
Searching...
No Matches
Collision Detection
Physics Functions

## Functions

void | ne10_physics_compute_aabb_vec2f_c (ne10_mat2x2f_t *aabb, ne10_vec2f_t *vertices, ne10_mat2x2f_t *xf, ne10_vec2f_t *radius, ne10_uint32_t vertex_count)
| compute AABB for ploygon.
void | ne10_physics_relative_v_vec2f_c (ne10_vec2f_t *dv, ne10_vec3f_t *v_wa, ne10_vec2f_t *ra, ne10_vec3f_t *v_wb, ne10_vec2f_t *rb, ne10_uint32_t count)
| calculate relative velocity at contact.
void | ne10_physics_apply_impulse_vec2f_c (ne10_vec3f_t *v_wa, ne10_vec3f_t *v_wb, ne10_vec2f_t *ra, ne10_vec2f_t *rb, ne10_vec2f_t *ima, ne10_vec2f_t *imb, ne10_vec2f_t *p, ne10_uint32_t count)
| apply contact impulse.

## Detailed Description

  Collision detection typically refers to the computational problem of detecting the intersection of two or more objects.

  This set of functions are used for collision detection algorithm for 32-bit float data types. Currently compute AABB, caculate relative velocity and apply contact impulse were implemented.

## Function Documentation

## ne10_physics_apply_impulse_vec2f_c()

void ne10_physics_apply_impulse_vec2f_c | ( | ne10_vec3f_t * | v_wa,
|  | ne10_vec3f_t * | v_wb,
|  | ne10_vec2f_t * | ra,
|  | ne10_vec2f_t * | rb,
|  | ne10_vec2f_t * | ima,
|  | ne10_vec2f_t * | imb,
|  | ne10_vec2f_t * | p,
|  | ne10_uint32_t | count
| ) |  |

apply contact impulse.

Parameters

  | [in/out] | *v_wa return velocity and angular velocity of body a
  | [in/out] | *v_wb return velocity and angular velocity of body b
  [in] | *ra | distance vector from center of mass of body a to contact point
  [in] | *rb | distance vector from center of mass of body b to contact point
  [in] | *ima | constant of body a
  [in] | *imb | constant of body b
  [in] | *p | constant
  [in] | count | the number of items

Returns
  none.

To improve performance, 2 items are processed in one loop

Definition at line 176 of file NE10_physics.c.

## ne10_physics_compute_aabb_vec2f_c()

void ne10_physics_compute_aabb_vec2f_c | ( | ne10_mat2x2f_t * | aabb,
|  | ne10_vec2f_t * | vertices,
|  | ne10_mat2x2f_t * | xf,
|  | ne10_vec2f_t * | radius,
|  | ne10_uint32_t | vertex_count
| ) |  |

compute AABB for ploygon.

Parameters

  [out] | *aabb | return axis aligned box
  [in] | *vertices | a convex polygon
  [in] | *xf | the position and orientation of rigid
  [in] | radius | the aligned bounding
  [in] | vertex_count | vertices count of convex ploygen

Returns
  none. The function is to compute AABB for ploygon. vertex_count > 0.

Definition at line 95 of file NE10_physics.c.

## ne10_physics_relative_v_vec2f_c()

void ne10_physics_relative_v_vec2f_c | ( | ne10_vec2f_t * | dv,
|  | ne10_vec3f_t * | v_wa,
|  | ne10_vec2f_t * | ra,
|  | ne10_vec3f_t * | v_wb,
|  | ne10_vec2f_t * | rb,
|  | ne10_uint32_t | count
| ) |  |

calculate relative velocity at contact.

Parameters

  [out] | *dv | return relative velocity
  [in] | *v_wa | velocity and angular velocity of body a
  [in] | *ra | distance vector from center of mass of body a to contact point
  [in] | *v_wb | velocity and angular velocity of body b
  [in] | *rb | distance vector from center of mass of body b to contact point
  [in] | count | the number of items

Returns
  none.

To improve performance, 2 items are processed in one loop

Definition at line 132 of file NE10_physics.c.