Class ScyllaDomeShape
Parametric hemisphere (dome): the upper half of a UV sphere. Configurable radius,
longitudinal segments (slices), and latitudinal rings (stacks), with an optional bottom
disc that closes the underside into a sealed solid. Centered on the origin: the equator
sits at y = -radius/2 and the apex at y = +radius/2, so the bounding box
is symmetric around (0, 0, 0).
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Dome")]
public sealed class ScyllaDomeShape : ScyllaShapeBase3D
Remarks
The dome surface is built as a latitude / longitude grid from equator (ring 0,
phi = 0) to apex (ring = rings, phi = pi/2), producing
(rings + 1) * (segments + 1) surface vertices. Normals point radially outward
from the sphere center, giving smooth shading. When BuildBase is
true (the default), a bottom disc fan with segments + 2 additional
vertices is appended; the disc center faces -Y and the rim normals also face -Y,
sealing the dome into a closed solid.
Segments is clamped to [3, 256] and Rings is
clamped to [2, 128] at build time.
Per-face coloring uses per-vertex dispatch: Resolve(int, int, Vector3) is called once per vertex (passing the vertex index as the face index) rather than once per logical triangle region. Under GradientByY this produces a smooth gradient from the equator to the apex; under Cycle or Hash it produces per-vertex color variation. See IFaceColorResolver for the full dispatch contract.
To render the same hemisphere from the inside as a background environment, use ScyllaSkyDomeShape, which has reversed winding and inward-pointing normals and omits the bottom disc entirely.
Properties
BuildBase
When true, a bottom disc fan facing -Y is appended and the dome becomes a
sealed closed solid. When false, the underside is open (no disc geometry).
Setting this property triggers an immediate mesh rebuild via
Rebuild().
Declaration
public bool BuildBase { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Radius
Dome radius in local units. Must be positive. Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float Radius { get; set; }
Property Value
| Type | Description |
|---|---|
| float | The dome radius. Default is |
Rings
Number of latitudinal rings (stacks) from the equator to the apex. The value is
clamped to [2, 128] at build time. Setting this property triggers an immediate
mesh rebuild via Rebuild().
Declaration
public int Rings { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Latitudinal ring count from equator to apex. Default is |
Segments
Number of longitudinal subdivisions (slices) around the Y axis. The value is clamped
to [3, 256] at build time. Setting this property triggers an immediate mesh
rebuild via Rebuild().
Declaration
public int Segments { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Longitudinal slice count. Default is |
Methods
Build(Mesh, float, int, int, bool, IFaceColorResolver)
Populates target with a parametric hemisphere mesh. Existing mesh
data is overwritten.
Declaration
public static void Build(Mesh target, float radius, int segments, int rings, bool buildBase = true, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | radius | Dome radius in local units. Clamped to a minimum of |
| int | segments | Longitudinal subdivisions around the Y axis. Clamped to |
| int | rings | Latitudinal rings from equator to apex. Clamped to |
| bool | buildBase | When |
| IFaceColorResolver | resolver | Optional per-vertex color resolver. Uses per-vertex dispatch: called once per
vertex with the vertex index as the face index and the vertex's local position as the
face center. Under GradientByY this produces a smooth
gradient from the equator to the apex; under Cycle or
Hash it produces per-vertex color variation. Pass
|
Remarks
This static method is the pure mesh-data entry point and may be called without a ScyllaDomeShape component - for example, to bake a dome mesh into a procedural asset at editor time. The component's Rebuild() delegates to this method automatically.
BuildMesh(Mesh)
Subclass extension point: write vertex / triangle / normal / uv data into
target from the shape's serialized parameters. The base class
calls Clear(bool) before invoking this method and
UnityEngine.Mesh.RecalculateBounds() afterwards, so subclasses should not invoke
either themselves.
Declaration
protected override void BuildMesh(Mesh target)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | The owned mesh to populate. Already cleared by the base class. |
Overrides
GetMeshName()
Returns the shape's mesh name as it should appear on the generated mesh asset. Defaults to the subclass type name; override to provide a friendlier label.
Declaration
protected override string GetMeshName()
Returns
| Type | Description |
|---|---|
| string | A short identifier for the generated mesh, used as UnityEngine.Object.name. |