Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DSphere Class Reference

The U4DSphere class implements a mathematical representation of a sphere. More...

Public Member Functions

 U4DSphere ()
 Constructor which constructs a sphere with center location set to origin and radius equal to zero.
 
 U4DSphere (U4DPoint3n &uCenter, float uRadius)
 Constructor which constructs a sphere with the given center location and radius.
 
 ~U4DSphere ()
 Destructor of the class.
 
void setCenter (U4DPoint3n &uCenter)
 Method which sets the center location of the sphere. More...
 
void setRadius (float uRadius)
 Method which sets the radius of the sphere. More...
 
U4DPoint3n getCenter ()
 Method which returns the center location of the sphere. More...
 
float getRadius ()
 Method which returns the radius of the sphere. More...
 
bool intersectionWithVolume (U4DSphere &uSphere)
 Method which test the intersection between two spheres. More...
 
bool intersectionWithVolume (U4DSphere &uSphere, U4DPlane &uPlane)
 Method which test the intersection between two spheres and returns the intersection plane. More...
 

Public Attributes

U4DPoint3n center
 3D point representing the center of a sphere
 
float radius
 Radius of the sphere.
 

Detailed Description

The U4DSphere class implements a mathematical representation of a sphere.

Member Function Documentation

◆ getCenter()

U4DPoint3n U4DEngine::U4DSphere::getCenter ( )

Method which returns the center location of the sphere.

Returns
Returns the center location of the sphere

◆ getRadius()

float U4DEngine::U4DSphere::getRadius ( )

Method which returns the radius of the sphere.

Returns
Returns the radius of the sphere

◆ intersectionWithVolume() [1/2]

bool U4DEngine::U4DSphere::intersectionWithVolume ( U4DSphere uSphere)

Method which test the intersection between two spheres.

Parameters
uSphereSphere to test intersection with
Returns
Returns true if two spheres are intersecting

◆ intersectionWithVolume() [2/2]

bool U4DEngine::U4DSphere::intersectionWithVolume ( U4DSphere uSphere,
U4DPlane uPlane 
)

Method which test the intersection between two spheres and returns the intersection plane.

Parameters
uSphereSphere to test intersection with
uPlaneIntersection plane created during the intersection
Returns
Returns true if two spheres are intersecting

◆ setCenter()

void U4DEngine::U4DSphere::setCenter ( U4DPoint3n uCenter)

Method which sets the center location of the sphere.

Parameters
uCenterCenter location of the sphere

◆ setRadius()

void U4DEngine::U4DSphere::setRadius ( float  uRadius)

Method which sets the radius of the sphere.

Parameters
uRadiusRadius of the sphere