Header menu logo Nu

Sphere Type

Describes a sphere in 3D-space for bounding operations. Copied from - https://github.com/MonoGame/MonoGame/blob/v3.8/MonoGame.Framework/BoundingSphere.cs

Constructors

Constructor Description

Sphere(center, radius)

Full Usage: Sphere(center, radius)

Parameters:
    center : Vector3 - The sphere center.
    radius : float32 - The sphere radius.

Constructs a bounding sphere with the specified center and radius.

center : Vector3

The sphere center.

radius : float32

The sphere radius.

Instance members

Instance member Description

this.Contains

Full Usage: this.Contains

Parameters:
    box : Box3 - The box for testing.

Returns: ContainmentType The containment type.

Test if a bounding box is fully inside, outside, or just intersecting the sphere. NOTE: this allocates an array on every call! TODO: see if we can reasonably remove said allocation.

box : Box3

The box for testing.

Returns: ContainmentType

The containment type.

this.Contains

Full Usage: this.Contains

Parameters:
    box : inref<Box3> - The box for testing.
    result : byref<ContainmentType> - The containment type as an output parameter.

Test if a bounding box is fully inside, outside, or just intersecting the sphere.

box : inref<Box3>

The box for testing.

result : byref<ContainmentType>

The containment type as an output parameter.

this.Contains

Full Usage: this.Contains

Parameters:
    frustum : Frustum - The frustum for testing.

Returns: ContainmentType The containment type.

Test if a frustum is fully inside, outside, or just intersecting the sphere.

frustum : Frustum

The frustum for testing.

Returns: ContainmentType

The containment type.

this.Contains

Full Usage: this.Contains

Parameters:
    frustum : inref<Frustum> - The frustum for testing.
    result : byref<ContainmentType> - The containment type as an output parameter.

Test if a frustum is fully inside, outside, or just intersecting the sphere.

frustum : inref<Frustum>

The frustum for testing.

result : byref<ContainmentType>

The containment type as an output parameter.

this.Contains

Full Usage: this.Contains

Parameters:
    sphere : Sphere - The other sphere for testing.

Returns: ContainmentType The containment type.

Test if a sphere is fully inside, outside, or just intersecting the sphere.

sphere : Sphere

The other sphere for testing.

Returns: ContainmentType

The containment type.

this.Contains

Full Usage: this.Contains

Parameters:
    sphere : inref<Sphere> - The other sphere for testing.
    result : byref<ContainmentType> - The containment type as an output parameter.

Test if a sphere is fully inside, outside, or just intersecting the sphere.

sphere : inref<Sphere>

The other sphere for testing.

result : byref<ContainmentType>

The containment type as an output parameter.

this.Contains

Full Usage: this.Contains

Parameters:
    point : Vector3 - The vector in 3D-space for testing.

Returns: ContainmentType The containment type.

Test if a point is fully inside, outside, or just intersecting the sphere.

point : Vector3

The vector in 3D-space for testing.

Returns: ContainmentType

The containment type.

this.Contains

Full Usage: this.Contains

Parameters:
    point : inref<Vector3> - The vector in 3D-space for testing.
    result : byref<ContainmentType> - The containment type as an output parameter.

Test if a point is fully inside, outside, or just intersecting the sphere.

point : inref<Vector3>

The vector in 3D-space for testing.

result : byref<ContainmentType>

The containment type as an output parameter.

this.Equals

Full Usage: this.Equals

Parameters:
Returns: bool true if the instances are equal; false otherwise.
Modifiers: abstract

Compares whether current instance is equal to specified Sphere.

other : Sphere

The Sphere to compare.

Returns: bool

true if the instances are equal; false otherwise.

this.Equals

Full Usage: this.Equals

Parameters:
    obj : obj - The Object to compare.

Returns: bool true if the instances are equal; false otherwise.
Modifiers: abstract

Compares whether current instance is equal to specified Object.

obj : obj

The Object to compare.

Returns: bool

true if the instances are equal; false otherwise.

this.GetHashCode

Full Usage: this.GetHashCode

Returns: int Hash code of this Sphere.
Modifiers: abstract

Gets the hash code of this Sphere.

Returns: int

Hash code of this Sphere.

this.Intersects

Full Usage: this.Intersects

Parameters:
    box : Box3 - The box for testing.

Returns: bool true if Box3 intersects with this sphere; false otherwise.

Gets whether or not a specified Box3 intersects with this sphere.

box : Box3

The box for testing.

Returns: bool

true if Box3 intersects with this sphere; false otherwise.

this.Intersects

Full Usage: this.Intersects

Parameters:
    box : inref<Box3> - The box for testing.
    result : byref<bool> - true if Box3 intersects with this sphere; false otherwise. As an output parameter.

Gets whether or not a specified Box3 intersects with this sphere.

box : inref<Box3>

The box for testing.

result : byref<bool>

true if Box3 intersects with this sphere; false otherwise. As an output parameter.

this.Intersects

Full Usage: this.Intersects

Parameters:
    sphere : Sphere - The other sphere for testing.

Returns: bool true if other Sphere intersects with this sphere; false otherwise.

Gets whether or not the other Sphere intersects with this sphere.

sphere : Sphere

The other sphere for testing.

Returns: bool

true if other Sphere intersects with this sphere; false otherwise.

this.Intersects

Full Usage: this.Intersects

Parameters:
    sphere : inref<Sphere> - The other sphere for testing.
    result : byref<bool> - true if other Sphere intersects with this sphere; false otherwise. As an output parameter.

Gets whether or not the other Sphere intersects with this sphere.

sphere : inref<Sphere>

The other sphere for testing.

result : byref<bool>

true if other Sphere intersects with this sphere; false otherwise. As an output parameter.

this.Intersects

Full Usage: this.Intersects

Parameters:
    plane : Plane3 - The plane for testing.

Returns: PlaneIntersectionType Type of intersection.

Gets whether or not a specified Plane3 intersects with this sphere.

plane : Plane3

The plane for testing.

Returns: PlaneIntersectionType

Type of intersection.

this.Intersects

Full Usage: this.Intersects

Parameters:

Gets whether or not a specified Plane3 intersects with this sphere.

plane : inref<Plane3>

The plane for testing.

result : byref<PlaneIntersectionType>

Type of intersection as an output parameter.

this.Intersects

Full Usage: this.Intersects

Parameters:
    ray : Ray3 - The ray for testing.

Returns: Nullable<float32> Distance of ray intersection or null if there is no intersection.

Gets whether or not a specified Ray3 intersects with this sphere.

ray : Ray3

The ray for testing.

Returns: Nullable<float32>

Distance of ray intersection or null if there is no intersection.

this.Intersects

Full Usage: this.Intersects

Parameters:
    ray : inref<Ray3> - The ray for testing.
    result : byref<Nullable<float32>> - Distance of ray intersection or null if there is no intersection as an output parameter.

Gets whether or not a specified Ray3 intersects with this sphere.

ray : inref<Ray3>

The ray for testing.

result : byref<Nullable<float32>>

Distance of ray intersection or null if there is no intersection as an output parameter.

this.Nearest

Full Usage: this.Nearest

Parameters:
Returns: Vector3
position : Vector3
Returns: Vector3

this.ToString

Full Usage: this.ToString

Returns: string A String representation of this Sphere.
Modifiers: abstract

Returns a String representation of this Sphere in the format: {Center:[Sphere.Center] Radius:[Sphere.Radius]}

Returns: string

A String representation of this Sphere.

this.Transform

Full Usage: this.Transform

Parameters:
    matrix : Matrix4x4 - The transformation !:Matrix.

Returns: Sphere Transformed Sphere.

Creates a new Sphere that contains a transformation of translation and scale from this sphere by the specified !:Matrix.

matrix : Matrix4x4

The transformation !:Matrix.

Returns: Sphere

Transformed Sphere.

this.Transform

Full Usage: this.Transform

Parameters:
    matrix : inref<Matrix4x4> - The transformation !:Matrix.
    result : byref<Sphere> - Transformed Sphere as an output parameter.

Creates a new Sphere that contains a transformation of translation and scale from this sphere by the specified !:Matrix.

matrix : inref<Matrix4x4>

The transformation !:Matrix.

result : byref<Sphere>

Transformed Sphere as an output parameter.

Static members

Static member Description

a <> b

Full Usage: a <> b

Parameters:
    a : Sphere - Sphere instance on the left of the not equal sign.
    b : Sphere - Sphere instance on the right of the not equal sign.

Returns: bool true if the instances are not equal; false otherwise.

Compares whether two Sphere instances are not equal.

a : Sphere

Sphere instance on the left of the not equal sign.

b : Sphere

Sphere instance on the right of the not equal sign.

Returns: bool

true if the instances are not equal; false otherwise.

a = b

Full Usage: a = b

Parameters:
    a : Sphere - Sphere instance on the left of the equal sign.
    b : Sphere - Sphere instance on the right of the equal sign.

Returns: bool true if the instances are equal; false otherwise.

Compares whether two Sphere instances are equal.

a : Sphere

Sphere instance on the left of the equal sign.

b : Sphere

Sphere instance on the right of the equal sign.

Returns: bool

true if the instances are equal; false otherwise.

Sphere.CreateFromBox3(box)

Full Usage: Sphere.CreateFromBox3(box)

Parameters:
    box : Box3 - The box to create the sphere from.

Returns: Sphere The new Sphere.

Creates the smallest Sphere that can contain a specified Box3.

box : Box3

The box to create the sphere from.

Returns: Sphere

The new Sphere.

Sphere.CreateFromBox3(box, result)

Full Usage: Sphere.CreateFromBox3(box, result)

Parameters:
    box : inref<Box3> - The box to create the sphere from.
    result : byref<Sphere> - The new Sphere as an output parameter.

Creates the smallest Sphere that can contain a specified Box3.

box : inref<Box3>

The box to create the sphere from.

result : byref<Sphere>

The new Sphere as an output parameter.

Sphere.CreateFromFrustum(frustum)

Full Usage: Sphere.CreateFromFrustum(frustum)

Parameters:
    frustum : Frustum - The frustum to create the sphere from.

Returns: Sphere The new Sphere.

Creates the smallest Sphere that can contain a specified Frustum.

frustum : Frustum

The frustum to create the sphere from.

Returns: Sphere

The new Sphere.

Sphere.CreateFromPoints(points)

Full Usage: Sphere.CreateFromPoints(points)

Parameters:
Returns: Sphere The new Sphere.

Creates the smallest Sphere that can contain a specified list of points in 3D-space.

points : IEnumerable<Vector3>

List of point to create the sphere from.

Returns: Sphere

The new Sphere.

Sphere.CreateMerged(original, additional)

Full Usage: Sphere.CreateMerged(original, additional)

Parameters:
    original : Sphere - First sphere.
    additional : Sphere - Second sphere.

Returns: Sphere The new Sphere.

Creates the smallest Sphere that can contain two spheres.

original : Sphere

First sphere.

additional : Sphere

Second sphere.

Returns: Sphere

The new Sphere.

Sphere.CreateMerged(original, additional, result)

Full Usage: Sphere.CreateMerged(original, additional, result)

Parameters:
    original : inref<Sphere> - First sphere.
    additional : inref<Sphere> - Second sphere.
    result : byref<Sphere> - The new Sphere as an output parameter.

Creates the smallest Sphere that can contain two spheres.

original : inref<Sphere>

First sphere.

additional : inref<Sphere>

Second sphere.

result : byref<Sphere>

The new Sphere as an output parameter.

Type something to start searching.