B2d_shape_test_point - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

Description

Adds the given point to the given shape, only works with polygon or edge shapes. Note: Box2D requires the points to be added clockwise, and the shape to be convex

Parameters

Parameter Description
id index of the shape
x x coordinate representing the point
y y coordinate

Return Values

void: This function does not return anything.

Example Call

// demonstrates checking if the coordinate of the mouse intersects the shape at the objects coordinate and rotation
if (b2d_shape_test_point(myshape, x, y, direction, mouse_x, mouse_y)) {
  // shape collides with mouse at position
} else {
  // shape did not collide
}

NOTOC