Vixen
02b45cc4
csharp
public readonly struct BoundingSphere

A bounding sphere. Four floats against a box's six, rotation-invariant, and a single subtraction to test — which is why it is the first cull and the box the second.

No guide page documents this yet — the page shows what the code says about itself.

Fields and properties (4)

  • public readonly Vector3 Center

    The centre.

  • public readonly float Radius

    The radius.

  • public static BoundingSphere Empty

    The sphere that contains nothing.

  • public bool IsEmpty

    Whether the sphere contains nothing.

Methods (19)

  • public BoundingSphere(Vector3 center, float radius)

    Builds a sphere.

  • public static BoundingSphere FromPoints(ReadOnlySpan<Vector3> points)

    A sphere containing every point, centred on the midpoint of their bounding box.

  • public static BoundingSphere FromBox(BoundingBox box)

    The sphere circumscribing a box.

  • public static BoundingSphere Merge(BoundingSphere left, BoundingSphere right)

    The smallest sphere containing both.

  • public bool Contains(Vector3 point)

    Whether a point is inside or on the surface.

  • public ContainmentType Contains(BoundingSphere other)

    How another sphere sits relative to this one.

  • public ContainmentType Contains(BoundingBox box)

    How a box sits relative to this sphere.

  • public bool Intersects(BoundingSphere other)

    Whether two spheres overlap.

  • public bool Intersects(BoundingBox box)

    Whether a box overlaps this sphere.

  • public PlaneIntersectionType Intersects(Plane plane)

    Which side of a plane the sphere is on.

  • public static BoundingSphere Transform(BoundingSphere sphere, in Matrix4x4 matrix)

    The sphere after a transform. The radius grows by the largest of the three axis scales, because a sphere under a non-uniform scale is an ellipsoid and this is its bound.

  • public static bool NearEqual(BoundingSphere left, BoundingSphere right, float tolerance = 1E-06)

    Whether two spheres agree to within a tolerance.

  • public static bool operator ==(BoundingSphere left, BoundingSphere right)

    Exact equality, IEEE semantics. See NearEqual.

  • public static bool operator !=(BoundingSphere left, BoundingSphere right)

    The negation of op_Equality.

  • public bool Equals(BoundingSphere other)

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

  • public override bool Equals(object? obj)

    Indicates whether this instance and a specified object are equal.

  • public override int GetHashCode()

    Returns the hash code for this instance.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

  • public string ToString(string? format, IFormatProvider? formatProvider)

    Formats the value of the current instance using the specified format.

Used by (34)

  • AssetVirtualGeometrySourceVixen.Engine.Renderer
  • BoundingBoxVixen.Core.Mathematics
  • BoundingFrustumVixen.Core.Mathematics
  • ConstraintGizmosVixen.Animation
  • CullJobVixen.Rendering
  • DebugDrawVixen.Engine
  • DeferredClusterVixen.Rendering.Tests
  • EntryVixen.Engine.Renderer
  • EntryVixen.Rendering
  • ForwardLightingRenderFeatureVixen.Rendering
  • GeometryResidencyVixen.Rendering
  • GpuCullingVixen.Rendering
  • IVirtualGeometrySourceVixen.Rendering
  • InstanceCullerVixen.Rendering
  • LodRenderFeatureVixen.Rendering
  • MeshExtractionSystemVixen.Rendering
  • MeshExtractionTestsVixen.Rendering.Tests
  • NoClustersVixen.Rendering.Tests
  • OneClusterVixen.Rendering.Tests
  • RayVixen.Core.Mathematics
  • RenderHandleVixen.Rendering
  • RenderObjectVixen.Rendering
  • RenderObjectStoreTestsVixen.Rendering.Tests
  • RenderSystemVixen.Rendering
  • SurfaceGeometryVixen.Rendering
  • SurfaceGeometryTestsVixen.Rendering.Tests
  • TypeRegistrationVixen.Core.Mathematics
  • VfxExtractionSystemVixen.Rendering
  • VfxExtractionTestsVixen.Rendering.Tests
  • VideoSurfaceUploaderVixen.Video.Rendering
  • VisibilityGroupTestsVixen.Rendering.Tests
  • Vixen_Core_Mathematics_BoundingSphereSerializerVixen.Core.Mathematics
  • VolumeTestsVixen.Core.Mathematics.Tests
  • ScenePickerVixen.Editor.SceneView