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
Properties
Center
Gets or sets the coordinates of the center point in three-dimensional space.
public float3 Center { readonly get; set; }
Property Value
Radius
Gets or sets the radius of the shape.
public float Radius { readonly get; set; }
Property Value
Methods
ClosestPoint(float3)
public readonly float3 ClosestPoint(float3 point)
Parameters
pointfloat3
Returns
Contains(float3)
Determines whether the specified point is contained within the sphere.
public readonly bool Contains(float3 point)
Parameters
pointfloat3The 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
otherSphereBounds
Encapsulate(float3)
public void Encapsulate(float3 point)
Parameters
pointfloat3
Equals(SphereBounds)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(SphereBounds other)
Parameters
otherSphereBoundsAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
otherSphereBoundsThe 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
leftSphereBoundsrightSphereBounds
Returns
operator !=(SphereBounds, SphereBounds)
public static bool operator !=(SphereBounds left, SphereBounds right)
Parameters
leftSphereBoundsrightSphereBounds