This repository has been archived on 2026-04-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bhlib/doc/Manual/en/BH_Ray2f.pod

206 lines
6.0 KiB
Plaintext
Raw Normal View History

=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>