Small World Engine API Reference - v0.78.00
    Preparing search index...

    Class LShape

    An LShape (L-Form / Winkelprofil / Angle Profile) geometry.

    An L-shaped polygonal profile formed by an outer boundary of width $a$, height $b$, and uniform leg thickness $c$.

    Can be rendered as a 2D planar polygon in the X-Z plane (when depth = 0) with normal (0, 1, 0), or as a solid 3D extruded angle profile prism (when depth > 0).

    Mathematical formulas:

    • Outer sides $a, b$, thickness $c$
    • Inner sides: $a' = a - c$, $b' = b - c$
    • Perimeter: $u = 2(a + b)$
    • Cross-sectional area: $A = c(a + b - c) = ac + b'c$
    • Volume (3D): $V = A \cdot t$
    • Total surface area (3D): $A_{\text{total}} = 2A + u \cdot t$

    Hierarchy (View Summary)

    Index
    _cachedBoundingVolume: BoundingVolume | undefined = undefined

    Cached bounding volume to prevent re-allocation

    _indices:
        | Uint16Array<ArrayBufferLike>
        | Uint32Array<ArrayBufferLike>
        | undefined = undefined

    The indices of the geometry for indexed rendering.

    _isLineGeometry: boolean = false

    Whether the geometry is purely line-based.

    _joints?: Float32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> = undefined

    Optional skinning joints (4 IDs per vertex).

    _normals: Float32Array = ...

    The normals of the geometry (nx, ny, nz).

    _tangents: Float32Array = ...

    The tangents of the geometry (tx, ty, tz).

    _uvs: Float32Array = ...

    The UV coordinates of the geometry (u, v).

    _vertices: Float32Array = ...

    The vertices of the geometry (x, y, z).

    _weights?: Float32Array<ArrayBufferLike> = undefined

    Optional skinning weights (4 weights per vertex).

    _wireframeIndices:
        | Uint16Array<ArrayBufferLike>
        | Uint32Array<ArrayBufferLike>
        | undefined = undefined

    The indices for wireframe rendering.

    depth: number

    Extrusion depth (t).

    height: number

    Outer height (b).

    thickness: number

    Wall/leg thickness (c).

    width: number

    Outer width (a).

    • Helper method to create an appropriately sized index array. Automatically chooses between 16-bit and 32-bit indices based on vertex count.

      Parameters

      • indexCount: number

        The number of indices needed.

      Returns Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>

      A Uint16Array or Uint32Array.

    • Calculates the 2D cross-sectional area $A = c(a + b - c)$.

      Returns number

    • Calculates the inner height $b' = b - c$.

      Returns number

    • Calculates the inner width $a' = a - c$.

      Returns number

    • Calculates the perimeter $u = 2(a + b)$.

      Returns number

    • Calculates the total surface area (2D area if depth = 0, or $2A + u \cdot t$ if depth > 0).

      Returns number

    • Calculates the 3D volume $V = A \cdot t$.

      Returns number