1 | import { Object3D } from "../core/Object3D.js";
|
2 | import { ColorRepresentation } from "../math/Color.js";
|
3 | import { Vector3 } from "../math/Vector3.js";
|
4 | import { Line } from "../objects/Line.js";
|
5 | import { Mesh } from "../objects/Mesh.js";
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export class ArrowHelper extends Object3D {
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | constructor(
|
35 | dir?: Vector3,
|
36 | origin?: Vector3,
|
37 | length?: number,
|
38 | color?: ColorRepresentation,
|
39 | headLength?: number,
|
40 | headWidth?: number,
|
41 | );
|
42 |
|
43 | /**
|
44 | * A Read-only _string_ to check if `this` object type.
|
45 | * @remarks Sub-classes will update this value.
|
46 | * @override
|
47 | * @defaultValue `ArrowHelper`
|
48 | */
|
49 | override readonly type: string | "ArrowHelper";
|
50 |
|
51 | /**
|
52 | * Contains the line part of the arrowHelper.
|
53 | */
|
54 | line: Line;
|
55 |
|
56 | /**
|
57 | * Contains the cone part of the arrowHelper.
|
58 | */
|
59 | cone: Mesh;
|
60 |
|
61 | /**
|
62 | * Sets the color of the arrowHelper.
|
63 | * @param color The desired color.
|
64 | */
|
65 | setColor(color: ColorRepresentation): void;
|
66 |
|
67 | /**
|
68 | * @param dir The desired direction. Must be a unit vector.
|
69 | */
|
70 | setDirection(dir: Vector3): void;
|
71 |
|
72 | /**
|
73 | * Sets the length of the arrowhelper.
|
74 | * @param length The desired length.
|
75 | * @param headLength The length of the head of the arrow. Default `0.2 * length`
|
76 | * @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
|
77 | */
|
78 | setLength(length: number, headLength?: number, headWidth?: number): void;
|
79 |
|
80 | /**
|
81 | * Copy the given object into this object
|
82 | * @remarks Note: event listeners and user-defined callbacks ({@link onAfterRender | .onAfterRender} and {@link onBeforeRender | .onBeforeRender}) are not copied.
|
83 | * @param source
|
84 | */
|
85 | override copy(source: this): this;
|
86 |
|
87 | /**
|
88 | * Frees the GPU-related resources allocated by this instance
|
89 | * @remarks
|
90 | * Call this method whenever this instance is no longer used in your app.
|
91 | */
|
92 | dispose(): void;
|
93 | }
|