#include <sphere.h>
A 3-dimensional sphere.
- Copyright
- (C) 2004 RadonLabs GmbH (C) 2013-2020 Individual contributors, see AUTHORS file
|
| | 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 | intersects_ray (const line &l) const |
| | check if sphere intersects ray
|
| |
| 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 mat4 &modelView, const mat4 &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
|
| |
◆ sphere() [1/4]
◆ sphere() [2/4]
◆ sphere() [3/4]
◆ sphere() [4/4]
| Math::sphere::sphere |
( |
const sphere & | rhs | ) |
|
|
inline |
◆ clipstatus()
get clip status of box against sphere
Get the clip status of a box against this sphere.
Inside means: the box is completely inside the sphere.
◆ inside()
| bool Math::sphere::inside |
( |
const bbox & | box | ) |
const |
|
inline |
return true if box is completely inside sphere
Return true if the bounding box is inside the sphere.
◆ intersect_sweep()
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 |
◆ intersects() [1/2]
| bool Math::sphere::intersects |
( |
const bbox & | box | ) |
const |
check if sphere intersects box
Check if sphere intersects with box.
Taken from "Simple Intersection Tests For Games", Gamasutra, Oct 18 1999
◆ intersects() [2/2]
| bool Math::sphere::intersects |
( |
const sphere & | s | ) |
const |
|
inline |
check if 2 spheres overlap
◆ intersects_ray()
| bool Math::sphere::intersects_ray |
( |
const line & | l | ) |
const |
check if sphere intersects ray
◆ project_screen_rh()
project sphere to screen rectangle (right handed coordinate system)
Project the sphere (defined in global space) to a screen space rectangle, given the current View and Projection matrices.
The method assumes that the sphere is at least partially visible.
◆ random_point_on_unit_sphere()
| vec3 Math::sphere::random_point_on_unit_sphere |
( |
| ) |
|
|
static |
generate a random point on a unit sphere
◆ set() [1/2]
◆ set() [2/2]
The documentation for this class was generated from the following files:
- /github/workspace/code/foundation/math/sphere.h
- /github/workspace/code/foundation/math/sphere.cc