Class ScyllaLadderShape
Parametric ladder: two vertical cylindrical rails along Y, joined by RungCount horizontal cylindrical rungs along X. Centered on the origin.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Ladder")]
public sealed class ScyllaLadderShape : ScyllaShapeBase3D
Remarks
The rails are spaced RailSpacing apart on X; the rungs are spaced RungSpacing apart on Y with a half-spacing margin of rail above the top rung and below the bottom rung. Each rail and rung is a capped cylinder, so the ladder is a set of disjoint solids; the collider falls back to a UnityEngine.MeshCollider.
For per-face coloring each rail and rung is treated as a single face, so Cycle tints rails and rungs from successive palette entries.
Properties
RailRadius
Cross-section radius of the two vertical side rails, in world units. Floored to
0.0001 at build time. Setting this triggers an immediate rebuild.
Declaration
public float RailRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
RailSpacing
Centre-to-centre distance between the two vertical rails along X, in world units.
Floored to 0.0001 at build time. Setting this triggers an immediate rebuild.
Declaration
public float RailSpacing { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
RungCount
Number of horizontal rungs. Clamped to [1, 256] at build time.
Setting this triggers an immediate rebuild.
Declaration
public int RungCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
RungRadius
Cross-section radius of each horizontal rung, in world units. Floored to
0.0001 at build time. Setting this triggers an immediate rebuild.
Declaration
public float RungRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
RungSpacing
Vertical centre-to-centre spacing between adjacent rungs along Y, in world units.
Floored to 0.0001 at build time. Setting this triggers an immediate rebuild.
Declaration
public float RungSpacing { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, int, float, float, float, IFaceColorResolver)
Populates target with a parametric ladder mesh. Existing mesh data
is overwritten. rungCount is clamped to [1, 256].
Declaration
public static void Build(Mesh target, float railSpacing, int rungCount, float rungSpacing, float railRadius, float rungRadius, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | railSpacing | Distance between the two rails along X. |
| int | rungCount | Number of rungs. Clamped to |
| float | rungSpacing | Vertical distance between adjacent rungs along Y. |
| float | railRadius | Radius of the two side rails. |
| float | rungRadius | Radius of the rungs. |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted with one solid color per rail / rung. 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. |