|
bool | raysphereintersect (const vec ¢er, float radius, const vec &o, const vec &ray, float &dist) |
|
bool | rayboxintersect (const vec &b, const vec &s, const vec &o, const vec &ray, float &dist, int &orient) |
|
bool | linecylinderintersect (const vec &from, const vec &to, const vec &start, const vec &end, float radius, float &dist) |
| Determines whether a line segment intersects a specified cylinder.
|
|
int | polyclip (const vec *in, int numin, const vec &dir, float below, float above, vec *out) |
|
int | mod360 (int angle) |
| Returns the angle passed to it, clamped to 0...360.
|
|
const vec2 & | sincosmod360 (int angle) |
| Returns a vec2 containing (cos, sine) for a given integral angle.
|
|
float | cos360 (int angle) |
| Returns the cosine for an angle (in degrees)
|
|
float | sin360 (int angle) |
| Returns the sine for an angle (in degrees)
|
|
float | tan360 (int angle) |
| Returns the tangent for an angle (in degrees)
|
|
float | cotan360 (int angle) |
| Returns the cotangent for an angle (in degrees)
|
|
Physical geometry objects.
This file describes objects which represent concrete geometric constructions, such as vectors that represent 2D, 3D, and 4D Cartesian coordinates, as well as more complex geometric structures such as quaternions and matrices.
bool linecylinderintersect |
( |
const vec & | from, |
|
|
const vec & | to, |
|
|
const vec & | start, |
|
|
const vec & | end, |
|
|
float | radius, |
|
|
float & | dist ) |
|
extern |
Determines whether a line segment intersects a specified cylinder.
Calculates whether a specified line segment intersects a cylinder, defined by a line segment and a radius around it. Segments which intersect along an edge, face, or tangent to the curved surface are considered to be intersecting. A successful intersection will cause the function to return true
.
Negative radii are handled the same as a positive radius of the same magnitude.
If the line segment is entirely within the boundaries of the cylinder, the segment is considered to be intersecting, with the intersection starting at the from
location.
The distance along the line at which the segment intersects the cylinder is expressed as a value from 0 to 1 and returned through the reference parameter dist. If the segment is entirely within the cylinder, the segment's intersection distance is considered to be zero.
If no intersection with the cylinder is found, the dist value will be returned unchanged, and the function will return false.
- Parameters
-
from | the start point of the intersecting line segment |
to | the end point of the intersecting line segment |
start | the start point of the cylinder's axial line segment |
end | the endpoint of the cylinder's axial line segment |
radius | the radius of the cylinder to be intersected |
dist | the value to set to the distance along the segment where intersection occured |
- Returns
- true if the cylinder was intersected by the line segment
-
false if the cylinder and line segment did not intersect