Math::sphere Class Reference
#include <sphere_.h>
Detailed Description
A 3-dimensional sphere.(C) 2004 RadonLabs GmbH
Public Member Functions | |
sphere () | |
default constructor | |
sphere (const point &_p, scalar _r) | |
pos/radius constructor | |
sphere (scalar _x, scalar _y, scalar _z, scalar _r) | |
x,y,z,r constructor | |
sphere (const sphere &rhs) | |
copy constructor | |
void | set (const point &_p, scalar _r) |
set position and radius | |
void | set (scalar _x, scalar _y, scalar _z, scalar _r) |
set x,y,z, radius | |
bool | inside (const bbox &box) const |
return true if box is completely inside sphere | |
bool | intersects (const sphere &s) const |
check if 2 spheres overlap | |
bool | intersects (const bbox &box) const |
check if sphere intersects box | |
bool | intersect_sweep (const vector &va, const sphere &sb, const vector &vb, scalar &u0, scalar &u1) const |
check if 2 moving sphere have contact | |
rectangle< scalar > | project_screen_rh (const matrix44 &modelView, const matrix44 &projection, scalar nearZ) const |
project sphere to screen rectangle (right handed coordinate system) | |
ClipStatus::Type | clipstatus (const bbox &box) const |
get clip status of box against sphere |
Member Function Documentation
bool Math::sphere::inside | ( | const bbox & | box | ) | const [inline] |
bool Math::sphere::intersects | ( | const bbox & | box | ) | const |
bool Math::sphere::intersect_sweep | ( | const vector & | va, | |
const sphere & | sb, | |||
const vector & | vb, | |||
scalar & | u0, | |||
scalar & | u1 | |||
) | const |
check if 2 moving sphere have contact
Check if 2 moving spheres have contact. Taken from "Simple Intersection Tests For Games" article in Gamasutra, Oct 18 1999
- Parameters:
-
va [in] distance travelled by 'this' sb [in] the other sphere vb [in] distance travelled by sb u0 [out] normalized intro contact u1 [out] normalized outro contact
ClipStatus::Type Math::sphere::clipstatus | ( | const bbox & | box | ) | const [inline] |