Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
Geometry 2D
Collaboration diagram for Geometry 2D:

Functions

bj_bool bj_check_segments_hit (struct bj_vec2 a0, struct bj_vec2 a1, struct bj_vec2 b0, struct bj_vec2 b1)
bj_bool bj_check_circle_segment_hit (struct bj_vec2 c, bj_real r, struct bj_vec2 l0, struct bj_vec2 l1)

Detailed Description

2D Geometry utilities

Function Documentation

◆ bj_check_circle_segment_hit()

bj_bool bj_check_circle_segment_hit ( struct bj_vec2 c,
bj_real r,
struct bj_vec2 l0,
struct bj_vec2 l1 )

Check if a circle intersects with a line segment.

Tests whether a circle centered at c with radius r intersects the line segment from l0 to l1.

Parameters
cCircle center position.
rCircle radius.
l0Start point of the line segment.
l1End point of the line segment.
Returns
BJ_TRUE if the circle intersects the segment, BJ_FALSE otherwise.

◆ bj_check_segments_hit()

bj_bool bj_check_segments_hit ( struct bj_vec2 a0,
struct bj_vec2 a1,
struct bj_vec2 b0,
struct bj_vec2 b1 )

Check if two line segments intersect.

Tests whether the line segment from a0 to a1 intersects with the segment from b0 to b1 in 2D space.

Parameters
a0Start point of first segment.
a1End point of first segment.
b0Start point of second segment.
b1End point of second segment.
Returns
BJ_TRUE if the segments intersect, BJ_FALSE otherwise.