summaryrefslogtreecommitdiff
path: root/README
blob: 4de81756dd2cf958ce98f4e7785bfdb3c2e4b3a2 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
clld - A standalone collision checker


Contents/Index:

	1. Introduction			16
	2. Setup			26
		2.1. Compilation	28
		2.2. Installation	47
		2.3. Running		59
	3. Input Format			65
	4. Output Format		91
	5. License			117
	6. Authors			125

1. Introduction

clld is a simple collision checker, that takes two 2D, or 3D points, tests
the collision of the points, and outputs the results to stdout.

It can do many different types of collision checks, including
tile heightmap, AABB, per pixel, and more.



2. Setup

2.1. Compilation

To compile clld, run:

$ make

You can add extra compiler options, with the CFLAGS_EXTRA variable.

clld also supports compilers that are not bloat, such as
TinyCC, and the Portable C Compiler.

It is also recommended to compile clld with one of the
compilers above, rather than compiling it with gcc, or llvm.

The reason for saying this is because the program is very simple, and
very optimized, so using gcc wouldn't net you any significant gain in
performance, and would make the size of the binary, alot bigger.


2.2. Installation

To install clld, run:

$ make install

You can change the install prefix, and bin directories, by changing
the PREFIX, and BIN environment variables.

By default, PREFIX, and BIN are set to /usr/local, and bin respectivly.


2.3. Running

Run `clld --help`, or `clld -h` to get information about the options.



3. Input Format

The input format is plain text, and contains the collision type, the
cursor position, and the floor position.

The input format looks like this:

<collision type>
<collision type specific data>
<cursor x>, <cursor y>[, <cursor z>]
<floor x>, <floor y>[, <floor z]

The collision type is the type of collision check that clld will use.

Cursor x, y, and z are the coordinates of the cursor, which clld will
test against the floor's position.

Floor x, y, and z are the coordinates of the floor, which is used by
clld as the reference position that will be tested against the cursor.

The datatypes for each of the fields are:

Collision type:			flag
Cursor, and floor position:	integer, or floating point



4. Output Format

The output format is also plain text, and contains the
collision flag, the grounded flag, and the cursor position.

The output format looks like this:

<collision flag>
<grounded flag>
<cursor x>, <cursor y>[, <cursor z>]

The collision flag is set, when a collision has occured.

The grounded flag is set when the cursors y coordinate matches
the floors y coordinate.

Cursor x, y, and z are the new coordinates for the cursor to be set to.

The datatypes for each of the fields are:

Collision flag:		flag
Grounded flag:		flag
Cursor position:	integer, or floating point



5. License

clld is released under the GNU General Public License version 2. The
full text of the license can be found in the LICENSE file that should
be included in the clld distribution.



6. Authors

Original author:
	mr b0nk 500 <b0nk@mrb0nk500.xyz>