@pixiv/three-vrm-core 1.0.0-beta.9 → 1.0.1
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.
- package/lib/three-vrm-core.js +3367 -2551
- package/lib/three-vrm-core.min.js +2 -2
- package/lib/three-vrm-core.module.js +3365 -2552
- package/lib/three-vrm-core.module.min.js +2 -2
- package/package.json +12 -12
- package/ts3.4/types/VRMCore.d.ts +7 -7
- package/ts3.4/types/VRMCoreLoaderPluginOptions.d.ts +1 -0
- package/ts3.4/types/VRMCoreParameters.d.ts +2 -2
- package/ts3.4/types/expressions/VRMExpression.d.ts +1 -1
- package/ts3.4/types/expressions/VRMExpressionMaterialColorBind.d.ts +3 -0
- package/ts3.4/types/expressions/VRMExpressionMaterialColorType.d.ts +4 -0
- package/ts3.4/types/humanoid/VRMHumanBoneList.d.ts +5 -0
- package/ts3.4/types/humanoid/VRMHumanBoneName.d.ts +7 -2
- package/ts3.4/types/humanoid/VRMHumanBoneParentMap.d.ts +9 -0
- package/ts3.4/types/humanoid/VRMHumanoid.d.ts +130 -21
- package/ts3.4/types/humanoid/VRMHumanoidLoaderPlugin.d.ts +9 -1
- package/ts3.4/types/humanoid/VRMHumanoidLoaderPluginOptions.d.ts +15 -0
- package/ts3.4/types/humanoid/VRMHumanoidRig.d.ts +31 -0
- package/ts3.4/types/humanoid/VRMRig.d.ts +62 -0
- package/ts3.4/types/humanoid/helpers/VRMHumanoidHelper.d.ts +9 -0
- package/ts3.4/types/humanoid/helpers/index.d.ts +1 -0
- package/ts3.4/types/humanoid/index.d.ts +4 -0
- package/ts3.4/types/lookAt/VRMLookAt.d.ts +48 -6
- package/ts3.4/types/lookAt/VRMLookAtApplier.d.ts +8 -2
- package/ts3.4/types/lookAt/VRMLookAtBoneApplier.d.ts +35 -2
- package/ts3.4/types/lookAt/VRMLookAtExpressionApplier.d.ts +7 -2
- package/ts3.4/types/lookAt/tests/VRMLookAt.test.d.ts +1 -0
- package/ts3.4/types/lookAt/tests/VRMLookAtBoneApplier.test.d.ts +1 -0
- package/ts3.4/types/lookAt/utils/calcAzimuthAltitude.d.ts +16 -0
- package/ts3.4/types/lookAt/utils/sanitizeAngle.d.ts +11 -0
- package/ts3.4/types/lookAt/utils/tests/calcAzimuthAltitude.test.d.ts +1 -0
- package/ts3.4/types/lookAt/utils/tests/sanitizeAngle.test.d.ts +1 -0
- package/ts3.4/types/meta/VRMMetaLoaderPlugin.d.ts +1 -1
- package/ts3.4/types/meta/VRMMetaLoaderPluginOptions.d.ts +1 -1
- package/ts3.4/types/tests/matchers/toBeCloseToQuaternion.d.ts +10 -0
- package/ts3.4/types/tests/matchers/toBeCloseToVector3.d.ts +10 -0
- package/ts3.4/types/utils/renameMaterialProperty.d.ts +1 -0
- package/types/VRMCore.d.ts +58 -58
- package/types/VRMCoreLoaderPlugin.d.ts +18 -18
- package/types/VRMCoreLoaderPluginOptions.d.ts +19 -18
- package/types/VRMCoreParameters.d.ts +16 -16
- package/types/expressions/VRMExpression.d.ts +64 -64
- package/types/expressions/VRMExpressionBind.d.ts +11 -11
- package/types/expressions/VRMExpressionLoaderPlugin.d.ts +23 -23
- package/types/expressions/VRMExpressionManager.d.ts +124 -124
- package/types/expressions/VRMExpressionMaterialColorBind.d.ts +45 -42
- package/types/expressions/VRMExpressionMaterialColorType.d.ts +12 -8
- package/types/expressions/VRMExpressionMorphTargetBind.d.ts +35 -35
- package/types/expressions/VRMExpressionOverrideType.d.ts +6 -6
- package/types/expressions/VRMExpressionPresetName.d.ts +21 -21
- package/types/expressions/VRMExpressionTextureTransformBind.d.ts +40 -40
- package/types/expressions/index.d.ts +10 -10
- package/types/firstPerson/VRMFirstPerson.d.ts +84 -84
- package/types/firstPerson/VRMFirstPersonLoaderPlugin.d.ts +20 -20
- package/types/firstPerson/VRMFirstPersonMeshAnnotation.d.ts +5 -5
- package/types/firstPerson/VRMFirstPersonMeshAnnotationType.d.ts +7 -7
- package/types/firstPerson/index.d.ts +4 -4
- package/types/humanoid/VRMHumanBone.d.ts +10 -10
- package/types/humanoid/VRMHumanBoneList.d.ts +5 -0
- package/types/humanoid/VRMHumanBoneName.d.ts +63 -58
- package/types/humanoid/VRMHumanBoneParentMap.d.ts +9 -0
- package/types/humanoid/VRMHumanBones.d.ts +11 -11
- package/types/humanoid/VRMHumanoid.d.ts +182 -73
- package/types/humanoid/VRMHumanoidLoaderPlugin.d.ts +32 -24
- package/types/humanoid/VRMHumanoidLoaderPluginOptions.d.ts +15 -0
- package/types/humanoid/VRMHumanoidRig.d.ts +31 -0
- package/types/humanoid/VRMPose.d.ts +24 -24
- package/types/humanoid/VRMPoseTransform.d.ts +15 -15
- package/types/humanoid/VRMRequiredHumanBoneName.d.ts +18 -18
- package/types/humanoid/VRMRig.d.ts +62 -0
- package/types/humanoid/helpers/VRMHumanoidHelper.d.ts +9 -0
- package/types/humanoid/helpers/index.d.ts +1 -0
- package/types/humanoid/index.d.ts +12 -8
- package/types/index.d.ts +9 -9
- package/types/lookAt/VRMLookAt.d.ts +148 -104
- package/types/lookAt/VRMLookAtApplier.d.ts +18 -12
- package/types/lookAt/VRMLookAtBoneApplier.d.ts +83 -50
- package/types/lookAt/VRMLookAtExpressionApplier.d.ts +56 -51
- package/types/lookAt/VRMLookAtLoaderPlugin.d.ts +30 -30
- package/types/lookAt/VRMLookAtLoaderPluginOptions.d.ts +8 -8
- package/types/lookAt/VRMLookAtRangeMap.d.ts +23 -23
- package/types/lookAt/VRMLookAtTypeName.d.ts +8 -8
- package/types/lookAt/helpers/VRMLookAtHelper.d.ts +11 -11
- package/types/lookAt/helpers/index.d.ts +1 -1
- package/types/lookAt/helpers/utils/FanBufferGeometry.d.ts +13 -13
- package/types/lookAt/helpers/utils/LineAndSphereBufferGeometry.d.ts +13 -13
- package/types/lookAt/index.d.ts +8 -8
- package/types/lookAt/tests/VRMLookAt.test.d.ts +1 -0
- package/types/lookAt/tests/VRMLookAtBoneApplier.test.d.ts +1 -0
- package/types/lookAt/utils/calcAzimuthAltitude.d.ts +13 -0
- package/types/lookAt/utils/sanitizeAngle.d.ts +11 -0
- package/types/lookAt/utils/tests/calcAzimuthAltitude.test.d.ts +1 -0
- package/types/lookAt/utils/tests/sanitizeAngle.test.d.ts +1 -0
- package/types/meta/VRM0Meta.d.ts +62 -62
- package/types/meta/VRM1Meta.d.ts +86 -86
- package/types/meta/VRMMeta.d.ts +6 -6
- package/types/meta/VRMMetaLoaderPlugin.d.ts +32 -32
- package/types/meta/VRMMetaLoaderPluginOptions.d.ts +22 -22
- package/types/meta/index.d.ts +5 -5
- package/types/tests/matchers/toBeCloseToQuaternion.d.ts +10 -0
- package/types/tests/matchers/toBeCloseToVector3.d.ts +10 -0
- package/types/utils/getWorldQuaternionLite.d.ts +8 -8
- package/types/utils/gltfExtractPrimitivesFromNode.d.ts +21 -21
- package/types/utils/gltfGetAssociatedMaterialIndex.d.ts +10 -10
- package/types/utils/quatInvertCompat.d.ts +8 -8
- package/types/utils/renameMaterialProperty.d.ts +1 -0
- package/types/utils/resolveURL.d.ts +4 -4
- package/types/utils/saturate.d.ts +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const VRMExpressionOverrideType: {
|
|
2
|
-
readonly None: "none";
|
|
3
|
-
readonly Block: "block";
|
|
4
|
-
readonly Blend: "blend";
|
|
5
|
-
};
|
|
6
|
-
export declare type VRMExpressionOverrideType = typeof VRMExpressionOverrideType[keyof typeof VRMExpressionOverrideType];
|
|
1
|
+
export declare const VRMExpressionOverrideType: {
|
|
2
|
+
readonly None: "none";
|
|
3
|
+
readonly Block: "block";
|
|
4
|
+
readonly Blend: "blend";
|
|
5
|
+
};
|
|
6
|
+
export declare type VRMExpressionOverrideType = typeof VRMExpressionOverrideType[keyof typeof VRMExpressionOverrideType];
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export declare const VRMExpressionPresetName: {
|
|
2
|
-
readonly Aa: "aa";
|
|
3
|
-
readonly Ih: "ih";
|
|
4
|
-
readonly Ou: "ou";
|
|
5
|
-
readonly Ee: "ee";
|
|
6
|
-
readonly Oh: "oh";
|
|
7
|
-
readonly Blink: "blink";
|
|
8
|
-
readonly Happy: "happy";
|
|
9
|
-
readonly Angry: "angry";
|
|
10
|
-
readonly Sad: "sad";
|
|
11
|
-
readonly Relaxed: "relaxed";
|
|
12
|
-
readonly LookUp: "lookUp";
|
|
13
|
-
readonly Surprised: "surprised";
|
|
14
|
-
readonly LookDown: "lookDown";
|
|
15
|
-
readonly LookLeft: "lookLeft";
|
|
16
|
-
readonly LookRight: "lookRight";
|
|
17
|
-
readonly BlinkLeft: "blinkLeft";
|
|
18
|
-
readonly BlinkRight: "blinkRight";
|
|
19
|
-
readonly Neutral: "neutral";
|
|
20
|
-
};
|
|
21
|
-
export declare type VRMExpressionPresetName = typeof VRMExpressionPresetName[keyof typeof VRMExpressionPresetName];
|
|
1
|
+
export declare const VRMExpressionPresetName: {
|
|
2
|
+
readonly Aa: "aa";
|
|
3
|
+
readonly Ih: "ih";
|
|
4
|
+
readonly Ou: "ou";
|
|
5
|
+
readonly Ee: "ee";
|
|
6
|
+
readonly Oh: "oh";
|
|
7
|
+
readonly Blink: "blink";
|
|
8
|
+
readonly Happy: "happy";
|
|
9
|
+
readonly Angry: "angry";
|
|
10
|
+
readonly Sad: "sad";
|
|
11
|
+
readonly Relaxed: "relaxed";
|
|
12
|
+
readonly LookUp: "lookUp";
|
|
13
|
+
readonly Surprised: "surprised";
|
|
14
|
+
readonly LookDown: "lookDown";
|
|
15
|
+
readonly LookLeft: "lookLeft";
|
|
16
|
+
readonly LookRight: "lookRight";
|
|
17
|
+
readonly BlinkLeft: "blinkLeft";
|
|
18
|
+
readonly BlinkRight: "blinkRight";
|
|
19
|
+
readonly Neutral: "neutral";
|
|
20
|
+
};
|
|
21
|
+
export declare type VRMExpressionPresetName = typeof VRMExpressionPresetName[keyof typeof VRMExpressionPresetName];
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import type { VRMExpressionBind } from './VRMExpressionBind';
|
|
3
|
-
/**
|
|
4
|
-
* A bind of expression influences to texture transforms.
|
|
5
|
-
*/
|
|
6
|
-
export declare class VRMExpressionTextureTransformBind implements VRMExpressionBind {
|
|
7
|
-
private static _propertyNamesMap;
|
|
8
|
-
/**
|
|
9
|
-
* The target material.
|
|
10
|
-
*/
|
|
11
|
-
readonly material: THREE.Material;
|
|
12
|
-
/**
|
|
13
|
-
* The uv scale of the texture.
|
|
14
|
-
*/
|
|
15
|
-
readonly scale: THREE.Vector2;
|
|
16
|
-
/**
|
|
17
|
-
* The uv offset of the texture.
|
|
18
|
-
*/
|
|
19
|
-
readonly offset: THREE.Vector2;
|
|
20
|
-
/**
|
|
21
|
-
* The list of texture names and its state that should be transformed by this bind.
|
|
22
|
-
*/
|
|
23
|
-
private _properties;
|
|
24
|
-
constructor({ material, scale, offset, }: {
|
|
25
|
-
/**
|
|
26
|
-
* The target material.
|
|
27
|
-
*/
|
|
28
|
-
material: THREE.Material;
|
|
29
|
-
/**
|
|
30
|
-
* The uv scale of the texture.
|
|
31
|
-
*/
|
|
32
|
-
scale: THREE.Vector2;
|
|
33
|
-
/**
|
|
34
|
-
* The uv offset of the texture.
|
|
35
|
-
*/
|
|
36
|
-
offset: THREE.Vector2;
|
|
37
|
-
});
|
|
38
|
-
applyWeight(weight: number): void;
|
|
39
|
-
clearAppliedWeight(): void;
|
|
40
|
-
}
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { VRMExpressionBind } from './VRMExpressionBind';
|
|
3
|
+
/**
|
|
4
|
+
* A bind of expression influences to texture transforms.
|
|
5
|
+
*/
|
|
6
|
+
export declare class VRMExpressionTextureTransformBind implements VRMExpressionBind {
|
|
7
|
+
private static _propertyNamesMap;
|
|
8
|
+
/**
|
|
9
|
+
* The target material.
|
|
10
|
+
*/
|
|
11
|
+
readonly material: THREE.Material;
|
|
12
|
+
/**
|
|
13
|
+
* The uv scale of the texture.
|
|
14
|
+
*/
|
|
15
|
+
readonly scale: THREE.Vector2;
|
|
16
|
+
/**
|
|
17
|
+
* The uv offset of the texture.
|
|
18
|
+
*/
|
|
19
|
+
readonly offset: THREE.Vector2;
|
|
20
|
+
/**
|
|
21
|
+
* The list of texture names and its state that should be transformed by this bind.
|
|
22
|
+
*/
|
|
23
|
+
private _properties;
|
|
24
|
+
constructor({ material, scale, offset, }: {
|
|
25
|
+
/**
|
|
26
|
+
* The target material.
|
|
27
|
+
*/
|
|
28
|
+
material: THREE.Material;
|
|
29
|
+
/**
|
|
30
|
+
* The uv scale of the texture.
|
|
31
|
+
*/
|
|
32
|
+
scale: THREE.Vector2;
|
|
33
|
+
/**
|
|
34
|
+
* The uv offset of the texture.
|
|
35
|
+
*/
|
|
36
|
+
offset: THREE.Vector2;
|
|
37
|
+
});
|
|
38
|
+
applyWeight(weight: number): void;
|
|
39
|
+
clearAppliedWeight(): void;
|
|
40
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { VRMExpression } from './VRMExpression';
|
|
2
|
-
export type { VRMExpressionBind } from './VRMExpressionBind';
|
|
3
|
-
export { VRMExpressionLoaderPlugin } from './VRMExpressionLoaderPlugin';
|
|
4
|
-
export { VRMExpressionManager } from './VRMExpressionManager';
|
|
5
|
-
export type { VRMExpressionMaterialColorBind } from './VRMExpressionMaterialColorBind';
|
|
6
|
-
export { VRMExpressionMaterialColorType } from './VRMExpressionMaterialColorType';
|
|
7
|
-
export type { VRMExpressionMorphTargetBind } from './VRMExpressionMorphTargetBind';
|
|
8
|
-
export { VRMExpressionOverrideType } from './VRMExpressionOverrideType';
|
|
9
|
-
export { VRMExpressionPresetName } from './VRMExpressionPresetName';
|
|
10
|
-
export type { VRMExpressionTextureTransformBind } from './VRMExpressionTextureTransformBind';
|
|
1
|
+
export { VRMExpression } from './VRMExpression';
|
|
2
|
+
export type { VRMExpressionBind } from './VRMExpressionBind';
|
|
3
|
+
export { VRMExpressionLoaderPlugin } from './VRMExpressionLoaderPlugin';
|
|
4
|
+
export { VRMExpressionManager } from './VRMExpressionManager';
|
|
5
|
+
export type { VRMExpressionMaterialColorBind } from './VRMExpressionMaterialColorBind';
|
|
6
|
+
export { VRMExpressionMaterialColorType } from './VRMExpressionMaterialColorType';
|
|
7
|
+
export type { VRMExpressionMorphTargetBind } from './VRMExpressionMorphTargetBind';
|
|
8
|
+
export { VRMExpressionOverrideType } from './VRMExpressionOverrideType';
|
|
9
|
+
export { VRMExpressionPresetName } from './VRMExpressionPresetName';
|
|
10
|
+
export type { VRMExpressionTextureTransformBind } from './VRMExpressionTextureTransformBind';
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import type { VRMFirstPersonMeshAnnotation } from './VRMFirstPersonMeshAnnotation';
|
|
2
|
-
import type { VRMHumanoid } from '../humanoid';
|
|
3
|
-
export declare class VRMFirstPerson {
|
|
4
|
-
/**
|
|
5
|
-
* A default camera layer for `FirstPersonOnly` layer.
|
|
6
|
-
*
|
|
7
|
-
* @see [[getFirstPersonOnlyLayer]]
|
|
8
|
-
*/
|
|
9
|
-
static readonly DEFAULT_FIRSTPERSON_ONLY_LAYER = 9;
|
|
10
|
-
/**
|
|
11
|
-
* A default camera layer for `ThirdPersonOnly` layer.
|
|
12
|
-
*
|
|
13
|
-
* @see [[getThirdPersonOnlyLayer]]
|
|
14
|
-
*/
|
|
15
|
-
static readonly DEFAULT_THIRDPERSON_ONLY_LAYER = 10;
|
|
16
|
-
/**
|
|
17
|
-
* Its associated {@link VRMHumanoid}.
|
|
18
|
-
*/
|
|
19
|
-
readonly humanoid: VRMHumanoid;
|
|
20
|
-
meshAnnotations: VRMFirstPersonMeshAnnotation[];
|
|
21
|
-
private _firstPersonOnlyLayer;
|
|
22
|
-
private _thirdPersonOnlyLayer;
|
|
23
|
-
private _initializedLayers;
|
|
24
|
-
/**
|
|
25
|
-
* Create a new VRMFirstPerson object.
|
|
26
|
-
*
|
|
27
|
-
* @param humanoid A {@link VRMHumanoid}
|
|
28
|
-
* @param meshAnnotations A renderer settings. See the description of [[RendererFirstPersonFlags]] for more info
|
|
29
|
-
*/
|
|
30
|
-
constructor(humanoid: VRMHumanoid, meshAnnotations: VRMFirstPersonMeshAnnotation[]);
|
|
31
|
-
/**
|
|
32
|
-
* Copy the given {@link VRMFirstPerson} into this one.
|
|
33
|
-
* {@link humanoid} must be same as the source one.
|
|
34
|
-
* @param source The {@link VRMFirstPerson} you want to copy
|
|
35
|
-
* @returns this
|
|
36
|
-
*/
|
|
37
|
-
copy(source: VRMFirstPerson): this;
|
|
38
|
-
/**
|
|
39
|
-
* Returns a clone of this {@link VRMFirstPerson}.
|
|
40
|
-
* @returns Copied {@link VRMFirstPerson}
|
|
41
|
-
*/
|
|
42
|
-
clone(): VRMFirstPerson;
|
|
43
|
-
/**
|
|
44
|
-
* A camera layer represents `FirstPersonOnly` layer.
|
|
45
|
-
* Note that **you must call {@link setup} first before you use the layer feature** or it does not work properly.
|
|
46
|
-
*
|
|
47
|
-
* The value is {@link DEFAULT_FIRSTPERSON_ONLY_LAYER} by default but you can change the layer by specifying via {@link setup} if you prefer.
|
|
48
|
-
*
|
|
49
|
-
* @see https://vrm.dev/en/univrm/api/univrm_use_firstperson/
|
|
50
|
-
* @see https://threejs.org/docs/#api/en/core/Layers
|
|
51
|
-
*/
|
|
52
|
-
get firstPersonOnlyLayer(): number;
|
|
53
|
-
/**
|
|
54
|
-
* A camera layer represents `ThirdPersonOnly` layer.
|
|
55
|
-
* Note that **you must call {@link setup} first before you use the layer feature** or it does not work properly.
|
|
56
|
-
*
|
|
57
|
-
* The value is {@link DEFAULT_THIRDPERSON_ONLY_LAYER} by default but you can change the layer by specifying via {@link setup} if you prefer.
|
|
58
|
-
*
|
|
59
|
-
* @see https://vrm.dev/en/univrm/api/univrm_use_firstperson/
|
|
60
|
-
* @see https://threejs.org/docs/#api/en/core/Layers
|
|
61
|
-
*/
|
|
62
|
-
get thirdPersonOnlyLayer(): number;
|
|
63
|
-
/**
|
|
64
|
-
* In this method, it assigns layers for every meshes based on mesh annotations.
|
|
65
|
-
* You must call this method first before you use the layer feature.
|
|
66
|
-
*
|
|
67
|
-
* This is an equivalent of [VRMFirstPerson.Setup](https://github.com/vrm-c/UniVRM/blob/73a5bd8fcddaa2a7a8735099a97e63c9db3e5ea0/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs#L295-L299) of the UniVRM.
|
|
68
|
-
*
|
|
69
|
-
* The `cameraLayer` parameter specifies which layer will be assigned for `FirstPersonOnly` / `ThirdPersonOnly`.
|
|
70
|
-
* In UniVRM, we specified those by naming each desired layer as `FIRSTPERSON_ONLY_LAYER` / `THIRDPERSON_ONLY_LAYER`
|
|
71
|
-
* but we are going to specify these layers at here since we are unable to name layers in Three.js.
|
|
72
|
-
*
|
|
73
|
-
* @param cameraLayer Specify which layer will be for `FirstPersonOnly` / `ThirdPersonOnly`.
|
|
74
|
-
*/
|
|
75
|
-
setup({ firstPersonOnlyLayer, thirdPersonOnlyLayer, }?: {
|
|
76
|
-
firstPersonOnlyLayer?: number | undefined;
|
|
77
|
-
thirdPersonOnlyLayer?: number | undefined;
|
|
78
|
-
}): void;
|
|
79
|
-
private _excludeTriangles;
|
|
80
|
-
private _createErasedMesh;
|
|
81
|
-
private _createHeadlessModelForSkinnedMesh;
|
|
82
|
-
private _createHeadlessModel;
|
|
83
|
-
private _isEraseTarget;
|
|
84
|
-
}
|
|
1
|
+
import type { VRMFirstPersonMeshAnnotation } from './VRMFirstPersonMeshAnnotation';
|
|
2
|
+
import type { VRMHumanoid } from '../humanoid';
|
|
3
|
+
export declare class VRMFirstPerson {
|
|
4
|
+
/**
|
|
5
|
+
* A default camera layer for `FirstPersonOnly` layer.
|
|
6
|
+
*
|
|
7
|
+
* @see [[getFirstPersonOnlyLayer]]
|
|
8
|
+
*/
|
|
9
|
+
static readonly DEFAULT_FIRSTPERSON_ONLY_LAYER = 9;
|
|
10
|
+
/**
|
|
11
|
+
* A default camera layer for `ThirdPersonOnly` layer.
|
|
12
|
+
*
|
|
13
|
+
* @see [[getThirdPersonOnlyLayer]]
|
|
14
|
+
*/
|
|
15
|
+
static readonly DEFAULT_THIRDPERSON_ONLY_LAYER = 10;
|
|
16
|
+
/**
|
|
17
|
+
* Its associated {@link VRMHumanoid}.
|
|
18
|
+
*/
|
|
19
|
+
readonly humanoid: VRMHumanoid;
|
|
20
|
+
meshAnnotations: VRMFirstPersonMeshAnnotation[];
|
|
21
|
+
private _firstPersonOnlyLayer;
|
|
22
|
+
private _thirdPersonOnlyLayer;
|
|
23
|
+
private _initializedLayers;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new VRMFirstPerson object.
|
|
26
|
+
*
|
|
27
|
+
* @param humanoid A {@link VRMHumanoid}
|
|
28
|
+
* @param meshAnnotations A renderer settings. See the description of [[RendererFirstPersonFlags]] for more info
|
|
29
|
+
*/
|
|
30
|
+
constructor(humanoid: VRMHumanoid, meshAnnotations: VRMFirstPersonMeshAnnotation[]);
|
|
31
|
+
/**
|
|
32
|
+
* Copy the given {@link VRMFirstPerson} into this one.
|
|
33
|
+
* {@link humanoid} must be same as the source one.
|
|
34
|
+
* @param source The {@link VRMFirstPerson} you want to copy
|
|
35
|
+
* @returns this
|
|
36
|
+
*/
|
|
37
|
+
copy(source: VRMFirstPerson): this;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a clone of this {@link VRMFirstPerson}.
|
|
40
|
+
* @returns Copied {@link VRMFirstPerson}
|
|
41
|
+
*/
|
|
42
|
+
clone(): VRMFirstPerson;
|
|
43
|
+
/**
|
|
44
|
+
* A camera layer represents `FirstPersonOnly` layer.
|
|
45
|
+
* Note that **you must call {@link setup} first before you use the layer feature** or it does not work properly.
|
|
46
|
+
*
|
|
47
|
+
* The value is {@link DEFAULT_FIRSTPERSON_ONLY_LAYER} by default but you can change the layer by specifying via {@link setup} if you prefer.
|
|
48
|
+
*
|
|
49
|
+
* @see https://vrm.dev/en/univrm/api/univrm_use_firstperson/
|
|
50
|
+
* @see https://threejs.org/docs/#api/en/core/Layers
|
|
51
|
+
*/
|
|
52
|
+
get firstPersonOnlyLayer(): number;
|
|
53
|
+
/**
|
|
54
|
+
* A camera layer represents `ThirdPersonOnly` layer.
|
|
55
|
+
* Note that **you must call {@link setup} first before you use the layer feature** or it does not work properly.
|
|
56
|
+
*
|
|
57
|
+
* The value is {@link DEFAULT_THIRDPERSON_ONLY_LAYER} by default but you can change the layer by specifying via {@link setup} if you prefer.
|
|
58
|
+
*
|
|
59
|
+
* @see https://vrm.dev/en/univrm/api/univrm_use_firstperson/
|
|
60
|
+
* @see https://threejs.org/docs/#api/en/core/Layers
|
|
61
|
+
*/
|
|
62
|
+
get thirdPersonOnlyLayer(): number;
|
|
63
|
+
/**
|
|
64
|
+
* In this method, it assigns layers for every meshes based on mesh annotations.
|
|
65
|
+
* You must call this method first before you use the layer feature.
|
|
66
|
+
*
|
|
67
|
+
* This is an equivalent of [VRMFirstPerson.Setup](https://github.com/vrm-c/UniVRM/blob/73a5bd8fcddaa2a7a8735099a97e63c9db3e5ea0/Assets/VRM/Runtime/FirstPerson/VRMFirstPerson.cs#L295-L299) of the UniVRM.
|
|
68
|
+
*
|
|
69
|
+
* The `cameraLayer` parameter specifies which layer will be assigned for `FirstPersonOnly` / `ThirdPersonOnly`.
|
|
70
|
+
* In UniVRM, we specified those by naming each desired layer as `FIRSTPERSON_ONLY_LAYER` / `THIRDPERSON_ONLY_LAYER`
|
|
71
|
+
* but we are going to specify these layers at here since we are unable to name layers in Three.js.
|
|
72
|
+
*
|
|
73
|
+
* @param cameraLayer Specify which layer will be for `FirstPersonOnly` / `ThirdPersonOnly`.
|
|
74
|
+
*/
|
|
75
|
+
setup({ firstPersonOnlyLayer, thirdPersonOnlyLayer, }?: {
|
|
76
|
+
firstPersonOnlyLayer?: number | undefined;
|
|
77
|
+
thirdPersonOnlyLayer?: number | undefined;
|
|
78
|
+
}): void;
|
|
79
|
+
private _excludeTriangles;
|
|
80
|
+
private _createErasedMesh;
|
|
81
|
+
private _createHeadlessModelForSkinnedMesh;
|
|
82
|
+
private _createHeadlessModel;
|
|
83
|
+
private _isEraseTarget;
|
|
84
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
2
|
-
/**
|
|
3
|
-
* A plugin of GLTFLoader that imports a {@link VRMFirstPerson} from a VRM extension of a GLTF.
|
|
4
|
-
*/
|
|
5
|
-
export declare class VRMFirstPersonLoaderPlugin implements GLTFLoaderPlugin {
|
|
6
|
-
readonly parser: GLTFParser;
|
|
7
|
-
get name(): string;
|
|
8
|
-
constructor(parser: GLTFParser);
|
|
9
|
-
afterRoot(gltf: GLTF): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Import a {@link VRMFirstPerson} from a VRM.
|
|
12
|
-
*
|
|
13
|
-
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
14
|
-
* @param humanoid A {@link VRMHumanoid} instance that represents the VRM
|
|
15
|
-
*/
|
|
16
|
-
private _import;
|
|
17
|
-
private _v1Import;
|
|
18
|
-
private _v0Import;
|
|
19
|
-
private _convertV0FlagToV1Type;
|
|
20
|
-
}
|
|
1
|
+
import type { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
2
|
+
/**
|
|
3
|
+
* A plugin of GLTFLoader that imports a {@link VRMFirstPerson} from a VRM extension of a GLTF.
|
|
4
|
+
*/
|
|
5
|
+
export declare class VRMFirstPersonLoaderPlugin implements GLTFLoaderPlugin {
|
|
6
|
+
readonly parser: GLTFParser;
|
|
7
|
+
get name(): string;
|
|
8
|
+
constructor(parser: GLTFParser);
|
|
9
|
+
afterRoot(gltf: GLTF): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Import a {@link VRMFirstPerson} from a VRM.
|
|
12
|
+
*
|
|
13
|
+
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
14
|
+
* @param humanoid A {@link VRMHumanoid} instance that represents the VRM
|
|
15
|
+
*/
|
|
16
|
+
private _import;
|
|
17
|
+
private _v1Import;
|
|
18
|
+
private _v0Import;
|
|
19
|
+
private _convertV0FlagToV1Type;
|
|
20
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { VRMFirstPersonMeshAnnotationType } from './VRMFirstPersonMeshAnnotationType';
|
|
2
|
-
export interface VRMFirstPersonMeshAnnotation {
|
|
3
|
-
meshes: THREE.Mesh[];
|
|
4
|
-
type: VRMFirstPersonMeshAnnotationType;
|
|
5
|
-
}
|
|
1
|
+
import type { VRMFirstPersonMeshAnnotationType } from './VRMFirstPersonMeshAnnotationType';
|
|
2
|
+
export interface VRMFirstPersonMeshAnnotation {
|
|
3
|
+
meshes: THREE.Mesh[];
|
|
4
|
+
type: VRMFirstPersonMeshAnnotationType;
|
|
5
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const VRMFirstPersonMeshAnnotationType: {
|
|
2
|
-
readonly Auto: "auto";
|
|
3
|
-
readonly Both: "both";
|
|
4
|
-
readonly ThirdPersonOnly: "thirdPersonOnly";
|
|
5
|
-
readonly FirstPersonOnly: "firstPersonOnly";
|
|
6
|
-
};
|
|
7
|
-
export declare type VRMFirstPersonMeshAnnotationType = typeof VRMFirstPersonMeshAnnotationType[keyof typeof VRMFirstPersonMeshAnnotationType];
|
|
1
|
+
export declare const VRMFirstPersonMeshAnnotationType: {
|
|
2
|
+
readonly Auto: "auto";
|
|
3
|
+
readonly Both: "both";
|
|
4
|
+
readonly ThirdPersonOnly: "thirdPersonOnly";
|
|
5
|
+
readonly FirstPersonOnly: "firstPersonOnly";
|
|
6
|
+
};
|
|
7
|
+
export declare type VRMFirstPersonMeshAnnotationType = typeof VRMFirstPersonMeshAnnotationType[keyof typeof VRMFirstPersonMeshAnnotationType];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { VRMFirstPerson } from './VRMFirstPerson';
|
|
2
|
-
export { VRMFirstPersonLoaderPlugin } from './VRMFirstPersonLoaderPlugin';
|
|
3
|
-
export type { VRMFirstPersonMeshAnnotation } from './VRMFirstPersonMeshAnnotation';
|
|
4
|
-
export { VRMFirstPersonMeshAnnotationType } from './VRMFirstPersonMeshAnnotationType';
|
|
1
|
+
export { VRMFirstPerson } from './VRMFirstPerson';
|
|
2
|
+
export { VRMFirstPersonLoaderPlugin } from './VRMFirstPersonLoaderPlugin';
|
|
3
|
+
export type { VRMFirstPersonMeshAnnotation } from './VRMFirstPersonMeshAnnotation';
|
|
4
|
+
export { VRMFirstPersonMeshAnnotationType } from './VRMFirstPersonMeshAnnotationType';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type * as THREE from 'three';
|
|
2
|
-
/**
|
|
3
|
-
* An interface represents a single human bone of a VRM.
|
|
4
|
-
*/
|
|
5
|
-
export interface VRMHumanBone {
|
|
6
|
-
/**
|
|
7
|
-
* A glTF node (that actually is a `THREE.Object3D`) that represents the bone.
|
|
8
|
-
*/
|
|
9
|
-
node: THREE.Object3D;
|
|
10
|
-
}
|
|
1
|
+
import type * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* An interface represents a single human bone of a VRM.
|
|
4
|
+
*/
|
|
5
|
+
export interface VRMHumanBone {
|
|
6
|
+
/**
|
|
7
|
+
* A glTF node (that actually is a `THREE.Object3D`) that represents the bone.
|
|
8
|
+
*/
|
|
9
|
+
node: THREE.Object3D;
|
|
10
|
+
}
|
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The names of {@link VRMHumanoid} bone names.
|
|
3
|
+
*
|
|
4
|
+
* Ref: https://github.com/vrm-c/vrm-specification/blob/master/specification/VRMC_vrm-1.0/humanoid.md
|
|
5
|
+
*/
|
|
6
|
+
export declare const VRMHumanBoneName: {
|
|
7
|
+
readonly Hips: "hips";
|
|
8
|
+
readonly Spine: "spine";
|
|
9
|
+
readonly Chest: "chest";
|
|
10
|
+
readonly UpperChest: "upperChest";
|
|
11
|
+
readonly Neck: "neck";
|
|
12
|
+
readonly Head: "head";
|
|
13
|
+
readonly LeftEye: "leftEye";
|
|
14
|
+
readonly RightEye: "rightEye";
|
|
15
|
+
readonly Jaw: "jaw";
|
|
16
|
+
readonly LeftUpperLeg: "leftUpperLeg";
|
|
17
|
+
readonly LeftLowerLeg: "leftLowerLeg";
|
|
18
|
+
readonly LeftFoot: "leftFoot";
|
|
19
|
+
readonly LeftToes: "leftToes";
|
|
20
|
+
readonly RightUpperLeg: "rightUpperLeg";
|
|
21
|
+
readonly RightLowerLeg: "rightLowerLeg";
|
|
22
|
+
readonly RightFoot: "rightFoot";
|
|
23
|
+
readonly RightToes: "rightToes";
|
|
24
|
+
readonly LeftShoulder: "leftShoulder";
|
|
25
|
+
readonly LeftUpperArm: "leftUpperArm";
|
|
26
|
+
readonly LeftLowerArm: "leftLowerArm";
|
|
27
|
+
readonly LeftHand: "leftHand";
|
|
28
|
+
readonly RightShoulder: "rightShoulder";
|
|
29
|
+
readonly RightUpperArm: "rightUpperArm";
|
|
30
|
+
readonly RightLowerArm: "rightLowerArm";
|
|
31
|
+
readonly RightHand: "rightHand";
|
|
32
|
+
readonly LeftThumbMetacarpal: "leftThumbMetacarpal";
|
|
33
|
+
readonly LeftThumbProximal: "leftThumbProximal";
|
|
34
|
+
readonly LeftThumbDistal: "leftThumbDistal";
|
|
35
|
+
readonly LeftIndexProximal: "leftIndexProximal";
|
|
36
|
+
readonly LeftIndexIntermediate: "leftIndexIntermediate";
|
|
37
|
+
readonly LeftIndexDistal: "leftIndexDistal";
|
|
38
|
+
readonly LeftMiddleProximal: "leftMiddleProximal";
|
|
39
|
+
readonly LeftMiddleIntermediate: "leftMiddleIntermediate";
|
|
40
|
+
readonly LeftMiddleDistal: "leftMiddleDistal";
|
|
41
|
+
readonly LeftRingProximal: "leftRingProximal";
|
|
42
|
+
readonly LeftRingIntermediate: "leftRingIntermediate";
|
|
43
|
+
readonly LeftRingDistal: "leftRingDistal";
|
|
44
|
+
readonly LeftLittleProximal: "leftLittleProximal";
|
|
45
|
+
readonly LeftLittleIntermediate: "leftLittleIntermediate";
|
|
46
|
+
readonly LeftLittleDistal: "leftLittleDistal";
|
|
47
|
+
readonly RightThumbMetacarpal: "rightThumbMetacarpal";
|
|
48
|
+
readonly RightThumbProximal: "rightThumbProximal";
|
|
49
|
+
readonly RightThumbDistal: "rightThumbDistal";
|
|
50
|
+
readonly RightIndexProximal: "rightIndexProximal";
|
|
51
|
+
readonly RightIndexIntermediate: "rightIndexIntermediate";
|
|
52
|
+
readonly RightIndexDistal: "rightIndexDistal";
|
|
53
|
+
readonly RightMiddleProximal: "rightMiddleProximal";
|
|
54
|
+
readonly RightMiddleIntermediate: "rightMiddleIntermediate";
|
|
55
|
+
readonly RightMiddleDistal: "rightMiddleDistal";
|
|
56
|
+
readonly RightRingProximal: "rightRingProximal";
|
|
57
|
+
readonly RightRingIntermediate: "rightRingIntermediate";
|
|
58
|
+
readonly RightRingDistal: "rightRingDistal";
|
|
59
|
+
readonly RightLittleProximal: "rightLittleProximal";
|
|
60
|
+
readonly RightLittleIntermediate: "rightLittleIntermediate";
|
|
61
|
+
readonly RightLittleDistal: "rightLittleDistal";
|
|
62
|
+
};
|
|
63
|
+
export declare type VRMHumanBoneName = typeof VRMHumanBoneName[keyof typeof VRMHumanBoneName];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VRMHumanBoneName } from './VRMHumanBoneName';
|
|
2
|
+
/**
|
|
3
|
+
* An object that maps from {@link VRMHumanBoneName} to its parent {@link VRMHumanBoneName}.
|
|
4
|
+
*
|
|
5
|
+
* Ref: https://github.com/vrm-c/vrm-specification/blob/master/specification/VRMC_vrm-1.0/humanoid.md
|
|
6
|
+
*/
|
|
7
|
+
export declare const VRMHumanBoneParentMap: {
|
|
8
|
+
[bone in VRMHumanBoneName]: VRMHumanBoneName | null;
|
|
9
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { VRMHumanBone } from './VRMHumanBone';
|
|
2
|
-
import type { VRMHumanBoneName } from './VRMHumanBoneName';
|
|
3
|
-
import type { VRMRequiredHumanBoneName } from './VRMRequiredHumanBoneName';
|
|
4
|
-
/**
|
|
5
|
-
* A map from {@link VRMHumanBoneName} to {@link VRMHumanBone}.
|
|
6
|
-
*/
|
|
7
|
-
export declare type VRMHumanBones = {
|
|
8
|
-
[name in VRMHumanBoneName]?: VRMHumanBone;
|
|
9
|
-
} & {
|
|
10
|
-
[name in VRMRequiredHumanBoneName]: VRMHumanBone;
|
|
11
|
-
};
|
|
1
|
+
import type { VRMHumanBone } from './VRMHumanBone';
|
|
2
|
+
import type { VRMHumanBoneName } from './VRMHumanBoneName';
|
|
3
|
+
import type { VRMRequiredHumanBoneName } from './VRMRequiredHumanBoneName';
|
|
4
|
+
/**
|
|
5
|
+
* A map from {@link VRMHumanBoneName} to {@link VRMHumanBone}.
|
|
6
|
+
*/
|
|
7
|
+
export declare type VRMHumanBones = {
|
|
8
|
+
[name in VRMHumanBoneName]?: VRMHumanBone;
|
|
9
|
+
} & {
|
|
10
|
+
[name in VRMRequiredHumanBoneName]: VRMHumanBone;
|
|
11
|
+
};
|