Class ScyllaRampShape
Parametric ramp (wedge): a right-triangular prism lying on its side, rising from a
zero-height front edge (at -Length/2 on Z) to its full Height at the
back edge (at +Length/2 on Z). Faces: a flat bottom, a vertical back, a sloped top,
and (when BuildSides is set) two triangular side caps.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/Ramp")]
public sealed class ScyllaRampShape : ScyllaShapeBase3D
Remarks
The mesh is centered on the origin, spanning Width on X, Height on Y, and Length on Z. The slope climbs from the front-bottom edge to the back-top edge, so an object travelling in +Z ascends.
When BuildSides is false the two triangular caps are omitted,
which is appropriate for a ramp set flush against a wall on one or both sides.
Properties
BuildSides
When true, emits the two triangular side caps so the ramp is fully closed.
Set to false when the ramp is flush against walls on one or both sides and
the side profiles will never be seen. Setting this triggers an immediate mesh rebuild.
Declaration
public bool BuildSides { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Height
Vertical rise of the ramp along Y (the height at the back edge), in world units.
Floored to 0.0001 when set and at build time. Setting this triggers an immediate mesh rebuild.
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Length
Horizontal run of the ramp along Z, in world units. Floored to 0.0001 when set and at
build time. Setting this triggers an immediate mesh rebuild.
Declaration
public float Length { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Width
Width of the ramp along X, in world units. Floored to 0.0001 when set and at build time.
Setting this triggers an immediate mesh rebuild.
Declaration
public float Width { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Build(Mesh, float, float, float, bool, IFaceColorResolver)
Populates target with a parametric ramp mesh. Existing mesh data is
overwritten.
Declaration
public static void Build(Mesh target, float length, float width, float height, bool buildSides, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | length | Run along Z. |
| float | width | Width along X. |
| float | height | Rise along Y. |
| bool | buildSides | When |
| IFaceColorResolver | resolver | Optional per-face color resolver. When non-null, a per-vertex color channel is emitted with one solid color per face (bottom, back, slope, and the two side caps). 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. |