Sphere

Sealed shape drawer that renders solid spheres using the Shapes library. Contains the nested Sphere readonly struct for storing sphere parameters. Sets per-shape thickness before each draw call since Shapes.Draw.Sphere() uses the global thickness state.

Definition

Namespace: Paragon.Core.ShapesDrawer Assembly: Paragon.dll

public sealed class SphereDrawer : ShapeDrawer<SphereDrawer.Sphere>

Inheritance: ShapeDrawer<Sphere> → SphereDrawer

Methods

Add

Enqueues a sphere for rendering this frame.

public void Add(Vector3 center, float radius, Color color, float thickness = 1f)
Parameter
Type
Default
Description

center

Vector3

Sphere center position

radius

float

Sphere radius

color

Color

Sphere color

thickness

float

1f

Sphere thickness in pixels

Draw

Renders all queued spheres. Pushes style, sets Shapes.Draw.Thickness per sphere (since each may have a different value), calls Shapes.Draw.Sphere(), then pops style.

circle-info

Unlike RingDrawer which sets lineGeometry and thicknessSpace once before the loop, SphereDrawer sets Thickness inside the loop for each sphere since each queued sphere may have a different thickness value.

Sphere Struct

Readonly struct holding all parameters for a single sphere draw call.

Examples

Direct Usage via ShapesDrawer

Hit Point Visualization

See Also

Last updated