Struct GorgonBoundingSphere
Represents a bounding sphere in three dimensional space.
Inherited Members
Namespace: Gorgon.Renderers.Data
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonBoundingSphere : IGorgonEquatableByRef<GorgonBoundingSphere>, IEquatable<GorgonBoundingSphere>
Constructors
| Edit this page View SourceGorgonBoundingSphere(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 SourceCenter
The center of the sphere in three dimensional space.
Declaration
public readonly Vector3 Center
Field Value
Type | Description |
---|---|
Vector3 |
Empty
A default, empty, bounding sphere.
Declaration
public static readonly GorgonBoundingSphere Empty
Field Value
Type | Description |
---|---|
GorgonBoundingSphere |
Radius
The radius of the sphere.
Declaration
public readonly float Radius
Field Value
Type | Description |
---|---|
float |
Properties
| Edit this page View SourceIsEmpty
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 SourceEquals(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 |
|
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. |
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 |
|
Overrides
| Edit this page View SourceFromBox(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. |
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. |
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
| Edit this page View SourceMerge(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. |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(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 |
|
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 |
|