Table of Contents

Struct SphereBounds

Namespace
Misaki.HighPerformance.Mathematics.Geometry
Assembly
Misaki.HighPerformance.Mathematics.dll

Represents a three-dimensional sphere defined by a center point and a radius, typically used for spatial bounding or intersection tests.

public struct SphereBounds : IEquatable<SphereBounds>
Implements
Inherited Members

Constructors

SphereBounds(float3, float)

public SphereBounds(float3 center, float radius)

Parameters

center float3
radius float

Properties

Center

Gets or sets the coordinates of the center point in three-dimensional space.

public float3 Center { readonly get; set; }

Property Value

float3

Radius

Gets or sets the radius of the shape.

public float Radius { readonly get; set; }

Property Value

float

Methods

ClosestPoint(float3)

public readonly float3 ClosestPoint(float3 point)

Parameters

point float3

Returns

float3

Contains(float3)

Determines whether the specified point is contained within the sphere.

public readonly bool Contains(float3 point)

Parameters

point float3

The point to test for inclusion within the sphere.

Returns

bool

true if the point lies inside or on the boundary of the sphere; otherwise, false.

Encapsulate(SphereBounds)

public void Encapsulate(SphereBounds other)

Parameters

other SphereBounds

Encapsulate(float3)

public void Encapsulate(float3 point)

Parameters

point float3

Equals(SphereBounds)

Indicates whether the current object is equal to another object of the same type.

public readonly bool Equals(SphereBounds other)

Parameters

other SphereBounds

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Overlaps(SphereBounds)

Determines whether this sphere intersects with the specified sphere.

public readonly bool Overlaps(SphereBounds other)

Parameters

other SphereBounds

The sphere to test for intersection with this sphere.

Returns

bool

true if the spheres intersect or touch; otherwise, false.

ToString()

Returns the fully qualified type name of this instance.

public override readonly string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(SphereBounds, SphereBounds)

public static bool operator ==(SphereBounds left, SphereBounds right)

Parameters

left SphereBounds
right SphereBounds

Returns

bool

operator !=(SphereBounds, SphereBounds)

public static bool operator !=(SphereBounds left, SphereBounds right)

Parameters

left SphereBounds
right SphereBounds

Returns

bool