Gorgon
Show / Hide Table of Contents

Struct GorgonBoundingSphere

Represents a bounding sphere in three dimensional space.

Implements
IGorgonEquatableByRef<GorgonBoundingSphere>
IEquatable<GorgonBoundingSphere>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: Gorgon.Renderers.Data
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonBoundingSphere : IGorgonEquatableByRef<GorgonBoundingSphere>, IEquatable<GorgonBoundingSphere>

Constructors

| Edit this page View Source

GorgonBoundingSphere(in Vector3, float)

Initializes a new instance of the GorgonBoundingSphere struct.

Declaration
public GorgonBoundingSphere(in Vector3 center, float radius)
Parameters
Type Name Description
Vector3 center

The center of the sphere in three dimensional space.

float radius

The radius of the sphere.

Fields

| Edit this page View Source

Center

The center of the sphere in three dimensional space.

Declaration
public readonly Vector3 Center
Field Value
Type Description
Vector3
| Edit this page View Source

Empty

A default, empty, bounding sphere.

Declaration
public static readonly GorgonBoundingSphere Empty
Field Value
Type Description
GorgonBoundingSphere
| Edit this page View Source

Radius

The radius of the sphere.

Declaration
public readonly float Radius
Field Value
Type Description
float

Properties

| Edit this page View Source

IsEmpty

Property to return whether this bounding sphere is empty or not.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

Equals(GorgonBoundingSphere)

Determines whether the specified Vector4 is equal to this instance.

Declaration
public bool Equals(GorgonBoundingSphere value)
Parameters
Type Name Description
GorgonBoundingSphere value

The Vector4 to compare with this instance.

Returns
Type Description
bool

true if the specified Vector4 is equal to this instance; otherwise, false.

| Edit this page View Source

Equals(in GorgonBoundingSphere)

Function to compare this instance with another.

Declaration
public bool Equals(in GorgonBoundingSphere other)
Parameters
Type Name Description
GorgonBoundingSphere other

The other instance to use for comparison.

Returns
Type Description
bool

true if equal, false if not.

| Edit this page View Source

Equals(object)

Determines whether the specified object is equal to this instance.

Declaration
public override bool Equals(object value)
Parameters
Type Name Description
object value

The object to compare with this instance.

Returns
Type Description
bool

true if the specified object is equal to this instance; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

FromBox(in GorgonBoundingBox, out GorgonBoundingSphere)

Constructs a GorgonBoundingSphere from a given box.

Declaration
public static void FromBox(in GorgonBoundingBox box, out GorgonBoundingSphere result)
Parameters
Type Name Description
GorgonBoundingBox box

The box that will designate the extents of the sphere.

GorgonBoundingSphere result

When the method completes, the newly constructed bounding sphere.

| Edit this page View Source

FromPoints(Span<Vector3>, out GorgonBoundingSphere)

Constructs a GorgonBoundingSphere that fully contains the given points.

Declaration
public static void FromPoints(Span<Vector3> points, out GorgonBoundingSphere result)
Parameters
Type Name Description
Span<Vector3> points

The points that will be contained by the sphere.

GorgonBoundingSphere result

When the method completes, contains the newly constructed bounding sphere.

| Edit this page View Source

GetHashCode()

Returns a hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides
ValueType.GetHashCode()
| Edit this page View Source

Merge(in GorgonBoundingSphere, in GorgonBoundingSphere, out GorgonBoundingSphere)

Constructs a GorgonBoundingSphere that is the as large as the total combined area of the two specified spheres.

Declaration
public static void Merge(in GorgonBoundingSphere value1, in GorgonBoundingSphere value2, out GorgonBoundingSphere result)
Parameters
Type Name Description
GorgonBoundingSphere value1

The first sphere to merge.

GorgonBoundingSphere value2

The second sphere to merge.

GorgonBoundingSphere result

When the method completes, contains the newly constructed bounding sphere.

| Edit this page View Source

ToString()

Returns a string that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents this instance.

Overrides
ValueType.ToString()

Operators

| Edit this page View Source

operator ==(in GorgonBoundingSphere, in GorgonBoundingSphere)

Tests for equality between two objects.

Declaration
public static bool operator ==(in GorgonBoundingSphere left, in GorgonBoundingSphere right)
Parameters
Type Name Description
GorgonBoundingSphere left

The first value to compare.

GorgonBoundingSphere right

The second value to compare.

Returns
Type Description
bool

true if left has the same value as right; otherwise, false.

| Edit this page View Source

operator !=(in GorgonBoundingSphere, in GorgonBoundingSphere)

Tests for inequality between two objects.

Declaration
public static bool operator !=(in GorgonBoundingSphere left, in GorgonBoundingSphere right)
Parameters
Type Name Description
GorgonBoundingSphere left

The first value to compare.

GorgonBoundingSphere right

The second value to compare.

Returns
Type Description
bool

true if left has a different value than right; otherwise, false.

Implements

IGorgonEquatableByRef<T>
IEquatable<T>

Extension Methods

GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author