aboutsummaryrefslogtreecommitdiff
path: root/doc/Manual/en/BH_Ray2f.pod
blob: 673b047cfb6169a5d1de5f18ad149ef18d2d4dbb (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
=encoding UTF-8


=head1 NAME

BH_Ray2f, BH_Segment2f - Ray/segment on a plane


=head1 SYNTAX

 #include <BH/Math/Ray2f.h>

 cc prog.c -o prog -lbh


=head1 DESCRIPTION

This module provides functions for working with rays and segments on a plane.
It includes functions for checking intersections between rays, segments, lines,
and bounding rectangles.


=head1 API CALLS


=head2 BH_Ray2fIntersectLine

 int BH_Ray2fIntersectLine(const float start[2],
                           const float direction[2],
                           const float line[3],
                           float *t,
                           float out[2]);

Checks the intersection between a ray and a line.

The parameters I<start> and I<direction> describe the ray.

The parameter I<line> describes the line.

The parameter I<t> describes the resulting time of the ray's intersection.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Ray2fIntersectTime

 int BH_Ray2fIntersectTime(const float aStart[2],
                           const float aDirection[2],
                           const float bStart[2],
                           const float bDirection[2],
                           float *time1,
                           float *time2);

Calculates the intersection time between two rays.

The parameters I<aStart> and I<aDirection> describe the first ray.

The parameters I<bStart> and I<bDirection> describe the second ray.

The parameter I<time1> describes the resulting intersection time of the first
ray.

The parameter I<time2> describes the resulting intersection time of the second
ray.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Ray2fIntersectRay

 int BH_Ray2fIntersectRay(const float aStart[2],
                          const float aDirection[2],
                          const float bStart[2],
                          const float bDirection[2],
                          float *t,
                          float out[2]);

Checks the intersection between two rays.

The parameters I<aStart> and I<aDirection> describe the first ray.

The parameters I<bStart> and I<bDirection> describe the second ray.

The parameter I<t> describes the resulting intersection time of the first ray.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Ray2fIntersectSegment

 int BH_Ray2fIntersectSegment(const float aStart[2],
                              const float aDirection[2],
                              const float bStart[2],
                              const float bEnd[2],
                              float *t,
                              float out[2]);

Checks the intersection between a ray and a segment.

The parameters I<aStart> and I<aDirection> describe the ray.

The parameters I<bStart> and I<bEnd> describe the segment.

The parameter I<t> describes the resulting intersection time of the ray.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Segment2fIntersectLine

 int BH_Segment2fIntersectLine(const float start[2],
                               const float end[2],
                               const float line[3],
                               float *t,
                               float out[2]);

Checks the intersection between a segment and a line.

The parameters I<start> and I<end> describe the segment.

The parameter I<line> describes the line.

The parameter I<t> describes the resulting intersection time of the segment.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Segment2fIntersectSegment

 int BH_Segment2fIntersectSegment(const float aStart[2],
                                  const float aEnd[2],
                                  const float bStart[2],
                                  const float bEnd[2],
                                  float *t,
                                  float out[2]);

Checks the intersection between two segments.

The parameters I<aStart> and I<aEnd> describe the first segment.

The parameters I<bStart> and I<bEnd> describe the second segment.

The parameter I<t> describes the resulting intersection time of the first
segment.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Ray2fIntersectBox2f

 int BH_Ray2fIntersectBox2f(const float aStart[2],
                            const float aDirection[2],
                            const float bMin[2],
                            const float bMax[2],
                            float *t,
                            float out[2]);

Checks the intersection between a ray and a bounding box.

The parameters I<aStart> and I<aDirection> describe the ray.

The parameters I<bMin> and I<bMax> describe the bounding box.

The parameter I<t> describes the resulting intersection time of the ray.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_Segment2fIntersectBox2f

 int BH_Segment2fIntersectBox2f(const float aStart[2],
                                const float aEnd[2],
                                const float bMin[2],
                                const float bMax[2],
                                float *t,
                                float out[2]);

Checks the intersection between a segment and a bounding box.

The parameters I<aStart> and I<aEnd> describe the segment.

The parameters I<bMin> and I<bMax> describe the bounding box.

The parameter I<t> describes the resulting intersection time of the segment.

The parameter I<out> describes the resulting intersection point.

If successful, the function returns 0, otherwise it returns an error code.


=head1 SEE ALSO

L<BH>