3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Math.BoundingSphere Struct Reference

Represents an bounding sphere defined by a center point and a radius. More...

#include <BoundingSphere.hpp>

Collaboration diagram for Engine3DRadSpace.Math.BoundingSphere:

Public Member Functions

 BoundingSphere (Vector3 position, float radius)
 BoundingSphere ()
 Default constructor. Creates a null bounding sphere with center at (0,0,0) and radius 0.
 BoundingSphere (const Vector3 &center, float radius)
 Creates a bounding sphere with the given center and radius.
 BoundingSphere (const BoundingBox &box)
 Creates a bounding sphere that contains the given bounding box.
 BoundingSphere (const BoundingSphere &sph1, const BoundingSphere &sph2)
 Creates a bounding sphere that contains both given bounding spheres.
 BoundingSphere (const BoundingSphere &sph, const BoundingBox &box)
 Creates a bounding sphere that contains the given bounding sphere and bounding box.
 BoundingSphere (const BoundingBox &box1, const BoundingBox &box2)
 Creates a bounding sphere that contains both given bounding boxes.
bool Intersects (const BoundingBox &box) const
 Determines whether this bounding sphere intersects with the given bounding box.
bool Intersects (const BoundingSphere &sphere) const
 Determines whether this bounding sphere intersects with the given bounding sphere.
bool Intersects (const BoundingPlane &plane) const
 Determines whether this bounding sphere intersects with the given bounding plane.
bool Intersects (const Ray &ray) const
 Determines whether this bounding sphere intersects with the given ray.
bool Contains (const Vector3 &p) const
 Determines whether this bounding sphere contains the given point.

Public Attributes

Vector3 Position
float Radius
 Radius of the sphere.
Vector3 Center
 Center of the sphere.

Detailed Description

Represents an bounding sphere defined by a center point and a radius.

Constructor & Destructor Documentation

◆ BoundingSphere() [1/7]

Engine3DRadSpace.Math.BoundingSphere.BoundingSphere ( Vector3 position,
float radius )
inline

◆ BoundingSphere() [2/7]

Default constructor. Creates a null bounding sphere with center at (0,0,0) and radius 0.

◆ BoundingSphere() [3/7]

BoundingSphere::BoundingSphere ( const Vector3 & center,
float radius )

Creates a bounding sphere with the given center and radius.

Parameters
centerCenter of the sphere
radiusRadius of the sphere

◆ BoundingSphere() [4/7]

Creates a bounding sphere that contains the given bounding box.

Parameters
boxThe bounding box to contain

◆ BoundingSphere() [5/7]

Creates a bounding sphere that contains both given bounding spheres.

Parameters
sph1The first bounding sphere
sph2The second bounding sphere

◆ BoundingSphere() [6/7]

Creates a bounding sphere that contains the given bounding sphere and bounding box.

Parameters
sphThe bounding sphere to contain
boxThe bounding box to contain

◆ BoundingSphere() [7/7]

BoundingSphere::BoundingSphere ( const BoundingBox & box1,
const BoundingBox & box2 )

Creates a bounding sphere that contains both given bounding boxes.

Parameters
box1The first bounding box
box2The second bounding box

Member Function Documentation

◆ Contains()

bool Engine3DRadSpace.Math.BoundingSphere::Contains ( const Vector3 & p) const

Determines whether this bounding sphere contains the given point.

Parameters
pThe point to test for containment
Returns
True if the bounding sphere contains the point, false otherwise

◆ Intersects() [1/4]

bool Engine3DRadSpace.Math.BoundingSphere::Intersects ( const BoundingBox & box) const

Determines whether this bounding sphere intersects with the given bounding box.

Parameters
boxThe bounding box to test for intersection
Returns
True if the bounding sphere intersects with the bounding box, false otherwise

◆ Intersects() [2/4]

bool Engine3DRadSpace.Math.BoundingSphere::Intersects ( const BoundingPlane & plane) const

Determines whether this bounding sphere intersects with the given bounding plane.

Parameters
planeThe bounding plane to test for intersection
Returns
True if the bounding sphere intersects with the bounding plane, false otherwise

◆ Intersects() [3/4]

bool Engine3DRadSpace.Math.BoundingSphere::Intersects ( const BoundingSphere & sphere) const

Determines whether this bounding sphere intersects with the given bounding sphere.

Parameters
sphereThe bounding sphere to test for intersection
Returns
True if the bounding sphere intersects with the bounding sphere, false otherwise

◆ Intersects() [4/4]

bool Engine3DRadSpace.Math.BoundingSphere::Intersects ( const Ray & ray) const

Determines whether this bounding sphere intersects with the given ray.

Parameters
rayThe ray to test for intersection
Returns
True if the bounding sphere intersects with the ray, false otherwise

Member Data Documentation

◆ Center

Vector3 Engine3DRadSpace.Math.BoundingSphere.Center

Center of the sphere.

◆ Position

Vector3 Engine3DRadSpace.Math.BoundingSphere.Position

◆ Radius

float Engine3DRadSpace.Math.BoundingSphere.Radius

Radius of the sphere.


The documentation for this struct was generated from the following files: