@pixiv/three-vrm-core 1.0.0-beta.8 → 1.0.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.
- package/lib/three-vrm-core.js +976 -159
- package/lib/three-vrm-core.min.js +2 -2
- package/lib/three-vrm-core.module.js +974 -160
- 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/VRMCoreLoaderPlugin.d.ts +1 -1
- 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/VRMExpressionLoaderPlugin.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/firstPerson/VRMFirstPersonLoaderPlugin.d.ts +1 -1
- 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 +10 -2
- 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 +50 -7
- 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/VRMLookAtLoaderPlugin.d.ts +1 -1
- 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 +2 -2
- 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/gltfExtractPrimitivesFromNode.d.ts +1 -1
- package/ts3.4/types/utils/gltfGetAssociatedMaterialIndex.d.ts +1 -1
- package/ts3.4/types/utils/renameMaterialProperty.d.ts +1 -0
- package/types/VRMCore.d.ts +7 -7
- package/types/VRMCoreLoaderPlugin.d.ts +1 -1
- package/types/VRMCoreLoaderPluginOptions.d.ts +1 -0
- package/types/VRMCoreParameters.d.ts +2 -2
- package/types/expressions/VRMExpression.d.ts +1 -1
- package/types/expressions/VRMExpressionLoaderPlugin.d.ts +1 -1
- package/types/expressions/VRMExpressionMaterialColorBind.d.ts +3 -0
- package/types/expressions/VRMExpressionMaterialColorType.d.ts +4 -0
- package/types/firstPerson/VRMFirstPersonLoaderPlugin.d.ts +1 -1
- package/types/humanoid/VRMHumanBoneList.d.ts +5 -0
- package/types/humanoid/VRMHumanBoneName.d.ts +7 -2
- package/types/humanoid/VRMHumanBoneParentMap.d.ts +9 -0
- package/types/humanoid/VRMHumanoid.d.ts +130 -21
- package/types/humanoid/VRMHumanoidLoaderPlugin.d.ts +10 -2
- package/types/humanoid/VRMHumanoidLoaderPluginOptions.d.ts +15 -0
- package/types/humanoid/VRMHumanoidRig.d.ts +31 -0
- 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 +4 -0
- package/types/lookAt/VRMLookAt.d.ts +52 -7
- package/types/lookAt/VRMLookAtApplier.d.ts +8 -2
- package/types/lookAt/VRMLookAtBoneApplier.d.ts +35 -2
- package/types/lookAt/VRMLookAtExpressionApplier.d.ts +7 -2
- package/types/lookAt/VRMLookAtLoaderPlugin.d.ts +1 -1
- 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/VRMMetaLoaderPlugin.d.ts +2 -2
- package/types/meta/VRMMetaLoaderPluginOptions.d.ts +1 -1
- package/types/tests/matchers/toBeCloseToQuaternion.d.ts +10 -0
- package/types/tests/matchers/toBeCloseToVector3.d.ts +10 -0
- package/types/utils/gltfExtractPrimitivesFromNode.d.ts +1 -1
- package/types/utils/gltfGetAssociatedMaterialIndex.d.ts +1 -1
- package/types/utils/renameMaterialProperty.d.ts +1 -0
|
@@ -31,6 +31,28 @@ export declare class VRMLookAtBoneApplier implements VRMLookAtApplier {
|
|
|
31
31
|
* A {@link VRMLookAtRangeMap} for vertical upward movement. Both eyes move downwards.
|
|
32
32
|
*/
|
|
33
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;
|
|
34
56
|
/**
|
|
35
57
|
* Create a new {@link VRMLookAtBoneApplier}.
|
|
36
58
|
*
|
|
@@ -44,7 +66,18 @@ export declare class VRMLookAtBoneApplier implements VRMLookAtApplier {
|
|
|
44
66
|
/**
|
|
45
67
|
* Apply the input angle to its associated VRM model.
|
|
46
68
|
*
|
|
47
|
-
* @param
|
|
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`
|
|
48
81
|
*/
|
|
49
|
-
|
|
82
|
+
private _getWorldFaceFrontQuat;
|
|
50
83
|
}
|
|
@@ -45,7 +45,12 @@ export declare class VRMLookAtExpressionApplier implements VRMLookAtApplier {
|
|
|
45
45
|
/**
|
|
46
46
|
* Apply the input angle to its associated VRM model.
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param yaw Rotation around Y axis, in degree
|
|
49
|
+
* @param pitch Rotation around X axis, in degree
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
applyYawPitch(yaw: number, pitch: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use {@link applyYawPitch} instead.
|
|
54
|
+
*/
|
|
55
|
+
lookAt(euler: THREE.Euler): void;
|
|
51
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
1
|
+
import type { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
2
2
|
import type { VRMLookAtLoaderPluginOptions } from './VRMLookAtLoaderPluginOptions';
|
|
3
3
|
/**
|
|
4
4
|
* A plugin of GLTFLoader that imports a {@link VRMLookAt} from a VRM extension of a GLTF.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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): [azimuth: number, altitude: number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
1
|
+
import type { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
2
2
|
import type { VRMMetaLoaderPluginOptions } from './VRMMetaLoaderPluginOptions';
|
|
3
3
|
/**
|
|
4
4
|
* A plugin of GLTFLoader that imports a {@link VRM1Meta} from a VRM extension of a GLTF.
|
|
@@ -17,7 +17,7 @@ export declare class VRMMetaLoaderPlugin implements GLTFLoaderPlugin {
|
|
|
17
17
|
*/
|
|
18
18
|
acceptLicenseUrls: string[];
|
|
19
19
|
/**
|
|
20
|
-
* Whether it should accept VRM0.
|
|
20
|
+
* Whether it should accept VRM0.0 meta or not.
|
|
21
21
|
* Note that it might load {@link VRM0Meta} instead of {@link VRM1Meta} when this is `true`.
|
|
22
22
|
* `true` by default.
|
|
23
23
|
*/
|
|
@@ -14,7 +14,7 @@ export interface VRMMetaLoaderPluginOptions {
|
|
|
14
14
|
*/
|
|
15
15
|
acceptLicenseUrls?: string[];
|
|
16
16
|
/**
|
|
17
|
-
* Whether it should accept VRM0.
|
|
17
|
+
* Whether it should accept VRM0.0 meta or not.
|
|
18
18
|
* Note that it might load {@link VRM0Meta} instead of {@link VRM1Meta} when this is `true`.
|
|
19
19
|
* `true` by default.
|
|
20
20
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export declare function toBeCloseToQuaternion(received: THREE.Quaternion, expected: THREE.Quaternion, precision?: number): jest.CustomMatcherResult;
|
|
4
|
+
declare global {
|
|
5
|
+
namespace jest {
|
|
6
|
+
interface Matchers<R> {
|
|
7
|
+
toBeCloseToQuaternion(expected: THREE.Quaternion, precision?: number): R;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export declare function toBeCloseToVector3(received: THREE.Vector3, expected: THREE.Vector3, precision?: number): jest.CustomMatcherResult;
|
|
4
|
+
declare global {
|
|
5
|
+
namespace jest {
|
|
6
|
+
interface Matchers<R> {
|
|
7
|
+
toBeCloseToVector3(expected: THREE.Vector3, precision?: number): R;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
1
|
+
import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
2
2
|
/**
|
|
3
3
|
* Extract primitives ( `THREE.Mesh[]` ) of a node from a loaded GLTF.
|
|
4
4
|
* The main purpose of this function is to distinguish primitives and children from a node that has both meshes and children.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
+
import { GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
3
3
|
/**
|
|
4
4
|
* Get a material definition index of glTF from associated material.
|
|
5
5
|
* It's basically a comat code between Three.js r133 or above and previous versions.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renameMaterialProperty(name: string): string;
|