C# Class Axiom.Math.Sphere

A standard sphere, used mostly for bounds checking.
A sphere in math texts is normally represented by the function x^2 + y^2 + z^2 = r^2 (for sphere's centered on the origin). We store spheres simply as a center point and a radius.
Show file Open project: WolfgangSt/axiom Class Usage Examples

Public Methods

Method Description
Equals ( object obj ) : bool
GetHashCode ( ) : int
Intersects ( AxisAlignedBox box ) : bool

Returns whether or not this sphere interects a box.

Intersects ( Plane plane ) : bool

Returns whether or not this sphere interects a plane.

Intersects ( Sphere sphere ) : bool

Tests for intersection between this sphere and another sphere.

Intersects ( Vector3 vector ) : bool

Returns whether or not this sphere interects a Vector3.

Sphere ( ) : System

Creates a unit sphere centered at the origin.

Sphere ( Vector3 center, Real radius ) : System

Creates an arbitrary spehere.

operator ( ) : bool

Method Details

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

GetHashCode() public method

public GetHashCode ( ) : int
return int

Intersects() public method

Returns whether or not this sphere interects a box.
public Intersects ( AxisAlignedBox box ) : bool
box AxisAlignedBox
return bool

Intersects() public method

Returns whether or not this sphere interects a plane.
public Intersects ( Plane plane ) : bool
plane Plane
return bool

Intersects() public method

Tests for intersection between this sphere and another sphere.
public Intersects ( Sphere sphere ) : bool
sphere Sphere Other sphere.
return bool

Intersects() public method

Returns whether or not this sphere interects a Vector3.
public Intersects ( Vector3 vector ) : bool
vector Vector3
return bool

Sphere() public method

Creates a unit sphere centered at the origin.
public Sphere ( ) : System
return System

Sphere() public method

Creates an arbitrary spehere.
public Sphere ( Vector3 center, Real radius ) : System
center Vector3 Center point of the sphere.
radius Real Radius of the sphere.
return System

operator() public static method

public static operator ( ) : bool
return bool