Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Sphere class defines a sphere using a center and a radius using vl::real precision. More...
#include <Sphere.hpp>
Public Member Functions | |
Sphere () | |
Constructor: creates a null sphere. More... | |
Sphere (const vec3 ¢er, real radius) | |
Constructor: creates a sphere with the given center and radius. More... | |
Sphere (const AABB &aabb) | |
Copy-constructor. More... | |
void | setNull () |
Sets the sphere as null. More... | |
bool | isNull () const |
Returns true if the sphere is null, ie, if radius is < 0. More... | |
bool | isPoint () const |
Returns true if the sphere as radius == 0. More... | |
void | setCenter (const vec3 ¢er) |
Sets the center of the sphere. More... | |
const vec3 & | center () const |
Returns the center of the sphere. More... | |
void | setRadius (real radius) |
Sets the radius of the sphere. More... | |
real | radius () const |
Returns the radius of the sphere. More... | |
bool | includes (const Sphere &other) const |
Returns true if a sphere contains the specified sphere. More... | |
bool | operator== (const Sphere &other) const |
Returns true if two spheres are identical. More... | |
bool | operator!= (const Sphere &other) const |
Returns true if two spheres are not identical. More... | |
Sphere & | operator= (const AABB &aabb) |
Constructs a sphere that contains the specified AABB. More... | |
Sphere | operator+ (const Sphere &other) |
Returns a sphere that contains the two specified spheres. More... | |
const Sphere & | operator+= (const Sphere &other) |
Enlarges the sphere to contain the specified sphere. More... | |
void | transformed (Sphere &out, const mat4 &mat) const |
Returns a sphere that contains the original sphere transformed by the given matrix. More... | |
Sphere | transformed (const mat4 &mat) const |
Returns a sphere that contains the original sphere transformed by the given matrix. More... | |
Protected Attributes | |
vec3 | mCenter |
real | mRadius |
The Sphere class defines a sphere using a center and a radius using vl::real precision.
Definition at line 43 of file Sphere.hpp.
|
inline |
Constructor: creates a null sphere.
Definition at line 47 of file Sphere.hpp.
|
inline |
Constructor: creates a sphere with the given center and radius.
Definition at line 50 of file Sphere.hpp.
|
inline |
Copy-constructor.
Definition at line 53 of file Sphere.hpp.
|
inline |
Returns the center of the sphere.
Definition at line 68 of file Sphere.hpp.
Referenced by vl::SceneManager::computeBounds(), vl::Camera::computeNearFarOptimizedProjMatrix(), vl::Frustum::cull(), vlX::export_Sphere(), includes(), and operator+=().
|
inline |
Returns true if a sphere contains the specified sphere.
Definition at line 77 of file Sphere.hpp.
References center(), vl::distance(), isNull(), vl::length(), and radius().
Referenced by operator+=().
|
inline |
Returns true if the sphere is null, ie, if radius is < 0.
Definition at line 59 of file Sphere.hpp.
Referenced by vl::SceneManager::computeBounds(), vl::Camera::computeNearFarOptimizedProjMatrix(), vl::Frustum::cull(), includes(), and operator+=().
|
inline |
Returns true if the sphere as radius == 0.
Definition at line 62 of file Sphere.hpp.
|
inline |
Returns true if two spheres are not identical.
Definition at line 98 of file Sphere.hpp.
References vl::operator==().
Returns a sphere that contains the two specified spheres.
Definition at line 117 of file Sphere.hpp.
Enlarges the sphere to contain the specified sphere.
Definition at line 124 of file Sphere.hpp.
References center(), includes(), isNull(), vl::Vector3< T_Scalar >::isNull(), vl::length(), vl::Vector3< T_Scalar >::normalize(), and radius().
Constructs a sphere that contains the specified AABB.
Definition at line 104 of file Sphere.hpp.
References vl::AABB::center(), vl::AABB::isNull(), vl::length(), vl::AABB::maxCorner(), and vl::AABB::minCorner().
|
inline |
Returns true if two spheres are identical.
Definition at line 92 of file Sphere.hpp.
|
inline |
Returns the radius of the sphere.
Definition at line 74 of file Sphere.hpp.
Referenced by vl::Camera::adjustView(), vl::SceneManager::computeBounds(), vl::Camera::computeNearFarOptimizedProjMatrix(), vl::Frustum::cull(), vlX::export_Sphere(), includes(), and operator+=().
|
inline |
Sets the center of the sphere.
Definition at line 65 of file Sphere.hpp.
Referenced by vl::SceneManager::computeBounds(), and vlX::import_Sphere().
|
inline |
|
inline |
Sets the radius of the sphere.
Definition at line 71 of file Sphere.hpp.
Referenced by vl::SceneManager::computeBounds(), and vlX::import_Sphere().
Returns a sphere that contains the original sphere transformed by the given matrix.
Definition at line 157 of file Sphere.hpp.
References mCenter, mRadius, setNull(), and vl::sqrt().
Referenced by vl::Camera::computeNearFarOptimizedProjMatrix().
Returns a sphere that contains the original sphere transformed by the given matrix.
Definition at line 181 of file Sphere.hpp.
|
protected |
Definition at line 189 of file Sphere.hpp.
Referenced by operator==(), and transformed().
|
protected |
Definition at line 190 of file Sphere.hpp.
Referenced by operator==(), and transformed().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:54.
© Copyright Michele Bosi. All rights reserved.