Class ScyllaCurvedStairsShape
Parametric curved staircase: a closed solid flight of StepCount steps swept
around the Y axis through the origin, from angle 0 to SweepAngle. Each
step is an annular sector (tread) at increasing height; the solid is closed by stepped
inner and outer curved walls, a tiled bottom, flat radial risers between steps, and two
end caps.
Inheritance
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Curved Stairs")]
public sealed class ScyllaCurvedStairsShape : ScyllaShapeBase3D
Remarks
The flight is centered vertically on the origin (the first riser starts at
-totalRise/2, the top tread sits at +totalRise/2) and revolves about the
Y axis at the origin. Treads span the radius range
[InnerRadius, InnerRadius + StepWidth]. The arc surfaces are tessellated for
smoothness; the collider falls back to a UnityEngine.MeshCollider.
For per-face coloring, ColoringMode selects between
TreadsAndStructure (default, 2 resolver indices:
structure = undersides + inner / outer curved walls + two end caps, treads = the
+Y annular-sector step tops AND the radial risers between steps - i.e. the
visible "step face") and PerStep (one resolver call
per step, shared across that step's tread, underside, walls, and riser).
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 |
InnerRadius
Inner radius of the curved arc at the inner edge of every tread, in world units.
Floored to 0 at build time. Setting this triggers an immediate mesh rebuild.
Declaration
public float InnerRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
StepCount
Number of steps in the curved flight. Clamped to [1, 128] at build time.
Setting this triggers an immediate mesh rebuild.
Declaration
public int StepCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
StepHeight
Vertical rise of each step along Y, in world units. Floored to 0.0001 at
build time. Setting this triggers an immediate mesh 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 mesh rebuild.
Declaration
public float StepWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
SweepAngle
Total angle swept by the entire curved flight, in degrees. Each step subtends
SweepAngle / StepCount degrees. Negative values are accepted and produce a
clockwise sweep (viewed from above). Setting this triggers an immediate mesh rebuild.
Declaration
public float SweepAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, int, float, float, float, StairsColoringMode, IFaceColorResolver)
Populates target with a parametric curved-staircase mesh. Existing
mesh data is overwritten. stepCount is clamped to [1, 128].
Declaration
public static void Build(Mesh target, float innerRadius, int stepCount, float stepHeight, float stepWidth, float sweepAngle, 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 arc. |
| int | stepCount | Number of steps. Clamped to |
| float | stepHeight | Rise of each step along Y. |
| float | stepWidth | Radial width of each tread. |
| float | sweepAngle | Total swept angle in degrees. |
| 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. |