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

    Class TruncatedCone

    A truncated cone geometry (Kegelstumpf / conical frustum).

    Mathematically, a truncated cone is a cone whose apex is sliced off by a plane parallel to its base.

    Mathematical formulas:

    • Base radius $r_1$, Top radius $r_2$, Height $h$
    • Slant height (Mantellinie): $s = \sqrt{(r_1 - r_2)^2 + h^2}$
    • Lateral area (Mantelfläche): $M = \pi (r_1 + r_2) s$
    • Total surface area: $A = M + \pi r_1^2 + \pi r_2^2$
    • Volume: $V = \frac{\pi \cdot h}{3} (r_1^2 + r_1 r_2 + r_2^2)$

    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

    The total height (h).

    heightSegments: number

    The number of height subdivisions.

    openEnded: boolean

    Whether the cone ends are open (no caps).

    radialSegments: number

    The number of radial subdivisions.

    radiusBottom: number

    The base radius at the bottom (r1).

    radiusTop: number

    The cap radius at the top (r2).

    thetaLength: number

    The central angle in radians.

    thetaStart: number

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

      Returns number

    • Calculates the lateral / mantle surface area $M = \frac{\theta_{\text{len}}}{2\pi} \cdot \pi (r_1 + r_2) s$.

      Returns number

    • Calculates the slant height (Mantellinie) $s = \sqrt{(r_1 - r_2)^2 + h^2}$.

      Returns number

    • Calculates the top cap circular area $A_{\text{top}} = \frac{\theta_{\text{len}}}{2\pi} \cdot \pi r_2^2$.

      Returns number

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

      Returns number