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

    Class Annulus

    A planar annulus geometry (Kreisring / 2D flat circular ring).

    A flat 2D ring lying in the X-Z plane with normal $(0, 1, 0)$, bounded by an inner radius $r$ and an outer radius $R$.

    Mathematical formulas:

    • Ring width: $b = R - r$
    • Middle / median radius: $r_{\text{med}} = \frac{R + r}{2}$
    • Tangent chord length: $l = 2\sqrt{R^2 - r^2}$
    • Perimeter: $U = 2\pi(R + r)$
    • Area: $A = \pi(R^2 - r^2) = \pi b(2r + b) = 2\pi b r_{\text{med}}$

    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.

    innerRadius: number

    Inner radius (r).

    outerRadius: number

    Outer radius (R).

    phiSegments: number

    Number of concentric subdivisions across ring width.

    thetaLength: number

    Central angle in radians.

    thetaSegments: number

    Number of radial subdivisions around circumference.

    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 surface area $A = \frac{\theta_{\text{len}}}{2\pi} \cdot \pi (R^2 - r^2)$.

      Returns number

    • Calculates the median radius $r_{\text{med}} = \frac{R + r}{2}$.

      Returns number

    • Calculates the total perimeter $U = \frac{\theta_{\text{len}}}{2\pi} \cdot 2\pi (R + r)$ (plus side radial edges if sector).

      Returns number

    • Calculates the tangent chord length $l = 2\sqrt{R^2 - r^2}$.

      Returns number

    • Calculates the ring width / wall thickness $b = R - r$.

      Returns number