UNPKG

1.64 kBTypeScriptView Raw
1import { Vector3 } from './../math/Vector3';
2import { Line } from './../objects/Line';
3import { Mesh } from './../objects/Mesh';
4import { Object3D } from './../core/Object3D';
5import { ColorRepresentation } from '../utils';
6
7// Extras / Helpers /////////////////////////////////////////////////////////////////////
8
9export class ArrowHelper extends Object3D {
10 /**
11 * @param [dir] Direction from origin. Must be a unit vector.
12 * @param [origin] Point at which the arrow starts.
13 * @param [length] Length of the arrow.
14 * @param [color] Hexadecimal value to define color.
15 * @param [headLength] The length of the head of the arrow.
16 * @param [headWidth] The width of the head of the arrow.
17 */
18 constructor(
19 dir?: Vector3,
20 origin?: Vector3,
21 length?: number,
22 color?: ColorRepresentation,
23 headLength?: number,
24 headWidth?: number,
25 );
26
27 /**
28 * @default 'ArrowHelper'
29 */
30 type: string;
31
32 /**
33 * Contains the line part of the arrowHelper.
34 */
35 line: Line;
36
37 /**
38 * Contains the cone part of the arrowHelper.
39 */
40 cone: Mesh;
41
42 /**
43 * @param dir The desired direction. Must be a unit vector.
44 */
45 setDirection(dir: Vector3): void;
46
47 /**
48 * @param length The desired length.
49 * @param [headLength] The length of the head of the arrow.
50 * @param [headWidth] The width of the head of the arrow.
51 */
52 setLength(length: number, headLength?: number, headWidth?: number): void;
53
54 /**
55 * @param color The desired color.
56 */
57 setColor(color: ColorRepresentation): void;
58}