UNPKG

1.12 kBTypeScriptView Raw
1import { Object3D, Object3DEventMap } from "../core/Object3D.js";
2
3/**
4 * A {@link Bone} which is part of a {@link THREE.Skeleton | Skeleton}
5 * @remarks
6 * The skeleton in turn is used by the {@link THREE.SkinnedMesh | SkinnedMesh}
7 * Bones are almost identical to a blank {@link THREE.Object3D | Object3D}.
8 * @example
9 * ```typescript
10 * const root = new THREE.Bone();
11 * const child = new THREE.Bone();
12 * root.add(child);
13 * child.position.y = 5;
14 * ```
15 * @see {@link https://threejs.org/docs/index.html#api/en/objects/Bone | Official Documentation}
16 * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Bone.js | Source}
17 */
18export class Bone<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
19 /**
20 * Creates a new {@link Bone}.
21 */
22 constructor();
23
24 /**
25 * Read-only flag to check if a given object is of type {@link Bone}.
26 * @remarks This is a _constant_ value
27 * @defaultValue `true`
28 */
29 readonly isBone: true;
30
31 /**
32 * @override
33 * @defaultValue `Bone`
34 */
35 override readonly type: string | "Bone";
36}