feat: added sphere primitive

This commit is contained in:
2025-10-21 19:06:58 +03:00
parent 896f7876c1
commit 0db2cae1bb
7 changed files with 230 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ public readonly struct AABB3D(Vector3D lowerBoundary, Vector3D upperBoundary) :
public static bool operator ==(AABB3D left, AABB3D right) => left.UpperBoundary == right.UpperBoundary && left.LowerBoundary == right.LowerBoundary;
public static bool operator !=(AABB3D left, AABB3D right) => left.UpperBoundary != right.UpperBoundary || left.LowerBoundary != right.LowerBoundary;
public static implicit operator AABB3D(Sphere3D sphere) => new(sphere.Center - new Vector3D(sphere.Radius, sphere.Radius, sphere.Radius), sphere.Center + new Vector3D(sphere.Radius, sphere.Radius, sphere.Radius));
/// <summary>
/// Creates an <see cref="AABB3D"/> from a collection of <see cref="Vector3D"/>s.
/// </summary>