UNPKG

1.88 kBTypeScriptView Raw
1import { BufferGeometry } from "../core/BufferGeometry.js";
2import { Object3DEventMap } from "../core/Object3D.js";
3import { Material } from "../materials/Material.js";
4import { Line } from "./Line.js";
5
6/**
7 * A continuous line that connects back to the start.
8 * @remarks
9 * This is nearly the same as {@link THREE.Line | Line},
10 * the only difference is that it is rendered using {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINE_LOOP}
11 * instead of {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINE_STRIP},
12 * which draws a straight line to the next vertex, and connects the last vertex back to the first.
13 * @see {@link https://threejs.org/docs/index.html#api/en/objects/LineLoop | Official Documentation}
14 * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LineLoop.js | Source}
15 */
16export class LineLoop<
17 TGeometry extends BufferGeometry = BufferGeometry,
18 TMaterial extends Material | Material[] = Material | Material[],
19 TEventMap extends Object3DEventMap = Object3DEventMap,
20> extends Line<TGeometry, TMaterial, TEventMap> {
21 /**
22 * Create a new instance of {@link LineLoop}
23 * @param geometry List of vertices representing points on the line loop. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
24 * @param material Material for the line. Default {@link THREE.LineBasicMaterial | `new THREE.LineBasicMaterial()`}.
25 */
26 constructor(geometry?: TGeometry, material?: TMaterial);
27
28 /**
29 * Read-only flag to check if a given object is of type {@link LineLoop}.
30 * @remarks This is a _constant_ value
31 * @defaultValue `true`
32 */
33 readonly isLineLoop: true;
34
35 /**
36 * @override
37 * @defaultValue `LineLoop`
38 */
39 override readonly type: string | "LineLoop";
40}