Class ScyllaSpiralStairsShape
Parametric spiral staircase: StepCount wedge treads stacked around a central
column, winding about the Y axis through the origin. Each tread subtends one step of
360 / StepsPer360 degrees and rises StepHeight, so the flight can wind
past a full turn.
Inheritance
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Spiral Stairs")]
public sealed class ScyllaSpiralStairsShape : ScyllaShapeBase3D
Remarks
The flight is centered vertically on the origin. Each tread is an annular-sector slab
of thickness StepHeight spanning the radius range
[InnerRadius, InnerRadius + StepWidth]; consecutive treads stack edge to edge so
the underside reads as a continuous helix. A central column of radius
InnerRadius runs the full height. CounterClockwise reverses
the winding direction. The collider falls back to a UnityEngine.MeshCollider.
For per-face coloring, ColoringMode selects between TreadsAndStructure (default, 2 resolver indices: the central column takes the "structure" color (index 0); every tread slab shares the "treads" color (index 1)) and PerStep (one resolver call per tread shared across that tread's six sub-faces, plus one more for the column - the original busier look).
Properties
ColoringMode
Selects the per-face color granularity. Geometry is identical in all modes; only how many distinct resolver indices the staircase emits changes. Setting this triggers an immediate mesh rebuild.
Declaration
public StairsColoringMode ColoringMode { get; set; }
Property Value
| Type | Description |
|---|---|
| StairsColoringMode |
CounterClockwise
When true, the flight winds counterclockwise when viewed from above. The mesh
is always built clockwise and then mirrored across X to produce the counterclockwise
variant. Setting this triggers an immediate rebuild.
Declaration
public bool CounterClockwise { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
InnerRadius
Inner radius of every tread and of the central column, in world units. Floored to
0.0001 at build time. Setting this triggers an immediate rebuild.
Declaration
public float InnerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
StepCount
Number of annular tread slabs. Clamped to [1, 256] at build time.
Setting this triggers an immediate rebuild.
Declaration
public int StepCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
StepHeight
Vertical rise of each tread slab along Y, in world units. Also the tread slab
thickness. Floored to 0.0001 at build time. Setting this triggers an immediate rebuild.
Declaration
public float StepHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
StepWidth
Radial width of each tread, in world units. The outer radius of the flight equals
InnerRadius + StepWidth. Floored to 0.0001 at build time.
Setting this triggers an immediate rebuild.
Declaration
public float StepWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
StepsPer360
Number of treads required to complete one full 360-degree revolution around Y. The
per-step arc angle is 360 / StepsPer360 degrees. The absolute value is floored
to 1.0 at build time. Setting this triggers an immediate rebuild.
Declaration
public float StepsPer360 { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, int, float, float, float, bool, StairsColoringMode, IFaceColorResolver)
Populates target with a parametric spiral-staircase mesh. Existing
mesh data is overwritten. stepCount is clamped to [1, 256].
Declaration
public static void Build(Mesh target, float innerRadius, int stepCount, float stepHeight, float stepWidth, float stepsPer360, bool counterClockwise, StairsColoringMode coloringMode = StairsColoringMode.TreadsAndStructure, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | innerRadius | Inner radius of the treads / central column. |
| int | stepCount | Number of treads. Clamped to |
| float | stepHeight | Rise of each step (and tread thickness). |
| float | stepWidth | Radial width of each tread. |
| float | stepsPer360 | How many steps complete one full turn. |
| bool | counterClockwise | When |
| StairsColoringMode | coloringMode | Selects how the resolver indices are assigned. TreadsAndStructure
(the default) uses two indices total - |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted with one solid color per logical face. When null, no color channel is written. |
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. |