@pixiv/three-vrm 0.6.4 → 0.6.8
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/README.md +2 -2
- package/lib/three-vrm.js +3664 -3472
- package/lib/three-vrm.min.js +2 -2
- package/lib/three-vrm.module.js +3644 -3483
- package/lib/three-vrm.module.min.js +2 -2
- package/package.json +6 -9
- package/ts3.4/types/VRMUtils/index.d.ts +2 -0
- package/ts3.4/types/VRMUtils/removeUnnecessaryVertices.d.ts +12 -0
- package/ts3.4/types/material/getTexelDecodingFunction.d.ts +6 -0
- package/types/VRM.d.ts +110 -110
- package/types/VRMImporter.d.ts +42 -42
- package/types/VRMUtils/extractThumbnailBlob.d.ts +10 -10
- package/types/VRMUtils/index.d.ts +9 -7
- package/types/VRMUtils/removeUnnecessaryJoints.d.ts +9 -9
- package/types/VRMUtils/removeUnnecessaryVertices.d.ts +12 -0
- package/types/blendshape/VRMBlendShapeGroup.d.ts +50 -50
- package/types/blendshape/VRMBlendShapeImporter.d.ts +13 -13
- package/types/blendshape/VRMBlendShapeProxy.d.ts +91 -91
- package/types/blendshape/index.d.ts +3 -3
- package/types/debug/VRMDebug.d.ts +28 -28
- package/types/debug/VRMDebugOptions.d.ts +10 -10
- package/types/debug/VRMImporterDebug.d.ts +11 -11
- package/types/debug/VRMLookAtHeadDebug.d.ts +8 -8
- package/types/debug/VRMLookAtImporterDebug.d.ts +9 -9
- package/types/debug/VRMSpringBoneDebug.d.ts +14 -14
- package/types/debug/VRMSpringBoneImporterDebug.d.ts +10 -10
- package/types/debug/VRMSpringBoneManagerDebug.d.ts +11 -11
- package/types/debug/index.d.ts +4 -4
- package/types/firstperson/VRMFirstPerson.d.ts +116 -116
- package/types/firstperson/VRMFirstPersonImporter.d.ts +15 -15
- package/types/firstperson/index.d.ts +2 -2
- package/types/humanoid/VRMHumanBone.d.ts +22 -22
- package/types/humanoid/VRMHumanBoneArray.d.ts +9 -9
- package/types/humanoid/VRMHumanBones.d.ts +8 -8
- package/types/humanoid/VRMHumanDescription.d.ts +14 -14
- package/types/humanoid/VRMHumanLimit.d.ts +12 -12
- package/types/humanoid/VRMHumanoid.d.ts +87 -87
- package/types/humanoid/VRMHumanoidImporter.d.ts +13 -13
- package/types/humanoid/index.d.ts +6 -6
- package/types/index.d.ts +12 -12
- package/types/lookat/VRMCurveMapper.d.ts +36 -36
- package/types/lookat/VRMLookAtApplyer.d.ts +18 -18
- package/types/lookat/VRMLookAtBlendShapeApplyer.d.ts +26 -26
- package/types/lookat/VRMLookAtBoneApplyer.d.ts +28 -28
- package/types/lookat/VRMLookAtHead.d.ts +57 -57
- package/types/lookat/VRMLookAtImporter.d.ts +23 -23
- package/types/lookat/index.d.ts +6 -6
- package/types/material/MToonMaterial.d.ts +206 -206
- package/types/material/VRMMaterialImporter.d.ts +50 -50
- package/types/material/VRMUnlitMaterial.d.ts +46 -46
- package/types/material/getTexelDecodingFunction.d.ts +9 -3
- package/types/material/index.d.ts +3 -3
- package/types/meta/VRMMeta.d.ts +59 -59
- package/types/meta/VRMMetaImporter.d.ts +14 -14
- package/types/meta/VRMMetaImporterOptions.d.ts +9 -9
- package/types/meta/index.d.ts +3 -3
- package/types/springbone/VRMSpringBone.d.ts +130 -130
- package/types/springbone/VRMSpringBoneColliderGroup.d.ts +15 -15
- package/types/springbone/VRMSpringBoneImporter.d.ts +34 -34
- package/types/springbone/VRMSpringBoneManager.d.ts +35 -35
- package/types/springbone/VRMSpringBoneParameters.d.ts +9 -9
- package/types/springbone/index.d.ts +5 -5
- package/types/types/GLTFSchema.d.ts +887 -887
- package/types/types/VRMSchema.d.ts +440 -440
- package/types/types/index.d.ts +3 -3
- package/types/types/types.d.ts +64 -64
- package/types/utils/Matrix4InverseCache.d.ts +28 -28
- package/types/utils/disposer.d.ts +2 -2
- package/types/utils/gltfExtractPrimitivesFromNode.d.ts +22 -22
- package/types/utils/mat4InvertCompat.d.ts +8 -8
- package/types/utils/math.d.ts +40 -40
- package/types/utils/quatInvertCompat.d.ts +8 -8
- package/types/utils/renameMaterialProperty.d.ts +1 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
3
|
-
import { VRMSchema } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Options for a [[VRMMaterialImporter]] instance.
|
|
6
|
-
*/
|
|
7
|
-
export interface VRMMaterialImporterOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Specify the encoding of input uniform colors and textures.
|
|
10
|
-
*
|
|
11
|
-
* When your `renderer.outputEncoding` is `THREE.LinearEncoding`, use `THREE.LinearEncoding`.
|
|
12
|
-
* When your `renderer.outputEncoding` is `THREE.sRGBEncoding`, use `THREE.sRGBEncoding`.
|
|
13
|
-
*
|
|
14
|
-
* The importer will use `THREE.LinearEncoding` if this option isn't specified.
|
|
15
|
-
*
|
|
16
|
-
* See also: https://threejs.org/docs/#api/en/renderers/WebGLRenderer.outputEncoding
|
|
17
|
-
*/
|
|
18
|
-
encoding?: THREE.TextureEncoding;
|
|
19
|
-
/**
|
|
20
|
-
* A function that returns a `Promise` of environment map texture.
|
|
21
|
-
* The importer will attempt to call this function when it have to use an envmap.
|
|
22
|
-
*/
|
|
23
|
-
requestEnvMap?: () => Promise<THREE.Texture | null>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* An importer that imports VRM materials from a VRM extension of a GLTF.
|
|
27
|
-
*/
|
|
28
|
-
export declare class VRMMaterialImporter {
|
|
29
|
-
private readonly _encoding;
|
|
30
|
-
private readonly _requestEnvMap?;
|
|
31
|
-
/**
|
|
32
|
-
* Create a new VRMMaterialImporter.
|
|
33
|
-
*
|
|
34
|
-
* @param options Options of the VRMMaterialImporter
|
|
35
|
-
*/
|
|
36
|
-
constructor(options?: VRMMaterialImporterOptions);
|
|
37
|
-
/**
|
|
38
|
-
* Convert all the materials of given GLTF based on VRM extension field `materialProperties`.
|
|
39
|
-
*
|
|
40
|
-
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
41
|
-
*/
|
|
42
|
-
convertGLTFMaterials(gltf: GLTF): Promise<THREE.Material[] | null>;
|
|
43
|
-
createVRMMaterials(originalMaterial: THREE.Material, vrmProps: VRMSchema.Material, gltf: GLTF): Promise<{
|
|
44
|
-
surface: THREE.Material;
|
|
45
|
-
outline?: THREE.Material;
|
|
46
|
-
}>;
|
|
47
|
-
private _renameMaterialProperty;
|
|
48
|
-
private _convertGLTFMaterial;
|
|
49
|
-
private _extractMaterialProperties;
|
|
50
|
-
}
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
3
|
+
import { VRMSchema } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Options for a [[VRMMaterialImporter]] instance.
|
|
6
|
+
*/
|
|
7
|
+
export interface VRMMaterialImporterOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Specify the encoding of input uniform colors and textures.
|
|
10
|
+
*
|
|
11
|
+
* When your `renderer.outputEncoding` is `THREE.LinearEncoding`, use `THREE.LinearEncoding`.
|
|
12
|
+
* When your `renderer.outputEncoding` is `THREE.sRGBEncoding`, use `THREE.sRGBEncoding`.
|
|
13
|
+
*
|
|
14
|
+
* The importer will use `THREE.LinearEncoding` if this option isn't specified.
|
|
15
|
+
*
|
|
16
|
+
* See also: https://threejs.org/docs/#api/en/renderers/WebGLRenderer.outputEncoding
|
|
17
|
+
*/
|
|
18
|
+
encoding?: THREE.TextureEncoding;
|
|
19
|
+
/**
|
|
20
|
+
* A function that returns a `Promise` of environment map texture.
|
|
21
|
+
* The importer will attempt to call this function when it have to use an envmap.
|
|
22
|
+
*/
|
|
23
|
+
requestEnvMap?: () => Promise<THREE.Texture | null>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* An importer that imports VRM materials from a VRM extension of a GLTF.
|
|
27
|
+
*/
|
|
28
|
+
export declare class VRMMaterialImporter {
|
|
29
|
+
private readonly _encoding;
|
|
30
|
+
private readonly _requestEnvMap?;
|
|
31
|
+
/**
|
|
32
|
+
* Create a new VRMMaterialImporter.
|
|
33
|
+
*
|
|
34
|
+
* @param options Options of the VRMMaterialImporter
|
|
35
|
+
*/
|
|
36
|
+
constructor(options?: VRMMaterialImporterOptions);
|
|
37
|
+
/**
|
|
38
|
+
* Convert all the materials of given GLTF based on VRM extension field `materialProperties`.
|
|
39
|
+
*
|
|
40
|
+
* @param gltf A parsed result of GLTF taken from GLTFLoader
|
|
41
|
+
*/
|
|
42
|
+
convertGLTFMaterials(gltf: GLTF): Promise<THREE.Material[] | null>;
|
|
43
|
+
createVRMMaterials(originalMaterial: THREE.Material, vrmProps: VRMSchema.Material, gltf: GLTF): Promise<{
|
|
44
|
+
surface: THREE.Material;
|
|
45
|
+
outline?: THREE.Material;
|
|
46
|
+
}>;
|
|
47
|
+
private _renameMaterialProperty;
|
|
48
|
+
private _convertGLTFMaterial;
|
|
49
|
+
private _extractMaterialProperties;
|
|
50
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
export interface VRMUnlitMaterialParameters extends THREE.ShaderMaterialParameters {
|
|
3
|
-
cutoff?: number;
|
|
4
|
-
map?: THREE.Texture;
|
|
5
|
-
mainTex?: THREE.Texture;
|
|
6
|
-
mainTex_ST?: THREE.Vector4;
|
|
7
|
-
renderType?: VRMUnlitMaterialRenderType | number;
|
|
8
|
-
}
|
|
9
|
-
export declare enum VRMUnlitMaterialRenderType {
|
|
10
|
-
Opaque = 0,
|
|
11
|
-
Cutout = 1,
|
|
12
|
-
Transparent = 2,
|
|
13
|
-
TransparentWithZWrite = 3
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* This is a material that is an equivalent of "VRM/Unlit***" on VRM spec, those materials are already kinda deprecated though...
|
|
17
|
-
*/
|
|
18
|
-
export declare class VRMUnlitMaterial extends THREE.ShaderMaterial {
|
|
19
|
-
/**
|
|
20
|
-
* Readonly boolean that indicates this is a [[VRMUnlitMaterial]].
|
|
21
|
-
*/
|
|
22
|
-
readonly isVRMUnlitMaterial: boolean;
|
|
23
|
-
cutoff: number;
|
|
24
|
-
map: THREE.Texture | null;
|
|
25
|
-
mainTex_ST: THREE.Vector4;
|
|
26
|
-
private _renderType;
|
|
27
|
-
shouldApplyUniforms: boolean;
|
|
28
|
-
constructor(parameters?: VRMUnlitMaterialParameters);
|
|
29
|
-
get mainTex(): THREE.Texture | null;
|
|
30
|
-
set mainTex(t: THREE.Texture | null);
|
|
31
|
-
get renderType(): VRMUnlitMaterialRenderType;
|
|
32
|
-
set renderType(t: VRMUnlitMaterialRenderType);
|
|
33
|
-
/**
|
|
34
|
-
* Update this material.
|
|
35
|
-
* Usually this will be called via [[VRM.update]] so you don't have to call this manually.
|
|
36
|
-
*
|
|
37
|
-
* @param delta deltaTime since last update
|
|
38
|
-
*/
|
|
39
|
-
updateVRMMaterials(delta: number): void;
|
|
40
|
-
copy(source: this): this;
|
|
41
|
-
/**
|
|
42
|
-
* Apply updated uniform variables.
|
|
43
|
-
*/
|
|
44
|
-
private _applyUniforms;
|
|
45
|
-
private _updateShaderCode;
|
|
46
|
-
}
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export interface VRMUnlitMaterialParameters extends THREE.ShaderMaterialParameters {
|
|
3
|
+
cutoff?: number;
|
|
4
|
+
map?: THREE.Texture;
|
|
5
|
+
mainTex?: THREE.Texture;
|
|
6
|
+
mainTex_ST?: THREE.Vector4;
|
|
7
|
+
renderType?: VRMUnlitMaterialRenderType | number;
|
|
8
|
+
}
|
|
9
|
+
export declare enum VRMUnlitMaterialRenderType {
|
|
10
|
+
Opaque = 0,
|
|
11
|
+
Cutout = 1,
|
|
12
|
+
Transparent = 2,
|
|
13
|
+
TransparentWithZWrite = 3
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* This is a material that is an equivalent of "VRM/Unlit***" on VRM spec, those materials are already kinda deprecated though...
|
|
17
|
+
*/
|
|
18
|
+
export declare class VRMUnlitMaterial extends THREE.ShaderMaterial {
|
|
19
|
+
/**
|
|
20
|
+
* Readonly boolean that indicates this is a [[VRMUnlitMaterial]].
|
|
21
|
+
*/
|
|
22
|
+
readonly isVRMUnlitMaterial: boolean;
|
|
23
|
+
cutoff: number;
|
|
24
|
+
map: THREE.Texture | null;
|
|
25
|
+
mainTex_ST: THREE.Vector4;
|
|
26
|
+
private _renderType;
|
|
27
|
+
shouldApplyUniforms: boolean;
|
|
28
|
+
constructor(parameters?: VRMUnlitMaterialParameters);
|
|
29
|
+
get mainTex(): THREE.Texture | null;
|
|
30
|
+
set mainTex(t: THREE.Texture | null);
|
|
31
|
+
get renderType(): VRMUnlitMaterialRenderType;
|
|
32
|
+
set renderType(t: VRMUnlitMaterialRenderType);
|
|
33
|
+
/**
|
|
34
|
+
* Update this material.
|
|
35
|
+
* Usually this will be called via [[VRM.update]] so you don't have to call this manually.
|
|
36
|
+
*
|
|
37
|
+
* @param delta deltaTime since last update
|
|
38
|
+
*/
|
|
39
|
+
updateVRMMaterials(delta: number): void;
|
|
40
|
+
copy(source: this): this;
|
|
41
|
+
/**
|
|
42
|
+
* Apply updated uniform variables.
|
|
43
|
+
*/
|
|
44
|
+
private _applyUniforms;
|
|
45
|
+
private _updateShaderCode;
|
|
46
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Ref: https://github.com/mrdoob/three.js/blob/r136/src/renderers/webgl/WebGLProgram.js#L22
|
|
4
|
+
*/
|
|
5
|
+
export declare const getEncodingComponents: (encoding: THREE.TextureEncoding) => [string, string];
|
|
6
|
+
/**
|
|
7
|
+
* https://github.com/mrdoob/three.js/blob/r136/src/renderers/webgl/WebGLProgram.js#L52
|
|
8
|
+
*/
|
|
9
|
+
export declare const getTexelDecodingFunction: (functionName: string, encoding: THREE.TextureEncoding) => string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './MToonMaterial';
|
|
2
|
-
export * from './VRMMaterialImporter';
|
|
3
|
-
export * from './VRMUnlitMaterial';
|
|
1
|
+
export * from './MToonMaterial';
|
|
2
|
+
export * from './VRMMaterialImporter';
|
|
3
|
+
export * from './VRMUnlitMaterial';
|
package/types/meta/VRMMeta.d.ts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { VRMSchema } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Interface represents metadata of a VRM.
|
|
5
|
-
*/
|
|
6
|
-
export interface VRMMeta {
|
|
7
|
-
/**
|
|
8
|
-
* Enum indicates a condition who can perform with this avatar.
|
|
9
|
-
*/
|
|
10
|
-
allowedUserName?: VRMSchema.MetaAllowedUserName;
|
|
11
|
-
/**
|
|
12
|
-
* Author of the model.
|
|
13
|
-
*/
|
|
14
|
-
author?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Enum indicates allow or disallow commercial use.
|
|
17
|
-
*/
|
|
18
|
-
commercialUssageName?: VRMSchema.MetaUssageName;
|
|
19
|
-
/**
|
|
20
|
-
* Contact Information of its author.
|
|
21
|
-
*/
|
|
22
|
-
contactInformation?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Enum indicates a license type.
|
|
25
|
-
*/
|
|
26
|
-
licenseName?: VRMSchema.MetaLicenseName;
|
|
27
|
-
/**
|
|
28
|
-
* If `Other` is selected for {@link licenseName}, put the URL link of the license document here.
|
|
29
|
-
*/
|
|
30
|
-
otherLicenseUrl?: string;
|
|
31
|
-
/**
|
|
32
|
-
* If there are any conditions not mentioned in {@link licenseName} or {@link otherLicenseUrl}, put the URL link of the license document here.
|
|
33
|
-
*/
|
|
34
|
-
otherPermissionUrl?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Reference of the model.
|
|
37
|
-
*/
|
|
38
|
-
reference?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Enum indicates allow or disallow sexual expressions.
|
|
41
|
-
*/
|
|
42
|
-
sexualUssageName?: VRMSchema.MetaUssageName;
|
|
43
|
-
/**
|
|
44
|
-
* Thumbnail of the model.
|
|
45
|
-
*/
|
|
46
|
-
texture?: THREE.Texture;
|
|
47
|
-
/**
|
|
48
|
-
* Title of the model.
|
|
49
|
-
*/
|
|
50
|
-
title?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Version of the model.
|
|
53
|
-
*/
|
|
54
|
-
version?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Enum indicates allow or disallow violent expressions.
|
|
57
|
-
*/
|
|
58
|
-
violentUssageName?: VRMSchema.MetaUssageName;
|
|
59
|
-
}
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { VRMSchema } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Interface represents metadata of a VRM.
|
|
5
|
+
*/
|
|
6
|
+
export interface VRMMeta {
|
|
7
|
+
/**
|
|
8
|
+
* Enum indicates a condition who can perform with this avatar.
|
|
9
|
+
*/
|
|
10
|
+
allowedUserName?: VRMSchema.MetaAllowedUserName;
|
|
11
|
+
/**
|
|
12
|
+
* Author of the model.
|
|
13
|
+
*/
|
|
14
|
+
author?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Enum indicates allow or disallow commercial use.
|
|
17
|
+
*/
|
|
18
|
+
commercialUssageName?: VRMSchema.MetaUssageName;
|
|
19
|
+
/**
|
|
20
|
+
* Contact Information of its author.
|
|
21
|
+
*/
|
|
22
|
+
contactInformation?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Enum indicates a license type.
|
|
25
|
+
*/
|
|
26
|
+
licenseName?: VRMSchema.MetaLicenseName;
|
|
27
|
+
/**
|
|
28
|
+
* If `Other` is selected for {@link licenseName}, put the URL link of the license document here.
|
|
29
|
+
*/
|
|
30
|
+
otherLicenseUrl?: string;
|
|
31
|
+
/**
|
|
32
|
+
* If there are any conditions not mentioned in {@link licenseName} or {@link otherLicenseUrl}, put the URL link of the license document here.
|
|
33
|
+
*/
|
|
34
|
+
otherPermissionUrl?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Reference of the model.
|
|
37
|
+
*/
|
|
38
|
+
reference?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Enum indicates allow or disallow sexual expressions.
|
|
41
|
+
*/
|
|
42
|
+
sexualUssageName?: VRMSchema.MetaUssageName;
|
|
43
|
+
/**
|
|
44
|
+
* Thumbnail of the model.
|
|
45
|
+
*/
|
|
46
|
+
texture?: THREE.Texture;
|
|
47
|
+
/**
|
|
48
|
+
* Title of the model.
|
|
49
|
+
*/
|
|
50
|
+
title?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Version of the model.
|
|
53
|
+
*/
|
|
54
|
+
version?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Enum indicates allow or disallow violent expressions.
|
|
57
|
+
*/
|
|
58
|
+
violentUssageName?: VRMSchema.MetaUssageName;
|
|
59
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
-
import { VRMMeta } from './VRMMeta';
|
|
3
|
-
import { VRMMetaImporterOptions } from './VRMMetaImporterOptions';
|
|
4
|
-
/**
|
|
5
|
-
* An importer that imports a {@link VRMMeta} from a VRM extension of a GLTF.
|
|
6
|
-
*/
|
|
7
|
-
export declare class VRMMetaImporter {
|
|
8
|
-
/**
|
|
9
|
-
* If `true`, it won't load its thumbnail texture ({@link VRMMeta.texture}). `false` by default.
|
|
10
|
-
*/
|
|
11
|
-
ignoreTexture: boolean;
|
|
12
|
-
constructor(options?: VRMMetaImporterOptions);
|
|
13
|
-
import(gltf: GLTF): Promise<VRMMeta | null>;
|
|
14
|
-
}
|
|
1
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
2
|
+
import { VRMMeta } from './VRMMeta';
|
|
3
|
+
import { VRMMetaImporterOptions } from './VRMMetaImporterOptions';
|
|
4
|
+
/**
|
|
5
|
+
* An importer that imports a {@link VRMMeta} from a VRM extension of a GLTF.
|
|
6
|
+
*/
|
|
7
|
+
export declare class VRMMetaImporter {
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, it won't load its thumbnail texture ({@link VRMMeta.texture}). `false` by default.
|
|
10
|
+
*/
|
|
11
|
+
ignoreTexture: boolean;
|
|
12
|
+
constructor(options?: VRMMetaImporterOptions);
|
|
13
|
+
import(gltf: GLTF): Promise<VRMMeta | null>;
|
|
14
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options for a {@link VRMMetaImporter} instance.
|
|
3
|
-
*/
|
|
4
|
-
export interface VRMMetaImporterOptions {
|
|
5
|
-
/**
|
|
6
|
-
* If `true`, it won't load its thumbnail texture ({@link VRMMeta.texture}). `false` by default.
|
|
7
|
-
*/
|
|
8
|
-
ignoreTexture?: boolean;
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Options for a {@link VRMMetaImporter} instance.
|
|
3
|
+
*/
|
|
4
|
+
export interface VRMMetaImporterOptions {
|
|
5
|
+
/**
|
|
6
|
+
* If `true`, it won't load its thumbnail texture ({@link VRMMeta.texture}). `false` by default.
|
|
7
|
+
*/
|
|
8
|
+
ignoreTexture?: boolean;
|
|
9
|
+
}
|
package/types/meta/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { VRMMeta } from './VRMMeta';
|
|
2
|
-
export { VRMMetaImporter } from './VRMMetaImporter';
|
|
3
|
-
export { VRMMetaImporterOptions } from './VRMMetaImporterOptions';
|
|
1
|
+
export { VRMMeta } from './VRMMeta';
|
|
2
|
+
export { VRMMetaImporter } from './VRMMetaImporter';
|
|
3
|
+
export { VRMMetaImporterOptions } from './VRMMetaImporterOptions';
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { VRMSpringBoneColliderMesh } from './VRMSpringBoneColliderGroup';
|
|
3
|
-
import { VRMSpringBoneParameters } from './VRMSpringBoneParameters';
|
|
4
|
-
/**
|
|
5
|
-
* A class represents a single spring bone of a VRM.
|
|
6
|
-
* It should be managed by a [[VRMSpringBoneManager]].
|
|
7
|
-
*/
|
|
8
|
-
export declare class VRMSpringBone {
|
|
9
|
-
/**
|
|
10
|
-
* Radius of the bone, will be used for collision.
|
|
11
|
-
*/
|
|
12
|
-
radius: number;
|
|
13
|
-
/**
|
|
14
|
-
* Stiffness force of the bone. Increasing the value = faster convergence (feels "harder").
|
|
15
|
-
* On UniVRM, its range on GUI is between `0.0` and `4.0` .
|
|
16
|
-
*/
|
|
17
|
-
stiffnessForce: number;
|
|
18
|
-
/**
|
|
19
|
-
* Power of the gravity against this bone.
|
|
20
|
-
* The "power" used in here is very far from scientific physics term...
|
|
21
|
-
*/
|
|
22
|
-
gravityPower: number;
|
|
23
|
-
/**
|
|
24
|
-
* Direction of the gravity against this bone.
|
|
25
|
-
* Usually it should be normalized.
|
|
26
|
-
*/
|
|
27
|
-
gravityDir: THREE.Vector3;
|
|
28
|
-
/**
|
|
29
|
-
* Drag force of the bone. Increasing the value = less oscillation (feels "heavier").
|
|
30
|
-
* On UniVRM, its range on GUI is between `0.0` and `1.0` .
|
|
31
|
-
*/
|
|
32
|
-
dragForce: number;
|
|
33
|
-
/**
|
|
34
|
-
* Collider groups attached to this bone.
|
|
35
|
-
*/
|
|
36
|
-
colliders: VRMSpringBoneColliderMesh[];
|
|
37
|
-
/**
|
|
38
|
-
* An Object3D attached to this bone.
|
|
39
|
-
*/
|
|
40
|
-
readonly bone: THREE.Object3D;
|
|
41
|
-
/**
|
|
42
|
-
* Current position of child tail, in world unit. Will be used for verlet integration.
|
|
43
|
-
*/
|
|
44
|
-
protected _currentTail: THREE.Vector3;
|
|
45
|
-
/**
|
|
46
|
-
* Previous position of child tail, in world unit. Will be used for verlet integration.
|
|
47
|
-
*/
|
|
48
|
-
protected _prevTail: THREE.Vector3;
|
|
49
|
-
/**
|
|
50
|
-
* Next position of child tail, in world unit. Will be used for verlet integration.
|
|
51
|
-
* Actually used only in [[update]] and it's kind of temporary variable.
|
|
52
|
-
*/
|
|
53
|
-
protected _nextTail: THREE.Vector3;
|
|
54
|
-
/**
|
|
55
|
-
* Initial axis of the bone, in local unit.
|
|
56
|
-
*/
|
|
57
|
-
protected _boneAxis: THREE.Vector3;
|
|
58
|
-
/**
|
|
59
|
-
* Length of the bone in relative space unit. Will be used for normalization in update loop.
|
|
60
|
-
* It's same as local unit length unless there are scale transformation in world matrix.
|
|
61
|
-
*/
|
|
62
|
-
protected _centerSpaceBoneLength: number;
|
|
63
|
-
/**
|
|
64
|
-
* Position of this bone in relative space, kind of a temporary variable.
|
|
65
|
-
*/
|
|
66
|
-
protected _centerSpacePosition: THREE.Vector3;
|
|
67
|
-
/**
|
|
68
|
-
* This springbone will be calculated based on the space relative from this object.
|
|
69
|
-
* If this is `null`, springbone will be calculated in world space.
|
|
70
|
-
*/
|
|
71
|
-
protected _center: THREE.Object3D | null;
|
|
72
|
-
get center(): THREE.Object3D | null;
|
|
73
|
-
set center(center: THREE.Object3D | null);
|
|
74
|
-
/**
|
|
75
|
-
* Rotation of parent bone, in world unit.
|
|
76
|
-
* We should update this constantly in [[update]].
|
|
77
|
-
*/
|
|
78
|
-
private _parentWorldRotation;
|
|
79
|
-
/**
|
|
80
|
-
* Initial state of the local matrix of the bone.
|
|
81
|
-
*/
|
|
82
|
-
private _initialLocalMatrix;
|
|
83
|
-
/**
|
|
84
|
-
* Initial state of the rotation of the bone.
|
|
85
|
-
*/
|
|
86
|
-
private _initialLocalRotation;
|
|
87
|
-
/**
|
|
88
|
-
* Initial state of the position of its child.
|
|
89
|
-
*/
|
|
90
|
-
private _initialLocalChildPosition;
|
|
91
|
-
/**
|
|
92
|
-
* Create a new VRMSpringBone.
|
|
93
|
-
*
|
|
94
|
-
* @param bone An Object3D that will be attached to this bone
|
|
95
|
-
* @param params Several parameters related to behavior of the spring bone
|
|
96
|
-
*/
|
|
97
|
-
constructor(bone: THREE.Object3D, params?: VRMSpringBoneParameters);
|
|
98
|
-
/**
|
|
99
|
-
* Reset the state of this bone.
|
|
100
|
-
* You might want to call [[VRMSpringBoneManager.reset]] instead.
|
|
101
|
-
*/
|
|
102
|
-
reset(): void;
|
|
103
|
-
/**
|
|
104
|
-
* Update the state of this bone.
|
|
105
|
-
* You might want to call [[VRMSpringBoneManager.update]] instead.
|
|
106
|
-
*
|
|
107
|
-
* @param delta deltaTime
|
|
108
|
-
*/
|
|
109
|
-
update(delta: number): void;
|
|
110
|
-
/**
|
|
111
|
-
* Do collision math against every colliders attached to this bone.
|
|
112
|
-
*
|
|
113
|
-
* @param tail The tail you want to process
|
|
114
|
-
*/
|
|
115
|
-
private _collision;
|
|
116
|
-
/**
|
|
117
|
-
* Create a matrix that converts center space into world space.
|
|
118
|
-
* @param target Target matrix
|
|
119
|
-
*/
|
|
120
|
-
private _getMatrixCenterToWorld;
|
|
121
|
-
/**
|
|
122
|
-
* Create a matrix that converts world space into center space.
|
|
123
|
-
* @param target Target matrix
|
|
124
|
-
*/
|
|
125
|
-
private _getMatrixWorldToCenter;
|
|
126
|
-
/**
|
|
127
|
-
* Returns the world matrix of its parent object.
|
|
128
|
-
*/
|
|
129
|
-
private _getParentMatrixWorld;
|
|
130
|
-
}
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { VRMSpringBoneColliderMesh } from './VRMSpringBoneColliderGroup';
|
|
3
|
+
import { VRMSpringBoneParameters } from './VRMSpringBoneParameters';
|
|
4
|
+
/**
|
|
5
|
+
* A class represents a single spring bone of a VRM.
|
|
6
|
+
* It should be managed by a [[VRMSpringBoneManager]].
|
|
7
|
+
*/
|
|
8
|
+
export declare class VRMSpringBone {
|
|
9
|
+
/**
|
|
10
|
+
* Radius of the bone, will be used for collision.
|
|
11
|
+
*/
|
|
12
|
+
radius: number;
|
|
13
|
+
/**
|
|
14
|
+
* Stiffness force of the bone. Increasing the value = faster convergence (feels "harder").
|
|
15
|
+
* On UniVRM, its range on GUI is between `0.0` and `4.0` .
|
|
16
|
+
*/
|
|
17
|
+
stiffnessForce: number;
|
|
18
|
+
/**
|
|
19
|
+
* Power of the gravity against this bone.
|
|
20
|
+
* The "power" used in here is very far from scientific physics term...
|
|
21
|
+
*/
|
|
22
|
+
gravityPower: number;
|
|
23
|
+
/**
|
|
24
|
+
* Direction of the gravity against this bone.
|
|
25
|
+
* Usually it should be normalized.
|
|
26
|
+
*/
|
|
27
|
+
gravityDir: THREE.Vector3;
|
|
28
|
+
/**
|
|
29
|
+
* Drag force of the bone. Increasing the value = less oscillation (feels "heavier").
|
|
30
|
+
* On UniVRM, its range on GUI is between `0.0` and `1.0` .
|
|
31
|
+
*/
|
|
32
|
+
dragForce: number;
|
|
33
|
+
/**
|
|
34
|
+
* Collider groups attached to this bone.
|
|
35
|
+
*/
|
|
36
|
+
colliders: VRMSpringBoneColliderMesh[];
|
|
37
|
+
/**
|
|
38
|
+
* An Object3D attached to this bone.
|
|
39
|
+
*/
|
|
40
|
+
readonly bone: THREE.Object3D;
|
|
41
|
+
/**
|
|
42
|
+
* Current position of child tail, in world unit. Will be used for verlet integration.
|
|
43
|
+
*/
|
|
44
|
+
protected _currentTail: THREE.Vector3;
|
|
45
|
+
/**
|
|
46
|
+
* Previous position of child tail, in world unit. Will be used for verlet integration.
|
|
47
|
+
*/
|
|
48
|
+
protected _prevTail: THREE.Vector3;
|
|
49
|
+
/**
|
|
50
|
+
* Next position of child tail, in world unit. Will be used for verlet integration.
|
|
51
|
+
* Actually used only in [[update]] and it's kind of temporary variable.
|
|
52
|
+
*/
|
|
53
|
+
protected _nextTail: THREE.Vector3;
|
|
54
|
+
/**
|
|
55
|
+
* Initial axis of the bone, in local unit.
|
|
56
|
+
*/
|
|
57
|
+
protected _boneAxis: THREE.Vector3;
|
|
58
|
+
/**
|
|
59
|
+
* Length of the bone in relative space unit. Will be used for normalization in update loop.
|
|
60
|
+
* It's same as local unit length unless there are scale transformation in world matrix.
|
|
61
|
+
*/
|
|
62
|
+
protected _centerSpaceBoneLength: number;
|
|
63
|
+
/**
|
|
64
|
+
* Position of this bone in relative space, kind of a temporary variable.
|
|
65
|
+
*/
|
|
66
|
+
protected _centerSpacePosition: THREE.Vector3;
|
|
67
|
+
/**
|
|
68
|
+
* This springbone will be calculated based on the space relative from this object.
|
|
69
|
+
* If this is `null`, springbone will be calculated in world space.
|
|
70
|
+
*/
|
|
71
|
+
protected _center: THREE.Object3D | null;
|
|
72
|
+
get center(): THREE.Object3D | null;
|
|
73
|
+
set center(center: THREE.Object3D | null);
|
|
74
|
+
/**
|
|
75
|
+
* Rotation of parent bone, in world unit.
|
|
76
|
+
* We should update this constantly in [[update]].
|
|
77
|
+
*/
|
|
78
|
+
private _parentWorldRotation;
|
|
79
|
+
/**
|
|
80
|
+
* Initial state of the local matrix of the bone.
|
|
81
|
+
*/
|
|
82
|
+
private _initialLocalMatrix;
|
|
83
|
+
/**
|
|
84
|
+
* Initial state of the rotation of the bone.
|
|
85
|
+
*/
|
|
86
|
+
private _initialLocalRotation;
|
|
87
|
+
/**
|
|
88
|
+
* Initial state of the position of its child.
|
|
89
|
+
*/
|
|
90
|
+
private _initialLocalChildPosition;
|
|
91
|
+
/**
|
|
92
|
+
* Create a new VRMSpringBone.
|
|
93
|
+
*
|
|
94
|
+
* @param bone An Object3D that will be attached to this bone
|
|
95
|
+
* @param params Several parameters related to behavior of the spring bone
|
|
96
|
+
*/
|
|
97
|
+
constructor(bone: THREE.Object3D, params?: VRMSpringBoneParameters);
|
|
98
|
+
/**
|
|
99
|
+
* Reset the state of this bone.
|
|
100
|
+
* You might want to call [[VRMSpringBoneManager.reset]] instead.
|
|
101
|
+
*/
|
|
102
|
+
reset(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Update the state of this bone.
|
|
105
|
+
* You might want to call [[VRMSpringBoneManager.update]] instead.
|
|
106
|
+
*
|
|
107
|
+
* @param delta deltaTime
|
|
108
|
+
*/
|
|
109
|
+
update(delta: number): void;
|
|
110
|
+
/**
|
|
111
|
+
* Do collision math against every colliders attached to this bone.
|
|
112
|
+
*
|
|
113
|
+
* @param tail The tail you want to process
|
|
114
|
+
*/
|
|
115
|
+
private _collision;
|
|
116
|
+
/**
|
|
117
|
+
* Create a matrix that converts center space into world space.
|
|
118
|
+
* @param target Target matrix
|
|
119
|
+
*/
|
|
120
|
+
private _getMatrixCenterToWorld;
|
|
121
|
+
/**
|
|
122
|
+
* Create a matrix that converts world space into center space.
|
|
123
|
+
* @param target Target matrix
|
|
124
|
+
*/
|
|
125
|
+
private _getMatrixWorldToCenter;
|
|
126
|
+
/**
|
|
127
|
+
* Returns the world matrix of its parent object.
|
|
128
|
+
*/
|
|
129
|
+
private _getParentMatrixWorld;
|
|
130
|
+
}
|