Collision

nvPersistentContactPair nv_collide_circle_x_circle(nvShape *circle_a, nvTransform xform_a, nvShape *circle_b, nvTransform xform_b)

Check circles collision and generate contact point information.

Parameters:
  • circle_a – First circle shape

  • xform_a – First transform

  • circle_b – Second circle shape

  • xform_b – Second transform

Returns:

nvPersistentContactPair

nv_bool nv_collide_circle_x_point(nvShape *circle, nvTransform xform, nvVector2 point)

Check if point is inside circle.

Parameters:
  • circle – Circle shape

  • xform – Transform for the shape

  • point – Point

Returns:

nv_bool

nvPersistentContactPair nv_collide_polygon_x_circle(nvShape *polygon, nvTransform xform_poly, nvShape *circle, nvTransform xform_circle, nv_bool flip_anchors)

Check polygon x circle collision and generate contact point information.

Parameters:
  • polygon – Polygon shape

  • xform_poly – Transform for the polygon shape

  • circle – Circle shape

  • xform_circle – Transform for the circle shape

  • flip_anchors – Whether to flip anchors of contact or not

Returns:

nvPersistentContactPair

nvPersistentContactPair nv_collide_polygon_x_polygon(nvShape *polygon_a, nvTransform xform_a, nvShape *polygon_b, nvTransform xform_b)

Check polygons collision and generate contact point information.

Parameters:
  • polygon_a – First polygon shape

  • xform_a – First transform

  • polygon_b – Second polygon shape

  • xform_b – Second transform

Returns:

nvPersistentContactPair

nv_bool nv_collide_polygon_x_point(nvShape *polygon, nvTransform xform, nvVector2 point)

Check if point is inside polygon.

Parameters:
  • polygon – Polygon shape

  • xform – Transform for the shape

  • point – Point

Returns:

nv_bool

nv_bool nv_collide_aabb_x_aabb(nvAABB a, nvAABB b)

Check if two AABBs collide.

Parameters:
  • a – First AABB

  • b – Second AABB

Returns:

nv_bool

nv_bool nv_collide_aabb_x_point(nvAABB aabb, nvVector2 point)

Check if point is inside AABB.

Parameters:
  • aabb – AABB

  • point – Point

Returns:

nv_bool

nv_bool nv_collide_ray_x_circle(nvRayCastResult *result, nvVector2 origin, nvVector2 dir, nv_float maxsq, nvShape *shape, nvTransform xform)

Check if ray intersects circle.

Note

You should use nvSpace_cast_ray unless you need this function standalone.

Parameters:
  • result – Ray cast result

  • origin – Ray starting point

  • dir – Ray direction

  • maxsq – Maximum ray range squared

  • shape – Circle shape

  • xform – Transform for the shape

Returns:

nv_bool

nv_bool nv_collide_ray_x_polygon(nvRayCastResult *result, nvVector2 origin, nvVector2 dir, nv_float maxsq, nvShape *shape, nvTransform xform)

Check if ray intersects polygon.

Note

You should use nvSpace_cast_ray unless you need this function standalone.

Parameters:
  • result – Ray cast result

  • origin – Ray starting point

  • dir – Ray direction

  • maxsq – Maximum ray range squared

  • shape – Polygon shape

  • xform – Transform for the shape

Returns:

nv_bool