-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcollisions.h
55 lines (47 loc) · 1.71 KB
/
collisions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// pgCollision_* tells you if two objects are colliding.
// pgIntersection_* tells you if two objects are colliding and if where.
// pgIntersection_*'s three final parameters are pointers to X, optional, Y,
// optional, T, optional.
#ifndef _PG_COLLISIONS_H
#define _PG_COLLISIONS_H
#include "pygame.h"
#include "geometry.h"
static int
pgCollision_LineLine(pgLineBase *, pgLineBase *);
static int
pgIntersection_LineLine(pgLineBase *, pgLineBase *, double *, double *,
double *);
static int
pgCollision_LinePoint(pgLineBase *, double, double);
static int
pgCollision_CirclePoint(pgCircleBase *circle, double, double);
static int
pgCollision_LineCircle(pgLineBase *, pgCircleBase *);
static int
pgIntersection_LineCircle(pgLineBase *, pgCircleBase *, double *, double *,
double *);
static int
pgCollision_CircleCircle(pgCircleBase *, pgCircleBase *);
static int
pgIntersection_LineRect(pgLineBase *, SDL_Rect *, double *, double *,
double *);
static int
pgCollision_RectLine(SDL_Rect *, pgLineBase *);
static int
pgCollision_RectCircle(SDL_Rect *, pgCircleBase *);
static int
pgRaycast_LineLine(pgLineBase *, pgLineBase *, double, double *);
static int
pgRaycast_LineRect(pgLineBase *, SDL_Rect *, double, double *);
static int
pgRaycast_LineCircle(pgLineBase *, pgCircleBase *, double, double *);
static int
pgCollision_PolygonPoint(pgPolygonBase *, double, double);
static int
pgCollision_PolygonLine(pgPolygonBase *, pgLineBase *, int);
static int
pgCollision_CirclePolygon(pgCircleBase *, pgPolygonBase *, int);
static int
pgIntersection_CircleCircle(pgCircleBase *A, pgCircleBase *B,
double *intersections);
#endif /* ~_PG_COLLISIONS_H */