Class ScyllaWallShape
Parametric wall: a thin box laid out along the X axis (length), standing up the Y axis (height), with depth along the Z axis (thickness). Optionally rounded edges via BevelRadius for prototype geometry that should not read as sharp-edged.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Wall")]
public sealed class ScyllaWallShape : ScyllaShapeBase3D
Remarks
The mesh topology is shared with ScyllaRoundedBoxShape: when
BevelRadius is 0, the wall renders as a hard-edged box (six
flat face panels). When BevelRadius is positive, the same builder
emits quarter-cylinder edge strips and eighth-sphere corner patches, producing a
soft-cornered wall tile suitable for blockout geometry such as the DroidShip deck
interior. BevelRadius is clamped to half the smallest of
Height and Thickness at build time so the wall never
self-intersects along its length axis (walls are expected to be long relative to
their cross-section, so the length axis does not constrain the bevel).
When ColliderMode is set to MatchingPrimitive, a UnityEngine.BoxCollider sized to the wall's outer extent is attached. The bevel rounding is absorbed inside the box bound, which is the right trade-off for prototype-style collision: cheap, correct within a fraction of the bevel radius. Use Mesh if a tight beveled collider is required.
Properties
BevelRadius
Edge rounding radius in world units. Set to 0 for a hard-edged wall that renders
identically to ScyllaBoxShape with the same dimensions. When positive, the
radius is clamped to half the smaller of Height and Thickness
at build time to prevent self-intersection. Setting this property triggers an immediate
mesh rebuild via Rebuild().
Declaration
public float BevelRadius { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
BevelSegments
Number of subdivisions per quarter-arc on each rounded edge and corner patch. Higher values
produce smoother bevel curvature at the cost of additional vertices. Clamped to
[1, 32] when set and at build time. Setting this property triggers an immediate mesh
rebuild via Rebuild().
Declaration
public int BevelSegments { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Height
Wall extent along the Y axis in world units. Controls the wall's standing height.
Values below 0.0001 are clamped when set and at build time.
Setting this property 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 in world units. Controls how long the wall is.
Values below 0.0001 are clamped when set and at build time.
Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float Length { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Thickness
Wall extent along the Z axis in world units. Controls how deep (thick) the wall slab is
perpendicular to its face. Values below 0.0001 are clamped when set and at build time.
Setting this property triggers an immediate mesh rebuild via
Rebuild().
Declaration
public float Thickness { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, float, float, float, int, IFaceColorResolver)
Populates target with a parametric wall mesh. Existing mesh data
is overwritten. When bevelRadius is 0 the output mesh is a
hard-edged box (delegates to Build(Mesh, float, float, float, IFaceColorResolver)); otherwise it is a
rounded box (delegates to Build(Mesh, Size3D, float, int, RoundedBoxColoringMode, IFaceColorResolver)) with the bevel
clamped to half the smaller of height and thickness.
Declaration
public static void Build(Mesh target, float length, float height, float thickness, float bevelRadius, int bevelSegments, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh to populate. Must be non-null. |
| float | length | Wall extent along the X axis in world units. Clamped to a minimum of |
| float | height | Wall extent along the Y axis in world units. Clamped to a minimum of |
| float | thickness | Wall extent along the Z axis in world units. Clamped to a minimum of |
| float | bevelRadius | Edge rounding radius in world units. Pass |
| int | bevelSegments | Number of arc subdivisions per quarter-round edge when |
| IFaceColorResolver | resolver | Optional per-face color resolver forwarded to the underlying box or rounded-box builder.
When non-null, a per-vertex color channel is emitted - six face panels for a sharp wall,
plus edge strips and corner patches for a beveled wall. When |
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. |
Overrides
TryAttachPrimitiveCollider()
Subclass extension point: when ColliderMode is
MatchingPrimitive, obtain the appropriate primitive
collider through GetOrAddManagedCollider<T>(), size it to the current
parameters, and return true. Return false to let the base class fall
back to UnityEngine.MeshCollider.
Declaration
protected override bool TryAttachPrimitiveCollider()
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
Remarks
Runs on every rebuild. Always go through GetOrAddManagedCollider<T>()
rather than AddComponent: it reuses the collider from the previous rebuild,
so the override only has to update its size and center. A collider added directly
is not tracked by the shape and a new one would be added on every rebuild.