Class ScyllaQuadShape
Parametric vertical quad in the XY plane (facing +Z), with configurable width and height. Equivalent to Unity's built-in quad primitive but with serialized dimensions that can be retuned in the Inspector or at runtime.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Quad")]
public sealed class ScyllaQuadShape : ScyllaShapeBase3D
Remarks
The mesh is a single 4-vertex / 2-triangle quad. Normals point along +Z. UVs span
(0,0) at the bottom-left to (1,1) at the top-right. The quad is
centered at local origin.
Because the quad has only one face, it is typically used with
DoubleSided set to true so it is visible
from both sides. Per-face coloring is supported: face index 0 of 1 is passed to
the resolver, which assigns one solid color to all four vertices.
The MatchingPrimitive option is not overridden for this shape; it falls back to UnityEngine.MeshCollider. For a paper-thin collider matching a flat quad, consider using ScyllaPlaneShape (which attaches a thin UnityEngine.BoxCollider) or assigning a collider manually.
Properties
Height
Quad size along the Y axis. Values below 0.0001 are clamped when set and at
build time. Setting this triggers an immediate mesh rebuild and updates
Size.
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Size
Quad extent on the XY plane as a Size2D. Width
maps to X, Height maps to Y. Components below 0.0001 are
clamped when set and at build time. Setting this triggers an immediate rebuild.
Declaration
public Size2D Size { get; set; }
Property Value
| Type | Description |
|---|---|
| Size2D |
Width
Quad size along the X axis. Values below 0.0001 are clamped when set and at
build time. Setting this triggers an immediate mesh rebuild and updates
Size.
Declaration
public float Width { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, float, IFaceColorResolver)
Populates target with a single-quad mesh in the XY plane facing
+Z. Existing mesh data is overwritten.
Declaration
public static void Build(Mesh target, float width, float height, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | width | Quad width along the X axis. Clamped to a minimum of |
| float | height | Quad height along the Y axis. Clamped to a minimum of |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted with the single face's color (face index 0 of 1). 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. |