@pixiv/three-vrm-core 2.1.0-beta.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/LICENSE +22 -0
  2. package/lib/three-vrm-core.js +1 -1
  3. package/lib/three-vrm-core.module.js +1 -1
  4. package/package.json +5 -4
  5. package/ts3.4/types/VRMCore.d.ts +58 -0
  6. package/ts3.4/types/VRMCoreLoaderPlugin.d.ts +18 -0
  7. package/ts3.4/types/VRMCoreLoaderPluginOptions.d.ts +19 -0
  8. package/ts3.4/types/VRMCoreParameters.d.ts +16 -0
  9. package/ts3.4/types/expressions/VRMExpression.d.ts +65 -0
  10. package/ts3.4/types/expressions/VRMExpressionBind.d.ts +11 -0
  11. package/ts3.4/types/expressions/VRMExpressionLoaderPlugin.d.ts +23 -0
  12. package/ts3.4/types/expressions/VRMExpressionManager.d.ts +124 -0
  13. package/ts3.4/types/expressions/VRMExpressionMaterialColorBind.d.ts +58 -0
  14. package/ts3.4/types/expressions/VRMExpressionMaterialColorType.d.ts +12 -0
  15. package/ts3.4/types/expressions/VRMExpressionMorphTargetBind.d.ts +35 -0
  16. package/ts3.4/types/expressions/VRMExpressionOverrideType.d.ts +6 -0
  17. package/ts3.4/types/expressions/VRMExpressionPresetName.d.ts +21 -0
  18. package/ts3.4/types/expressions/VRMExpressionTextureTransformBind.d.ts +40 -0
  19. package/ts3.4/types/expressions/index.d.ts +10 -0
  20. package/ts3.4/types/firstPerson/VRMFirstPerson.d.ts +84 -0
  21. package/ts3.4/types/firstPerson/VRMFirstPersonLoaderPlugin.d.ts +20 -0
  22. package/ts3.4/types/firstPerson/VRMFirstPersonMeshAnnotation.d.ts +5 -0
  23. package/ts3.4/types/firstPerson/VRMFirstPersonMeshAnnotationType.d.ts +7 -0
  24. package/ts3.4/types/firstPerson/index.d.ts +4 -0
  25. package/ts3.4/types/humanoid/VRMHumanBone.d.ts +10 -0
  26. package/ts3.4/types/humanoid/VRMHumanBoneList.d.ts +5 -0
  27. package/ts3.4/types/humanoid/VRMHumanBoneName.d.ts +63 -0
  28. package/ts3.4/types/humanoid/VRMHumanBoneParentMap.d.ts +9 -0
  29. package/ts3.4/types/humanoid/VRMHumanBones.d.ts +11 -0
  30. package/ts3.4/types/humanoid/VRMHumanoid.d.ts +182 -0
  31. package/ts3.4/types/humanoid/VRMHumanoidLoaderPlugin.d.ts +32 -0
  32. package/ts3.4/types/humanoid/VRMHumanoidLoaderPluginOptions.d.ts +15 -0
  33. package/ts3.4/types/humanoid/VRMHumanoidRig.d.ts +31 -0
  34. package/ts3.4/types/humanoid/VRMPose.d.ts +24 -0
  35. package/ts3.4/types/humanoid/VRMPoseTransform.d.ts +24 -0
  36. package/ts3.4/types/humanoid/VRMRequiredHumanBoneName.d.ts +18 -0
  37. package/ts3.4/types/humanoid/VRMRig.d.ts +62 -0
  38. package/ts3.4/types/humanoid/helpers/VRMHumanoidHelper.d.ts +9 -0
  39. package/ts3.4/types/humanoid/helpers/index.d.ts +1 -0
  40. package/ts3.4/types/humanoid/index.d.ts +12 -0
  41. package/ts3.4/types/index.d.ts +9 -0
  42. package/ts3.4/types/lookAt/VRMLookAt.d.ts +149 -0
  43. package/ts3.4/types/lookAt/VRMLookAtApplier.d.ts +18 -0
  44. package/ts3.4/types/lookAt/VRMLookAtBoneApplier.d.ts +83 -0
  45. package/ts3.4/types/lookAt/VRMLookAtExpressionApplier.d.ts +56 -0
  46. package/ts3.4/types/lookAt/VRMLookAtLoaderPlugin.d.ts +30 -0
  47. package/ts3.4/types/lookAt/VRMLookAtLoaderPluginOptions.d.ts +8 -0
  48. package/ts3.4/types/lookAt/VRMLookAtRangeMap.d.ts +23 -0
  49. package/ts3.4/types/lookAt/VRMLookAtTypeName.d.ts +8 -0
  50. package/ts3.4/types/lookAt/helpers/VRMLookAtHelper.d.ts +11 -0
  51. package/ts3.4/types/lookAt/helpers/index.d.ts +1 -0
  52. package/ts3.4/types/lookAt/helpers/utils/FanBufferGeometry.d.ts +13 -0
  53. package/ts3.4/types/lookAt/helpers/utils/LineAndSphereBufferGeometry.d.ts +13 -0
  54. package/ts3.4/types/lookAt/index.d.ts +8 -0
  55. package/ts3.4/types/lookAt/tests/VRMLookAt.test.d.ts +1 -0
  56. package/ts3.4/types/lookAt/tests/VRMLookAtBoneApplier.test.d.ts +1 -0
  57. package/ts3.4/types/lookAt/utils/calcAzimuthAltitude.d.ts +16 -0
  58. package/ts3.4/types/lookAt/utils/sanitizeAngle.d.ts +11 -0
  59. package/ts3.4/types/lookAt/utils/tests/calcAzimuthAltitude.test.d.ts +1 -0
  60. package/ts3.4/types/lookAt/utils/tests/sanitizeAngle.test.d.ts +1 -0
  61. package/ts3.4/types/meta/VRM0Meta.d.ts +62 -0
  62. package/ts3.4/types/meta/VRM1Meta.d.ts +86 -0
  63. package/ts3.4/types/meta/VRMMeta.d.ts +6 -0
  64. package/ts3.4/types/meta/VRMMetaLoaderPlugin.d.ts +32 -0
  65. package/ts3.4/types/meta/VRMMetaLoaderPluginOptions.d.ts +22 -0
  66. package/ts3.4/types/meta/index.d.ts +5 -0
  67. package/ts3.4/types/tests/matchers/toBeCloseToQuaternion.d.ts +10 -0
  68. package/ts3.4/types/tests/matchers/toBeCloseToVector3.d.ts +10 -0
  69. package/ts3.4/types/utils/getWorldQuaternionLite.d.ts +10 -0
  70. package/ts3.4/types/utils/gltfExtractPrimitivesFromNode.d.ts +21 -0
  71. package/ts3.4/types/utils/gltfGetAssociatedMaterialIndex.d.ts +10 -0
  72. package/ts3.4/types/utils/quatInvertCompat.d.ts +8 -0
  73. package/ts3.4/types/utils/renameMaterialProperty.d.ts +1 -0
  74. package/ts3.4/types/utils/resolveURL.d.ts +4 -0
  75. package/ts3.4/types/utils/saturate.d.ts +6 -0
@@ -0,0 +1,149 @@
1
+ import * as THREE from 'three';
2
+ import { VRMHumanoid } from '../humanoid';
3
+ import { VRMLookAtApplier } from './VRMLookAtApplier';
4
+ /**
5
+ * A class controls eye gaze movements of a VRM.
6
+ */
7
+ export declare class VRMLookAt {
8
+ static readonly EULER_ORDER = "YXZ";
9
+ /**
10
+ * The origin of LookAt. Position offset from the head bone.
11
+ */
12
+ offsetFromHeadBone: THREE.Vector3;
13
+ /**
14
+ * Its associated {@link VRMHumanoid}.
15
+ */
16
+ readonly humanoid: VRMHumanoid;
17
+ /**
18
+ * The {@link VRMLookAtApplier} of the LookAt.
19
+ */
20
+ applier: VRMLookAtApplier;
21
+ /**
22
+ * If this is true, the LookAt will be updated automatically by calling {@link update}, towarding the direction to the {@link target}.
23
+ * `true` by default.
24
+ *
25
+ * See also: {@link target}
26
+ */
27
+ autoUpdate: boolean;
28
+ /**
29
+ * The target object of the LookAt.
30
+ * Note that it does not make any sense if {@link autoUpdate} is disabled.
31
+ *
32
+ * See also: {@link autoUpdate}
33
+ */
34
+ target?: THREE.Object3D | null;
35
+ /**
36
+ * The front direction of the face.
37
+ * Intended to be used for VRM 0.0 compat (VRM 0.0 models are facing Z- instead of Z+).
38
+ * You usually don't want to touch this.
39
+ */
40
+ faceFront: THREE.Vector3;
41
+ /**
42
+ * Its current angle around Y axis, in degree.
43
+ */
44
+ protected _yaw: number;
45
+ /*
46
+ * Its current angle around Y axis, in degree.
47
+
48
+
49
+ * Its current angle around Y axis, in degree.
50
+ */
51
+ yaw: number;
52
+ /**
53
+ * Its current angle around X axis, in degree.
54
+ */
55
+ protected _pitch: number;
56
+ /*
57
+ * Its current angle around X axis, in degree.
58
+
59
+
60
+ * Its current angle around X axis, in degree.
61
+ */
62
+ pitch: number;
63
+ /**
64
+ * Specifies that angles need to be applied to its [@link applier].
65
+ */
66
+ protected _needsUpdate: boolean;
67
+ /**
68
+ * World rotation of the head in its rest pose.
69
+ */
70
+ private _restHeadWorldQuaternion;
71
+ /*
72
+ * @deprecated Use {@link getEuler} instead.
73
+ */
74
+ readonly euler: THREE.Euler;
75
+ /**
76
+ * Create a new {@link VRMLookAt}.
77
+ *
78
+ * @param humanoid A {@link VRMHumanoid}
79
+ * @param applier A {@link VRMLookAtApplier}
80
+ */
81
+ constructor(humanoid: VRMHumanoid, applier: VRMLookAtApplier);
82
+ /**
83
+ * Get its yaw-pitch angles as an `Euler`.
84
+ * Does NOT consider {@link faceFront}; it returns `Euler(0, 0, 0; "YXZ")` by default regardless of the faceFront value.
85
+ *
86
+ * @param target The target euler
87
+ */
88
+ getEuler(target: THREE.Euler): THREE.Euler;
89
+ /**
90
+ * Copy the given {@link VRMLookAt} into this one.
91
+ * {@link humanoid} must be same as the source one.
92
+ * {@link applier} will reference the same instance as the source one.
93
+ * @param source The {@link VRMLookAt} you want to copy
94
+ * @returns this
95
+ */
96
+ copy(source: VRMLookAt): this;
97
+ /**
98
+ * Returns a clone of this {@link VRMLookAt}.
99
+ * Note that {@link humanoid} and {@link applier} will reference the same instance as this one.
100
+ * @returns Copied {@link VRMLookAt}
101
+ */
102
+ clone(): VRMLookAt;
103
+ /**
104
+ * Reset the lookAt direction (yaw and pitch) to the initial direction.
105
+ */
106
+ reset(): void;
107
+ /**
108
+ * Get its lookAt position in world coordinate.
109
+ *
110
+ * @param target A target `THREE.Vector3`
111
+ */
112
+ getLookAtWorldPosition(target: THREE.Vector3): THREE.Vector3;
113
+ /**
114
+ * Get its lookAt rotation in world coordinate.
115
+ * Does NOT consider {@link faceFront}.
116
+ *
117
+ * @param target A target `THREE.Quaternion`
118
+ */
119
+ getLookAtWorldQuaternion(target: THREE.Quaternion): THREE.Quaternion;
120
+ /**
121
+ * Get a quaternion that rotates the +Z unit vector of the humanoid Head to the {@link faceFront} direction.
122
+ *
123
+ * @param target A target `THREE.Quaternion`
124
+ */
125
+ getFaceFrontQuaternion(target: THREE.Quaternion): THREE.Quaternion;
126
+ /**
127
+ * Get its LookAt direction in world coordinate.
128
+ *
129
+ * @param target A target `THREE.Vector3`
130
+ */
131
+ getLookAtWorldDirection(target: THREE.Vector3): THREE.Vector3;
132
+ /**
133
+ * Set its lookAt target position.
134
+ *
135
+ * Note that its result will be instantly overwritten if {@link VRMLookAtHead.autoUpdate} is enabled.
136
+ *
137
+ * If you want to track an object continuously, you might want to use {@link target} instead.
138
+ *
139
+ * @param position A target position, in world space
140
+ */
141
+ lookAt(position: THREE.Vector3): void;
142
+ /**
143
+ * Update the VRMLookAtHead.
144
+ * If {@link autoUpdate} is enabled, this will make it look at the {@link target}.
145
+ *
146
+ * @param delta deltaTime, it isn't used though. You can use the parameter if you want to use this in your own extended {@link VRMLookAt}.
147
+ */
148
+ update(delta: number): void;
149
+ }
@@ -0,0 +1,18 @@
1
+ import * as THREE from 'three';
2
+ /**
3
+ * This class is used by {@link VRMLookAt}, applies look at direction.
4
+ * There are currently two variant of applier: {@link VRMLookAtBoneApplier} and {@link VRMLookAtExpressionApplier}.
5
+ */
6
+ export interface VRMLookAtApplier {
7
+ /**
8
+ * Apply look at direction to its associated VRM model.
9
+ *
10
+ * @param yaw Rotation around Y axis, in degree
11
+ * @param pitch Rotation around X axis, in degree
12
+ */
13
+ applyYawPitch: (yaw: number, pitch: number) => void;
14
+ /**
15
+ * @deprecated Use {@link applyYawPitch} instead.
16
+ */
17
+ lookAt: (euler: THREE.Euler) => void;
18
+ }
@@ -0,0 +1,83 @@
1
+ import { VRMHumanoid } from '../humanoid';
2
+ import * as THREE from 'three';
3
+ import { VRMLookAtApplier } from './VRMLookAtApplier';
4
+ import { VRMLookAtRangeMap } from './VRMLookAtRangeMap';
5
+ /**
6
+ * A class that applies eye gaze directions to a VRM.
7
+ * It will be used by {@link VRMLookAt}.
8
+ */
9
+ export declare class VRMLookAtBoneApplier implements VRMLookAtApplier {
10
+ /**
11
+ * Represent its type of applier.
12
+ */
13
+ static readonly type = "bone";
14
+ /**
15
+ * Its associated {@link VRMHumanoid}.
16
+ */
17
+ readonly humanoid: VRMHumanoid;
18
+ /**
19
+ * A {@link VRMLookAtRangeMap} for horizontal inward movement. The left eye moves right. The right eye moves left.
20
+ */
21
+ rangeMapHorizontalInner: VRMLookAtRangeMap;
22
+ /**
23
+ * A {@link VRMLookAtRangeMap} for horizontal outward movement. The left eye moves left. The right eye moves right.
24
+ */
25
+ rangeMapHorizontalOuter: VRMLookAtRangeMap;
26
+ /**
27
+ * A {@link VRMLookAtRangeMap} for vertical downward movement. Both eyes move upwards.
28
+ */
29
+ rangeMapVerticalDown: VRMLookAtRangeMap;
30
+ /**
31
+ * A {@link VRMLookAtRangeMap} for vertical upward movement. Both eyes move downwards.
32
+ */
33
+ rangeMapVerticalUp: VRMLookAtRangeMap;
34
+ /**
35
+ * The front direction of the face.
36
+ * Intended to be used for VRM 0.0 compat (VRM 0.0 models are facing Z- instead of Z+).
37
+ * You usually don't want to touch this.
38
+ */
39
+ faceFront: THREE.Vector3;
40
+ /**
41
+ * The rest quaternion of LeftEye bone.
42
+ */
43
+ private _restQuatLeftEye;
44
+ /**
45
+ * The rest quaternion of RightEye bone.
46
+ */
47
+ private _restQuatRightEye;
48
+ /**
49
+ * The world-space rest quaternion of the parent of the humanoid LeftEye.
50
+ */
51
+ private _restLeftEyeParentWorldQuat;
52
+ /**
53
+ * The world-space rest quaternion of the parent of the humanoid RightEye.
54
+ */
55
+ private _restRightEyeParentWorldQuat;
56
+ /**
57
+ * Create a new {@link VRMLookAtBoneApplier}.
58
+ *
59
+ * @param humanoid A {@link VRMHumanoid}
60
+ * @param rangeMapHorizontalInner A {@link VRMLookAtRangeMap} used for inner transverse direction
61
+ * @param rangeMapHorizontalOuter A {@link VRMLookAtRangeMap} used for outer transverse direction
62
+ * @param rangeMapVerticalDown A {@link VRMLookAtRangeMap} used for down direction
63
+ * @param rangeMapVerticalUp A {@link VRMLookAtRangeMap} used for up direction
64
+ */
65
+ constructor(humanoid: VRMHumanoid, rangeMapHorizontalInner: VRMLookAtRangeMap, rangeMapHorizontalOuter: VRMLookAtRangeMap, rangeMapVerticalDown: VRMLookAtRangeMap, rangeMapVerticalUp: VRMLookAtRangeMap);
66
+ /**
67
+ * Apply the input angle to its associated VRM model.
68
+ *
69
+ * @param yaw Rotation around Y axis, in degree
70
+ * @param pitch Rotation around X axis, in degree
71
+ */
72
+ applyYawPitch(yaw: number, pitch: number): void;
73
+ /**
74
+ * @deprecated Use {@link applyYawPitch} instead.
75
+ */
76
+ lookAt(euler: THREE.Euler): void;
77
+ /**
78
+ * Get a quaternion that rotates the world-space +Z unit vector to the {@link faceFront} direction.
79
+ *
80
+ * @param target A target `THREE.Quaternion`
81
+ */
82
+ private _getWorldFaceFrontQuat;
83
+ }
@@ -0,0 +1,56 @@
1
+ import { VRMExpressionManager } from '../expressions';
2
+ import * as THREE from 'three';
3
+ import { VRMLookAtApplier } from './VRMLookAtApplier';
4
+ import { VRMLookAtRangeMap } from './VRMLookAtRangeMap';
5
+ /**
6
+ * A class that applies eye gaze directions to a VRM.
7
+ * It will be used by {@link VRMLookAt}.
8
+ */
9
+ export declare class VRMLookAtExpressionApplier implements VRMLookAtApplier {
10
+ /**
11
+ * Represent its type of applier.
12
+ */
13
+ static readonly type = "expression";
14
+ /**
15
+ * Its associated {@link VRMExpressionManager}.
16
+ */
17
+ readonly expressions: VRMExpressionManager;
18
+ /**
19
+ * It won't be used in expression applier.
20
+ * See also: {@link rangeMapHorizontalOuter}
21
+ */
22
+ rangeMapHorizontalInner: VRMLookAtRangeMap;
23
+ /**
24
+ * A {@link VRMLookAtRangeMap} for horizontal movement. Both eyes move left or right.
25
+ */
26
+ rangeMapHorizontalOuter: VRMLookAtRangeMap;
27
+ /**
28
+ * A {@link VRMLookAtRangeMap} for vertical downward movement. Both eyes move upwards.
29
+ */
30
+ rangeMapVerticalDown: VRMLookAtRangeMap;
31
+ /**
32
+ * A {@link VRMLookAtRangeMap} for vertical upward movement. Both eyes move downwards.
33
+ */
34
+ rangeMapVerticalUp: VRMLookAtRangeMap;
35
+ /**
36
+ * Create a new {@link VRMLookAtExpressionApplier}.
37
+ *
38
+ * @param expressions A {@link VRMExpressionManager}
39
+ * @param rangeMapHorizontalInner A {@link VRMLookAtRangeMap} used for inner transverse direction
40
+ * @param rangeMapHorizontalOuter A {@link VRMLookAtRangeMap} used for outer transverse direction
41
+ * @param rangeMapVerticalDown A {@link VRMLookAtRangeMap} used for down direction
42
+ * @param rangeMapVerticalUp A {@link VRMLookAtRangeMap} used for up direction
43
+ */
44
+ constructor(expressions: VRMExpressionManager, rangeMapHorizontalInner: VRMLookAtRangeMap, rangeMapHorizontalOuter: VRMLookAtRangeMap, rangeMapVerticalDown: VRMLookAtRangeMap, rangeMapVerticalUp: VRMLookAtRangeMap);
45
+ /**
46
+ * Apply the input angle to its associated VRM model.
47
+ *
48
+ * @param yaw Rotation around Y axis, in degree
49
+ * @param pitch Rotation around X axis, in degree
50
+ */
51
+ applyYawPitch(yaw: number, pitch: number): void;
52
+ /**
53
+ * @deprecated Use {@link applyYawPitch} instead.
54
+ */
55
+ lookAt(euler: THREE.Euler): void;
56
+ }
@@ -0,0 +1,30 @@
1
+ import { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
2
+ import { VRMLookAtLoaderPluginOptions } from './VRMLookAtLoaderPluginOptions';
3
+ /**
4
+ * A plugin of GLTFLoader that imports a {@link VRMLookAt} from a VRM extension of a GLTF.
5
+ */
6
+ export declare class VRMLookAtLoaderPlugin implements GLTFLoaderPlugin {
7
+ /**
8
+ * Specify an Object3D to add {@link VRMLookAtHelper} s.
9
+ * If not specified, helper will not be created.
10
+ * If `renderOrder` is set to the root, helpers will copy the same `renderOrder` .
11
+ */
12
+ helperRoot?: THREE.Object3D;
13
+ readonly parser: GLTFParser;
14
+ readonly name: string;
15
+ constructor(parser: GLTFParser, options?: VRMLookAtLoaderPluginOptions);
16
+ afterRoot(gltf: GLTF): Promise<void>;
17
+ /**
18
+ * Import a {@link VRMLookAt} from a VRM.
19
+ *
20
+ * @param gltf A parsed result of GLTF taken from GLTFLoader
21
+ * @param humanoid A {@link VRMHumanoid} instance that represents the VRM
22
+ * @param expressions A {@link VRMExpressionManager} instance that represents the VRM
23
+ */
24
+ private _import;
25
+ private _v1Import;
26
+ private _v1ImportRangeMap;
27
+ private _v0Import;
28
+ private _v0ImportDegreeMap;
29
+ private _importLookAt;
30
+ }
@@ -0,0 +1,8 @@
1
+ export interface VRMLookAtLoaderPluginOptions {
2
+ /**
3
+ * Specify an Object3D to add {@link VRMLookAtHelper} s.
4
+ * If not specified, helper will not be created.
5
+ * If `renderOrder` is set to the root, helpers will copy the same `renderOrder` .
6
+ */
7
+ helperRoot?: THREE.Object3D;
8
+ }
@@ -0,0 +1,23 @@
1
+ export declare class VRMLookAtRangeMap {
2
+ /**
3
+ * Limits the maximum angle of the input angle of the LookAt vector from the front of the head (the positive z axis).
4
+ */
5
+ inputMaxValue: number;
6
+ /**
7
+ * Represents an angle (in degrees) for bone type of LookAt appliers, or a weight for expression type of LookAt appliers.
8
+ * The input value will take `1.0` when the input angle equals (or greater) to {@link inputMaxValue}.
9
+ */
10
+ outputScale: number;
11
+ /**
12
+ * Create a new {@link VRMLookAtRangeMap}.
13
+ *
14
+ * @param inputMaxValue The {@link inputMaxValue} of the map
15
+ * @param outputScale The {@link outputScale} of the map
16
+ */
17
+ constructor(inputMaxValue: number, outputScale: number);
18
+ /**
19
+ * Evaluate an input value and output a mapped value.
20
+ * @param src The input value
21
+ */
22
+ map(src: number): number;
23
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Represents a type of applier.
3
+ */
4
+ export declare const VRMLookAtTypeName: {
5
+ Bone: string;
6
+ Expression: string;
7
+ };
8
+ export type VRMLookAtTypeName = typeof VRMLookAtTypeName[keyof typeof VRMLookAtTypeName];
@@ -0,0 +1,11 @@
1
+ import * as THREE from 'three';
2
+ import { VRMLookAt } from '../VRMLookAt';
3
+ export declare class VRMLookAtHelper extends THREE.Group {
4
+ readonly vrmLookAt: VRMLookAt;
5
+ private readonly _meshYaw;
6
+ private readonly _meshPitch;
7
+ private readonly _lineTarget;
8
+ constructor(lookAt: VRMLookAt);
9
+ dispose(): void;
10
+ updateMatrixWorld(force: boolean): void;
11
+ }
@@ -0,0 +1 @@
1
+ export { VRMLookAtHelper } from './VRMLookAtHelper';
@@ -0,0 +1,13 @@
1
+ import * as THREE from 'three';
2
+ export declare class FanBufferGeometry extends THREE.BufferGeometry {
3
+ theta: number;
4
+ radius: number;
5
+ private _currentTheta;
6
+ private _currentRadius;
7
+ private readonly _attrPos;
8
+ private readonly _attrIndex;
9
+ constructor();
10
+ update(): void;
11
+ private _buildPosition;
12
+ private _buildIndex;
13
+ }
@@ -0,0 +1,13 @@
1
+ import * as THREE from 'three';
2
+ export declare class LineAndSphereBufferGeometry extends THREE.BufferGeometry {
3
+ radius: number;
4
+ tail: THREE.Vector3;
5
+ private _currentRadius;
6
+ private _currentTail;
7
+ private readonly _attrPos;
8
+ private readonly _attrIndex;
9
+ constructor();
10
+ update(): void;
11
+ private _buildPosition;
12
+ private _buildIndex;
13
+ }
@@ -0,0 +1,8 @@
1
+ export * from './helpers';
2
+ export { VRMLookAt } from './VRMLookAt';
3
+ export { VRMLookAtApplier } from './VRMLookAtApplier';
4
+ export { VRMLookAtBoneApplier } from './VRMLookAtBoneApplier';
5
+ export { VRMLookAtExpressionApplier } from './VRMLookAtExpressionApplier';
6
+ export { VRMLookAtLoaderPlugin } from './VRMLookAtLoaderPlugin';
7
+ export { VRMLookAtRangeMap } from './VRMLookAtRangeMap';
8
+ export { VRMLookAtTypeName } from './VRMLookAtTypeName';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import * as THREE from 'three';
2
+ /**
3
+ * Calculate azimuth / altitude angles from a vector.
4
+ *
5
+ * This returns a difference of angles from (1, 0, 0).
6
+ * Azimuth represents an angle around Y axis.
7
+ * Altitude represents an angle around Z axis.
8
+ * It is rotated in intrinsic Y-Z order.
9
+ *
10
+ * @param vector The vector
11
+ * @returns A tuple contains two angles, `[ azimuth, altitude ]`
12
+ */
13
+ export declare function calcAzimuthAltitude(vector: THREE.Vector3): [
14
+ /*azimuth*/ number,
15
+ /*altitude*/ number
16
+ ];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Make sure the angle is within -PI to PI.
3
+ *
4
+ * @example
5
+ * ```js
6
+ * sanitizeAngle(1.5 * Math.PI) // -0.5 * PI
7
+ * ```
8
+ *
9
+ * @param angle An input angle
10
+ */
11
+ export declare function sanitizeAngle(angle: number): number;
@@ -0,0 +1,62 @@
1
+ import * as THREE from 'three';
2
+ /**
3
+ * Interface represents metadata of a VRM 0.0 model.
4
+ */
5
+ export interface VRM0Meta {
6
+ /**
7
+ * The version of meta.
8
+ */
9
+ metaVersion: '0';
10
+ /**
11
+ * Enum indicates a condition who can perform with this avatar.
12
+ */
13
+ allowedUserName?: 'Everyone' | 'ExplicitlyLicensedPerson' | 'OnlyAuthor';
14
+ /**
15
+ * Author of the model.
16
+ */
17
+ author?: string;
18
+ /**
19
+ * Enum indicates allow or disallow commercial use.
20
+ */
21
+ commercialUssageName?: 'Allow' | 'Disallow';
22
+ /**
23
+ * Contact Information of its author.
24
+ */
25
+ contactInformation?: string;
26
+ /**
27
+ * Enum indicates a license type.
28
+ */
29
+ licenseName?: 'CC0' | 'CC_BY' | 'CC_BY_NC' | 'CC_BY_NC_ND' | 'CC_BY_NC_SA' | 'CC_BY_ND' | 'CC_BY_SA' | 'Other' | 'Redistribution_Prohibited';
30
+ /**
31
+ * If `Other` is selected for {@link licenseName}, put the URL link of the license document here.
32
+ */
33
+ otherLicenseUrl?: string;
34
+ /**
35
+ * If there are any conditions not mentioned in {@link licenseName} or {@link otherLicenseUrl}, put the URL link of the license document here.
36
+ */
37
+ otherPermissionUrl?: string;
38
+ /**
39
+ * Reference of the model.
40
+ */
41
+ reference?: string;
42
+ /**
43
+ * Enum indicates allow or disallow sexual expressions.
44
+ */
45
+ sexualUssageName?: 'Allow' | 'Disallow';
46
+ /**
47
+ * Thumbnail of the model.
48
+ */
49
+ texture?: THREE.Texture;
50
+ /**
51
+ * Title of the model.
52
+ */
53
+ title?: string;
54
+ /**
55
+ * Version of the model.
56
+ */
57
+ version?: string;
58
+ /**
59
+ * Enum indicates allow or disallow violent expressions.
60
+ */
61
+ violentUssageName?: 'Allow' | 'Disallow';
62
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Interface represents metadata of a VRM 1.0 model.
3
+ */
4
+ export interface VRM1Meta {
5
+ /**
6
+ * The version of meta.
7
+ */
8
+ metaVersion: '1';
9
+ /**
10
+ * The name of the model.
11
+ */
12
+ name: string;
13
+ /**
14
+ * The version of the model.
15
+ */
16
+ version?: string;
17
+ /**
18
+ * Authors of the model.
19
+ */
20
+ authors: string[];
21
+ /**
22
+ * An information that describes the copyright of the model.
23
+ */
24
+ copyrightInformation?: string;
25
+ /**
26
+ * An information that describes the contact information of the author.
27
+ */
28
+ contactInformation?: string;
29
+ /**
30
+ * References / original works of the model.
31
+ */
32
+ references?: string[];
33
+ /**
34
+ * Third party licenses of the model, if required. You can use line breaks.
35
+ */
36
+ thirdPartyLicenses?: string;
37
+ /**
38
+ * An image of the thumbnail image of the model.
39
+ * This is for the application to use as an icon.
40
+ */
41
+ thumbnailImage?: HTMLImageElement;
42
+ /**
43
+ * A URL towards the license document this model refers to
44
+ */
45
+ licenseUrl: string;
46
+ /**
47
+ * A person who can perform as an avatar with this model.
48
+ */
49
+ avatarPermission?: 'onlyAuthor' | 'onlySeparatelyLicensedPerson' | 'everyone';
50
+ /**
51
+ * A flag that permits to use this model in excessively violent contents.
52
+ */
53
+ allowExcessivelyViolentUsage?: boolean;
54
+ /**
55
+ * A flag that permits to use this model in excessively sexual contents.
56
+ */
57
+ allowExcessivelySexualUsage?: boolean;
58
+ /**
59
+ * An option that permits to use this model in commercial products.
60
+ */
61
+ commercialUsage?: 'personalNonProfit' | 'personalProfit' | 'corporation';
62
+ /**
63
+ * A flag that permits to use this model in political or religious contents.
64
+ */
65
+ allowPoliticalOrReligiousUsage?: boolean;
66
+ /**
67
+ * A flag that permits to use this model in contents contain anti-social activities or hate speeches.
68
+ */
69
+ allowAntisocialOrHateUsage?: boolean;
70
+ /**
71
+ * An option that forces or abandons to display the credit of this model.
72
+ */
73
+ creditNotation?: 'required' | 'unnecessary';
74
+ /**
75
+ * A flag that permits to redistribute this model.
76
+ */
77
+ allowRedistribution?: boolean;
78
+ /**
79
+ * An option that controls the condition to modify this model.
80
+ */
81
+ modification?: 'prohibited' | 'allowModification' | 'allowModificationRedistribution';
82
+ /**
83
+ * Describe the URL links of other license.
84
+ */
85
+ otherLicenseUrl?: string;
86
+ }
@@ -0,0 +1,6 @@
1
+ import { VRM0Meta } from './VRM0Meta';
2
+ import { VRM1Meta } from './VRM1Meta';
3
+ /**
4
+ * VRMMeta can be either {@link VRM0Meta} or {@link VRM1Meta}.
5
+ */
6
+ export type VRMMeta = VRM0Meta | VRM1Meta;
@@ -0,0 +1,32 @@
1
+ import { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
2
+ import { VRMMetaLoaderPluginOptions } from './VRMMetaLoaderPluginOptions';
3
+ /**
4
+ * A plugin of GLTFLoader that imports a {@link VRM1Meta} from a VRM extension of a GLTF.
5
+ */
6
+ export declare class VRMMetaLoaderPlugin implements GLTFLoaderPlugin {
7
+ readonly parser: GLTFParser;
8
+ /**
9
+ * If `false`, it won't load its thumbnail image ({@link VRM1Meta.thumbnailImage}).
10
+ * `true` by default.
11
+ */
12
+ needThumbnailImage: boolean;
13
+ /**
14
+ * A list of license urls.
15
+ * This meta loader will accept these `licenseUrl`s.
16
+ * Otherwise it won't be loaded.
17
+ */
18
+ acceptLicenseUrls: string[];
19
+ /**
20
+ * Whether it should accept VRM0.0 meta or not.
21
+ * Note that it might load {@link VRM0Meta} instead of {@link VRM1Meta} when this is `true`.
22
+ * `true` by default.
23
+ */
24
+ acceptV0Meta: boolean;
25
+ readonly name: string;
26
+ constructor(parser: GLTFParser, options?: VRMMetaLoaderPluginOptions);
27
+ afterRoot(gltf: GLTF): Promise<void>;
28
+ private _import;
29
+ private _v1Import;
30
+ private _v0Import;
31
+ private _extractGLTFImage;
32
+ }