export type ConeShapeArgs = { /** * - The peak radius, as a fraction of the base radius. */ peakRadius?: number; /** * - The number of sides around the cone. */ segments?: number; /** * - The rotation of the sides about the cone axis, in degrees. */ twist?: number; }; /** * @import { ShapeArgs } from './shape.js' * @import { GraphicsDevice } from '../../../platform/graphics/graphics-device.js' */ /** * @typedef {object} ConeShapeArgs * @property {number} [peakRadius] - The peak radius, as a fraction of the base radius. * @property {number} [segments] - The number of sides around the cone. * @property {number} [twist] - The rotation of the sides about the cone axis, in degrees. */ /** * A unit cone along the y axis, its base of radius 0.5 at y = -0.5 and its peak at y = 0.5. Few * segments make a pyramid, a cone with a peak radius equal to the base radius a prism. * * @ignore */ export class ConeShape extends Shape { /** * Create a new ConeShape. * * @param {GraphicsDevice} device - The graphics device. * @param {ShapeArgs & ConeShapeArgs} args - The shape options. */ constructor(device: GraphicsDevice, args?: ShapeArgs & ConeShapeArgs); /** * The peak radius, as a fraction of the base radius. * * @private */ private _peakRadius; /** * The number of sides. * * @private */ private _segments; /** * The entity holding the mesh, turned by the twist. * * @type {Entity} * @private */ private _body; /** * Create the cone geometry. * * @returns {ConeGeometry} The cone geometry. * @private */ private _createGeometry; /** * Create the cone mesh. * * @returns {Mesh} The cone mesh. * @private */ private _createMesh; /** * Set the peak radius, as a fraction of the base radius. * * @type {number} */ set peakRadius(value: number); /** * Get the peak radius, as a fraction of the base radius. * * @type {number} */ get peakRadius(): number; } import { Shape } from './shape.js'; import type { GraphicsDevice } from '../../../platform/graphics/graphics-device.js'; import type { ShapeArgs } from './shape.js';