struct
TSphere
template<typename T>A sphere represented by a center point and a radius.
Public
Constructors
TSphere
Default constructor.
Creates a unit sphere around the origin.
TSphere
TSphere
Default constructor.
Creates a unit sphere around the origin.
TSphere
Methods
Merge
Merges the two spheres, creating a new sphere that encapsulates them both.
Contains
Returns whether or not this sphere contains the provided point.
Intersects
Returns whether or not this sphere intersects another sphere.
Intersects
Returns whether or not this sphere intersects a box.
Intersects
Returns whether or not this sphere intersects a plane.
Intersects
Ray/sphere intersection, returns boolean result and distance to nearest intersection.
- ray
- Ray to intersect with the sphere.
- discardInside
- (optional) If true the intersection will be discarded if ray origin is located within the sphere.
Merge
Merges the two spheres, creating a new sphere that encapsulates them both.
Merge
Expands the sphere so it includes the provided point.
Contains
Returns whether or not this sphere contains the provided point.
Intersects
Returns whether or not this sphere intersects another sphere.
Intersects
Returns whether or not this sphere intersects a box.
Intersects
Returns whether or not this sphere intersects a plane.
Intersects
Ray/sphere intersection, returns boolean result and distance to nearest intersection.
- ray
- Ray to intersect with the sphere.
- discardInside
- (optional) If true the intersection will be discarded if ray origin is located within the sphere.
Merge
Merges the two spheres, creating a new sphere that encapsulates them both.
Merge
Expands the sphere so it includes the provided point.
Contains
Returns whether or not this sphere contains the provided point.
Intersects
Returns whether or not this sphere intersects another sphere.
Intersects
Returns whether or not this sphere intersects a box.
Intersects
Returns whether or not this sphere intersects a plane.
Intersects
Ray/sphere intersection, returns boolean result and distance to nearest intersection.
- ray
- Ray to intersect with the sphere.
- discardInside
- (optional) If true the intersection will be discarded if ray origin is located within the sphere.