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

    Class SphericalTriangleSector

    A spherical triangle sector geometry (Kugeldreieck-Sektor / spherical triangle pyramid sector).

    A wedge-shaped sector cut from a sphere extending from the north pole $(0, r, 0)$ down to the equator $(y=0)$, bounded by two meridian planes intersecting at central angle $\alpha$.

    Mathematical formulas:

    • Base arc length: $a = \alpha \cdot r$
    • Spherical triangle curved area: $S = \alpha \cdot r^2$
    • Planar boundary area: $A_{\text{planar}} = \frac{\pi + \alpha}{2} r^2$
    • Total surface area: $A = S + A_{\text{planar}} = \frac{3\alpha + \pi}{2} r^2$
    • Volume: $V = \frac{\alpha \cdot r^3}{3}$

    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.

    angle: number

    The central angle (alpha) in radians.

    heightSegments: number

    Number of polar segments from pole to equator.

    openEnded: boolean

    Whether planar faces are omitted.

    radius: number

    The sphere radius (r).

    widthSegments: number

    Number of azimuth segments along equator.

    • 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 sum of all flat planar bounding areas (two meridian quarter circles + equator sector). $A_{\text{planar}} = \frac{\pi + \alpha}{2} r^2$.

      Returns number