Class ScyllaShelvedWallShape
Parametric wall with N evenly-spaced horizontal shelves extruding from the front face.
Shelf height, inter-shelf gap, and top/bottom margins are all equal - auto-computed as
s = height / (2 * shelfCount + 1) - so the wall reads as a regular pattern. The
back face is flat.
Inheritance
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Shelved Wall")]
public sealed class ScyllaShelvedWallShape : ScyllaShapeBase3D
Remarks
The wall is centered at the origin. The total wall footprint is
Length x Height x Thickness. Layout from
bottom to top: gap, shelf 0, gap, shelf 1, ..., gap, shelf N-1, gap. Each shelf
spans the full wall length, has thickness s on Y, and extrudes outward on
the +Z side by ShelfDepth.
Each shelf contributes 5 quads: top face, bottom face, outer front face, left end,
and right end. The wall body emits shelfCount + 1 front-face strips (the
gap regions), plus flat back, top, bottom, and two end faces.
For per-face coloring, ColoringMode selects between
WallAndShelves (the default, 2 resolver
indices: wall surface vs all shelves) and PerShelf
(shelfCount + 1 indices: wall + one per shelf bottom-to-top). Per-face
coloring requires a FaceColoringMode other than
None and a valid
ColorPaletteName.
The Build(Mesh, float, float, float, int, float, ShelvedWallColoringMode, IFaceColorResolver) static method can be called directly to populate an arbitrary UnityEngine.Mesh without attaching a component.
Properties
ColoringMode
Selects the per-face color granularity applied when a IFaceColorResolver is active. Geometry is identical in all modes; only how many distinct resolver indices the wall emits changes. See ShelvedWallColoringMode for the index-to-region mapping. Setting this triggers an immediate mesh rebuild via Rebuild().
Declaration
public ShelvedWallColoringMode ColoringMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ShelvedWallColoringMode |
Height
Wall extent along the Y axis (the wall's full vertical height). Values below
0.0001 are clamped at build time. The total height is divided into
2 * ShelfCount + 1 equal zones. Setting this triggers an immediate mesh
rebuild via Rebuild().
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Length
Wall extent along the X axis (the wall's horizontal run). Values below
0.0001 are clamped at build time. Setting this triggers an immediate mesh
rebuild via Rebuild().
Declaration
public float Length { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
ShelfCount
Number of shelves to generate. Clamped to [0, 32] at build time. A value
of 0 produces a plain flat-front wall. Setting this triggers an immediate
mesh rebuild via Rebuild().
Declaration
public int ShelfCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ShelfDepth
Outward +Z extrusion depth of each shelf beyond the wall's front surface.
Clamped to >= 0 at build time. A value of 0 produces shelves with
zero protrusion (effectively invisible). Setting this triggers an immediate mesh
rebuild via Rebuild().
Declaration
public float ShelfDepth { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Thickness
Wall body extent along the Z axis. Values below 0.0001 are clamped at build
time. Setting this triggers an immediate mesh rebuild via
Rebuild().
Declaration
public float Thickness { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, float, float, int, float, ShelvedWallColoringMode, IFaceColorResolver)
Populates target with a parametric shelved-wall mesh. Existing
mesh data is cleared and overwritten. All dimension parameters are clamped at build
time so the method always produces valid geometry.
Declaration
public static void Build(Mesh target, float length, float height, float thickness, int shelfCount, float shelfDepth, ShelvedWallColoringMode coloringMode = ShelvedWallColoringMode.WallAndShelves, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh to populate. Must not be |
| float | length | Wall extent along X (horizontal run). Values below |
| float | height | Wall extent along Y (full vertical height). Values below |
| float | thickness | Wall body extent along Z. Values below |
| int | shelfCount | Number of shelves. Clamped to |
| float | shelfDepth | Outward |
| ShelvedWallColoringMode | coloringMode | Selects how resolver indices are assigned. WallAndShelves
(the default) uses two indices total - |
| IFaceColorResolver | resolver | Optional per-face color resolver (see IFaceColorResolver). When
non-null, a per-vertex color channel is emitted with one solid color per logical
region. When |
Remarks
Shelf height, inter-shelf gap, and top/bottom margins are all auto-computed as
height / (2 * shelfCount + 1) so each zone is the same size and the
layout reads as a regular pattern regardless of wall height.
This method is the pure-static entry point used by the component's BuildMesh(Mesh) implementation. It can also be called directly to fill an arbitrary UnityEngine.Mesh without attaching a component.
The mesh uses per-region dispatch: Resolve(int, int, Vector3) is
called once per logical color group (2 calls for
WallAndShelves, or shelfCount + 1
calls for PerShelf). See
ShelvedWallColoringMode for the index-to-region mapping.
The generated mesh uses UnityEngine.Rendering.IndexFormat.UInt16 unless the vertex count exceeds 65 000, in which case UnityEngine.Rendering.IndexFormat.UInt32 is used 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. |