Class ScyllaWallWithWindowShape
Parametric wall with a rectangular window cutout that is fully bounded on all four sides (does not reach the floor or the ceiling, unlike ScyllaWallWithDoorShape). The wall is centered at the origin; the window's vertical position is controlled by WindowSillHeight (height of the window's bottom edge above the wall's bottom).
Inheritance
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Wall With Window")]
public sealed class ScyllaWallWithWindowShape : ScyllaShapeBase3D
Remarks
Topology: the wall's six outer faces split where the cutout intersects them. Front and back faces produce up to four sub-quads each (left jamb, right jamb, lintel above the window, sill below); top, bottom, and end faces are single quads (the window does not extend to those edges). Four additional quads form the interior of the cutout (left jamb inside, right jamb inside, lintel underside, sill top), so a viewer outside the wall looking through the window sees solid walls on every visible side.
Degenerate sub-quads (zero-width jambs when the window is flush against a wall end) are silently skipped. The window is required to be fully bounded vertically: WindowSillHeight is clamped so the sill always has positive height, and the window's top is clamped so the lintel always has positive height. If you need a floor-reaching opening, use ScyllaWallWithDoorShape instead.
No bevel in v1 - cutouts and bevels interact non-trivially.
Properties
WallHeight
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 WallHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
WallLength
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 WallLength { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
WallThickness
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 WallThickness { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
WindowHeight
Height of the window cutout along the Y axis in world units. Clamped at build time so that
both the sill below and the lintel above always retain at least 0.01 units of
height. Setting this property triggers an immediate mesh rebuild via
Rebuild().
Declaration
public float WindowHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
WindowOffsetX
Horizontal offset of the window's center from the wall's center along the X axis in world units. Clamped at build time so the window's left and right edges remain within the wall's extents. Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float WindowOffsetX { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
WindowSillHeight
Distance from the wall's bottom edge to the window's bottom edge (the sill height) in world
units. Clamped at build time so the sill and lintel each retain at least 0.01 units
of height, ensuring the window is always fully bounded vertically. For a floor-reaching
opening use ScyllaWallWithDoorShape instead. Setting this property triggers
an immediate mesh rebuild via Rebuild().
Declaration
public float WindowSillHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
WindowWidth
Width of the window cutout along the X axis in world units. Clamped to
[0, WallLength] at build time. Setting this property triggers an
immediate mesh rebuild via Rebuild().
Declaration
public float WindowWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, float, float, float, float, float, float, IFaceColorResolver)
Populates target with a parametric wall-with-window mesh.
Existing mesh data is overwritten. The window is required to be fully bounded
vertically: windowSillHeight is clamped so the sill and lintel
each have at least Scylla.Core.Util.Geom.ScyllaWallWithWindowShape.MIN_FRAME_THICKNESS of height;
windowHeight is clamped to [0, wallHeight - 2 *
MIN_FRAME_THICKNESS]; windowWidth is clamped to
[0, wallLength]; windowOffsetX is
clamped so the window fits horizontally within the wall.
Declaration
public static void Build(Mesh target, float wallLength, float wallHeight, float wallThickness, float windowWidth, float windowHeight, float windowSillHeight, float windowOffsetX, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh to populate. Must be non-null. |
| float | wallLength | Wall extent along the X axis in world units. Clamped to a minimum of |
| float | wallHeight | Wall extent along the Y axis in world units. Clamped to a minimum of |
| float | wallThickness | Wall extent along the Z axis in world units. Clamped to a minimum of |
| float | windowWidth | Width of the window cutout along the X axis in world units. Clamped to
[ |
| float | windowHeight | Height of the window cutout along the Y axis in world units. Clamped so that the sill and lintel each retain at least Scylla.Core.Util.Geom.ScyllaWallWithWindowShape.MIN_FRAME_THICKNESS of height. |
| float | windowSillHeight | Distance from the wall's bottom edge to the window's bottom edge in world units. Clamped so the sill is at least Scylla.Core.Util.Geom.ScyllaWallWithWindowShape.MIN_FRAME_THICKNESS above the floor and the lintel retains at least Scylla.Core.Util.Geom.ScyllaWallWithWindowShape.MIN_FRAME_THICKNESS below the ceiling. |
| float | windowOffsetX | Horizontal offset of the window's center from the wall's center along the X axis in world units. Clamped so the window's edges remain within the wall. |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted
with one solid color per emitted quad. The face count is at most |
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.