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

    Class SphericalCap

    A spherical cap geometry (Kugelsegment / Kugelkappe / spherical dome).

    A portion of a sphere of radius $r$ cut off by a plane at distance $r - h$ from the apex.

    Mathematical formulas:

    • Base radius: $a = \sqrt{h(2r - h)}$
    • Curved mantle area: $M = 2\pi r h$
    • Base circle area: $A_{\text{base}} = \pi a^2 = \pi h (2r - h)$
    • Total surface area: $A = M + A_{\text{base}} = \pi h (4r - h)$
    • Volume: $V = \frac{\pi h^2}{3}(3r - h)$

    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.

    height: number

    Height of the spherical cap (h).

    heightSegments: number

    Number of height subdivisions from apex to base.

    openEnded: boolean

    Whether the base disk is open.

    radialSegments: number

    Number of radial subdivisions around circumference.

    radius: number

    Radius of the parent sphere (r).

    thetaLength: number

    Central angle in radians.

    thetaStart: number

    Start angle in radians.

    • 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 base circular area $A_{\text{base}} = \frac{\theta_{\text{len}}}{2\pi} \cdot \pi a^2$.

      Returns number

    • Calculates the curved dome mantle surface area $M = \frac{\theta_{\text{len}}}{2\pi} \cdot 2\pi r h$.

      Returns number

    • Calculates the total surface area $A = M + A_{\text{base}} (+ \text{sector sides})$.

      Returns number

    • Calculates the volume $V = \frac{\theta_{\text{len}}}{2\pi} \cdot \frac{\pi h^2}{3}(3r - h)$.

      Returns number