#include <Sphere.h>
|
| Sphere () |
|
| Sphere (float radius) |
|
| Sphere (class BinaryInput &b) |
|
void | serialize (class BinaryOutput &b) const |
|
void | deserialize (class BinaryInput &b) |
|
| Sphere (const class Any &a) |
|
Any | toAny () const |
|
| Sphere (const Point3 ¢er, float radius) |
|
virtual | ~Sphere () |
|
bool | operator== (const Sphere &other) const |
|
bool | operator!= (const Sphere &other) const |
|
bool | contains (const Point3 &point) const |
|
bool | contains (const Sphere &other) const |
|
bool | culledBy (const class Plane *plane, int numPlanes, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const |
|
bool | culledBy (const class Plane *plane, int numPlanes, int32 &cullingPlaneIndex=dummy, const uint32 testMask=0xFFFFFFFF) const |
|
bool | culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const |
|
bool | culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex=dummy, const uint32 testMask=0xFFFFFFFF) const |
|
virtual std::string | toString () const |
|
float | volume () const |
|
float | area () const |
|
Point3 | randomSurfacePoint () const |
|
Point3 | randomInteriorPoint () const |
|
void | getBounds (class AABox &out) const |
|
bool | intersects (const Sphere &other) const |
|
Sphere | operator+ (const Vector3 &v) const |
|
Sphere | operator- (const Vector3 &v) const |
|
void | merge (const Sphere &s) |
|
float radius
Definition: Sphere.h:31
static const Vector3 & zero()
Definition: Vector3.cpp:119
Point3 center
Definition: Sphere.h:30
G3D::Sphere::Sphere |
( |
float |
radius | ) |
|
|
inlineexplicit |
float radius
Definition: Sphere.h:31
void deserialize(class BinaryInput &b)
Definition: Sphere.cpp:61
G3D::Sphere::Sphere |
( |
const class Any & |
a | ) |
|
|
explicit |
Format is one of:
- Sphere(point, radius)
- Sphere(radius)
G3D::Sphere::Sphere |
( |
const Point3 & |
center, |
|
|
float |
radius |
|
) |
| |
|
inline |
float radius
Definition: Sphere.h:31
Point3 center
Definition: Sphere.h:30
virtual G3D::Sphere::~Sphere |
( |
| ) |
|
|
inlinevirtual |
float G3D::Sphere::area |
( |
| ) |
const |
248 return (
float)
pi() * 4.0f * powf((
float)
radius, 2.0f);
float radius
Definition: Sphere.h:31
double pi()
Definition: g3dmath.h:147
Returns true if point is less than or equal to radius away from the center.
float radius
Definition: Sphere.h:31
double distance(double x, double y)
Definition: g3dmath.h:731
double square(double fValue)
Definition: g3dmath.h:698
Point3 center
Definition: Sphere.h:30
float radius
Definition: Sphere.h:31
double distance(double x, double y)
Definition: g3dmath.h:731
double square(double fValue)
Definition: g3dmath.h:698
Point3 center
Definition: Sphere.h:30
Conservative culling test that does not produce a mask for children.
63 radius = (float)b.readFloat64();
float radius
Definition: Sphere.h:31
void deserialize(class BinaryInput &b)
Definition: Vector3.cpp:190
Point3 center
Definition: Sphere.h:30
void G3D::Sphere::getBounds |
( |
class AABox & |
out | ) |
const |
float radius
Definition: Sphere.h:31
Point3 center
Definition: Sphere.h:30
Returns the infinite sphere.
float finf()
Definition: g3dmath.cpp:71
Sphere()
Definition: Sphere.h:33
static const Vector3 & zero()
Definition: Vector3.cpp:119
92 return (other.center -
center).length() <= (
radius + other.radius);
float radius
Definition: Sphere.h:31
Point3 center
Definition: Sphere.h:30
Sets this to the smallest sphere that encapsulates both
97 if (other.contains(*
this)) {
102 Vector3 toMe =
center - other.center;
106 const Vector3& B = other.center - toMe * other.radius;
110 radius = (A - B).
length();
float radius
Definition: Sphere.h:31
Vector3 direction() const
Definition: Vector3.h:756
float length(float v)
Definition: vectorMath.h:208
bool contains(const Point3 &point) const
Definition: Sphere.cpp:79
Point3 center
Definition: Sphere.h:30
65 return !((
center == other.center) && (
radius == other.radius));
float radius
Definition: Sphere.h:31
Point3 center
Definition: Sphere.h:30
Translates the sphere
float radius
Definition: Sphere.h:31
Sphere()
Definition: Sphere.h:33
Point3 center
Definition: Sphere.h:30
Translates the sphere
float radius
Definition: Sphere.h:31
Sphere()
Definition: Sphere.h:33
Point3 center
Definition: Sphere.h:30
61 return (
center == other.center) && (
radius == other.radius);
float radius
Definition: Sphere.h:31
Point3 center
Definition: Sphere.h:30
Vector3 G3D::Sphere::randomInteriorPoint |
( |
| ) |
const |
Uniformly distributed on the interior (includes surface)
236 }
while (result.squaredMagnitude() >= 1.0f);
float radius
Definition: Sphere.h:31
float uniformRandom(float low=0.0f, float hi=1.0f)
Definition: g3dmath.h:694
Point3 center
Definition: Sphere.h:30
Vector3 G3D::Sphere::randomSurfacePoint |
( |
| ) |
const |
Uniformly distributed on the surface.
float radius
Definition: Sphere.h:31
static Vector3 random(Random &r=Random::common())
Random unit vector, uniformly distributed on the sphere.
Definition: Vector3.cpp:226
Point3 center
Definition: Sphere.h:30
float radius
Definition: Sphere.h:31
void serialize(class BinaryOutput &b) const
Definition: Vector3.cpp:219
Point3 center
Definition: Sphere.h:30
Any G3D::Sphere::toAny |
( |
| ) |
const |
float radius
Definition: Sphere.h:31
static const Vector3 & zero()
Definition: Vector3.cpp:119
Point3 center
Definition: Sphere.h:30
std::string G3D::Sphere::toString |
( |
| ) |
const |
|
virtual |
74 return format(
"Sphere(<%g, %g, %g>, %g)",
float x
Definition: Vector3.h:62
float radius
Definition: Sphere.h:31
float y
Definition: Vector3.h:62
std::string __cdecl format(const char *fmt...) G3D_CHECK_PRINTF_ARGS
float z
Definition: Vector3.h:62
Point3 center
Definition: Sphere.h:30
float G3D::Sphere::volume |
( |
| ) |
const |
243 return (
float)
pi() * (4.0f / 3.0f) * powf((
float)
radius, 3.0f);
float radius
Definition: Sphere.h:31
double pi()
Definition: g3dmath.h:147
float G3D::Sphere::radius |
The documentation for this class was generated from the following files: