Sphere
struct Sphereimport Sphere from Wax;A 3D ball described by a center and radius. Supply a finite, nonnegative radius; construction does not validate it. Containment and intersection include the boundary.
Members
centerfield
public float3 centerThe center position.
radiusfield
public float radiusThe radius, expected to be nonnegative.
constructorconstructor
public constructor (float3 center, float radius)Stores the center and radius without validation.
volumegetter
public get volume() : floatReturns (4/3)*pi times radius cubed.
surfaceAreagetter
public get surfaceArea() : floatReturns 4*pi times radius squared.
boundingBoxgetter
public get boundingBox() : AABBReturns the tight axis-aligned bounding box.
Containsmethod
public fn Contains(float3 point) : boolTests whether a point lies inside or on the boundary.
Intersectsmethod
public fn Intersects(Sphere other) : boolTests whether two balls overlap or touch.
IntersectsAABBmethod
public fn IntersectsAABB(AABB box) : boolTests intersection with an axis-aligned box, including tangency. Supply ordered box bounds.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.