@pixiv/three-vrm 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixiv/three-vrm",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.1",
4
4
  "description": "VRM file loader for three.js.",
5
5
  "license": "MIT",
6
6
  "author": "pixiv",
@@ -35,8 +35,9 @@
35
35
  "build-types": "tsc --declaration --declarationDir ./types --emitDeclarationOnly && downlevel-dts types ts3.4/types",
36
36
  "docs": "typedoc --entryPoints ./src/index.ts --out docs",
37
37
  "test": "echo There is no test for three-vrm",
38
- "lint": "eslint \"src/**/*.{ts,tsx}\" && prettier \"src/**/*.{ts,tsx}\" --check",
39
- "lint-fix": "eslint \"src/**/*.{ts,tsx}\" --fix && prettier \"src/**/*.{ts,tsx}\" --write"
38
+ "lint": "eslint \"src/**/*.{ts,tsx}\" && yarn lint-examples && prettier \"src/**/*.{ts,tsx}\" --check",
39
+ "lint-examples": "eslint \"examples/**/*.{ts,tsx,js,html}\" --rule \"padded-blocks: error\"",
40
+ "lint-fix": "eslint \"src/**/*.{ts,tsx}\" --fix && eslint \"examples/**/*.{ts,tsx,js,html}\" --fix && prettier \"src/**/*.{ts,tsx}\" --write"
40
41
  },
41
42
  "lint-staged": {
42
43
  "./src/**/*.{ts,tsx}": [
@@ -45,23 +46,22 @@
45
46
  ]
46
47
  },
47
48
  "dependencies": {
48
- "@pixiv/three-vrm-core": "^1.0.0-beta.9",
49
- "@pixiv/three-vrm-materials-hdr-emissive-multiplier": "^1.0.0-beta.9",
50
- "@pixiv/three-vrm-materials-mtoon": "^1.0.0-beta.9",
51
- "@pixiv/three-vrm-materials-v0compat": "^1.0.0-beta.9",
52
- "@pixiv/three-vrm-node-constraint": "^1.0.0-beta.9",
53
- "@pixiv/three-vrm-springbone": "^1.0.0-beta.9"
49
+ "@pixiv/three-vrm-core": "1.0.1",
50
+ "@pixiv/three-vrm-materials-hdr-emissive-multiplier": "1.0.0",
51
+ "@pixiv/three-vrm-materials-mtoon": "1.0.0",
52
+ "@pixiv/three-vrm-materials-v0compat": "1.0.0",
53
+ "@pixiv/three-vrm-node-constraint": "1.0.0",
54
+ "@pixiv/three-vrm-springbone": "1.0.0"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@rollup/plugin-node-resolve": "^13.0.0",
57
- "@types/three": "^0.137.0",
58
+ "@types/three": "^0.140.0",
58
59
  "lint-staged": "10.5.4",
59
- "quicktype": "^15.0.258",
60
- "three": "^0.137.4"
60
+ "three": "^0.140.2"
61
61
  },
62
62
  "peerDependencies": {
63
- "@types/three": "^0.137.0",
64
- "three": "^0.137.4"
63
+ "@types/three": "^0.140.0",
64
+ "three": "^0.140.2"
65
65
  },
66
- "gitHead": "31a046e8ef027917490cbbb3e558f9f97f3d3259"
66
+ "gitHead": "a55f5d81222cbf300ae30c92e825225de090fe73"
67
67
  }
@@ -22,4 +22,11 @@ export interface VRMLoaderPluginOptions {
22
22
  * Will be overwritten if you use custom loader plugins for each components.
23
23
  */
24
24
  helperRoot?: THREE.Object3D;
25
+ /**
26
+ * Whether it copies pose from normalizedHumanBones to rawHumanBones on {@link update}.
27
+ * `true` by default.
28
+ *
29
+ * @default true
30
+ */
31
+ autoUpdateHumanBones?: boolean;
25
32
  }
@@ -1,2 +1,7 @@
1
1
  import { VRM } from '../VRM';
2
+ /**
3
+ * If the given VRM is VRM0.0, rotate the `vrm.scene` by 180 degrees around the Y axis.
4
+ *
5
+ * @param vrm The target VRM
6
+ */
2
7
  export declare function rotateVRM0(vrm: VRM): void;
package/types/VRM.d.ts CHANGED
@@ -1,39 +1,39 @@
1
- import * as THREE from 'three';
2
- import { VRMCore } from '@pixiv/three-vrm-core';
3
- import { VRMNodeConstraintManager } from '@pixiv/three-vrm-node-constraint';
4
- import { VRMSpringBoneManager } from '@pixiv/three-vrm-springbone';
5
- import { VRMParameters } from './VRMParameters';
6
- /**
7
- * A class that represents a single VRM model.
8
- */
9
- export declare class VRM extends VRMCore {
10
- /**
11
- * Contains materials of the VRM.
12
- * `update` method of these materials will be called via its {@link VRM.update} method.
13
- */
14
- readonly materials?: THREE.Material[];
15
- /**
16
- * A {@link VRMSpringBoneManager} manipulates all spring bones attached on the VRM.
17
- * Usually you don't have to care about this property.
18
- */
19
- readonly springBoneManager?: VRMSpringBoneManager;
20
- /**
21
- * A {@link VRMNodeConstraintManager} manipulates all constraints attached on the VRM.
22
- * Usually you don't have to care about this property.
23
- */
24
- readonly nodeConstraintManager?: VRMNodeConstraintManager;
25
- /**
26
- * Create a new VRM instance.
27
- *
28
- * @param params [[VRMParameters]] that represents components of the VRM
29
- */
30
- constructor(params: VRMParameters);
31
- /**
32
- * **You need to call this on your update loop.**
33
- *
34
- * This function updates every VRM components.
35
- *
36
- * @param delta deltaTime
37
- */
38
- update(delta: number): void;
39
- }
1
+ import * as THREE from 'three';
2
+ import { VRMCore } from '@pixiv/three-vrm-core';
3
+ import { VRMNodeConstraintManager } from '@pixiv/three-vrm-node-constraint';
4
+ import { VRMSpringBoneManager } from '@pixiv/three-vrm-springbone';
5
+ import { VRMParameters } from './VRMParameters';
6
+ /**
7
+ * A class that represents a single VRM model.
8
+ */
9
+ export declare class VRM extends VRMCore {
10
+ /**
11
+ * Contains materials of the VRM.
12
+ * `update` method of these materials will be called via its {@link VRM.update} method.
13
+ */
14
+ readonly materials?: THREE.Material[];
15
+ /**
16
+ * A {@link VRMSpringBoneManager} manipulates all spring bones attached on the VRM.
17
+ * Usually you don't have to care about this property.
18
+ */
19
+ readonly springBoneManager?: VRMSpringBoneManager;
20
+ /**
21
+ * A {@link VRMNodeConstraintManager} manipulates all constraints attached on the VRM.
22
+ * Usually you don't have to care about this property.
23
+ */
24
+ readonly nodeConstraintManager?: VRMNodeConstraintManager;
25
+ /**
26
+ * Create a new VRM instance.
27
+ *
28
+ * @param params [[VRMParameters]] that represents components of the VRM
29
+ */
30
+ constructor(params: VRMParameters);
31
+ /**
32
+ * **You need to call this on your update loop.**
33
+ *
34
+ * This function updates every VRM components.
35
+ *
36
+ * @param delta deltaTime
37
+ */
38
+ update(delta: number): void;
39
+ }
@@ -1,31 +1,31 @@
1
- import * as THREE from 'three';
2
- import { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
3
- import { VRMExpressionLoaderPlugin, VRMFirstPersonLoaderPlugin, VRMHumanoidLoaderPlugin, VRMLookAtLoaderPlugin, VRMMetaLoaderPlugin } from '@pixiv/three-vrm-core';
4
- import { MToonMaterialLoaderPlugin } from '@pixiv/three-vrm-materials-mtoon';
5
- import { VRMMaterialsHDREmissiveMultiplierLoaderPlugin } from '@pixiv/three-vrm-materials-hdr-emissive-multiplier';
6
- import { VRMMaterialsV0CompatPlugin } from '@pixiv/three-vrm-materials-v0compat';
7
- import { VRMNodeConstraintLoaderPlugin } from '@pixiv/three-vrm-node-constraint';
8
- import { VRMSpringBoneLoaderPlugin } from '@pixiv/three-vrm-springbone';
9
- import { VRMLoaderPluginOptions } from './VRMLoaderPluginOptions';
10
- export declare class VRMLoaderPlugin implements GLTFLoaderPlugin {
11
- readonly parser: GLTFParser;
12
- readonly expressionPlugin: VRMExpressionLoaderPlugin;
13
- readonly firstPersonPlugin: VRMFirstPersonLoaderPlugin;
14
- readonly humanoidPlugin: VRMHumanoidLoaderPlugin;
15
- readonly lookAtPlugin: VRMLookAtLoaderPlugin;
16
- readonly metaPlugin: VRMMetaLoaderPlugin;
17
- readonly mtoonMaterialPlugin: MToonMaterialLoaderPlugin;
18
- readonly materialsHDREmissiveMultiplierPlugin: VRMMaterialsHDREmissiveMultiplierLoaderPlugin;
19
- readonly materialsV0CompatPlugin: VRMMaterialsV0CompatPlugin;
20
- readonly springBonePlugin: VRMSpringBoneLoaderPlugin;
21
- readonly nodeConstraintPlugin: VRMNodeConstraintLoaderPlugin;
22
- get name(): string;
23
- constructor(parser: GLTFParser, options?: VRMLoaderPluginOptions);
24
- beforeRoot(): Promise<void>;
25
- loadMesh(meshIndex: number): Promise<THREE.Group | THREE.Mesh | THREE.SkinnedMesh>;
26
- getMaterialType(materialIndex: number): typeof THREE.Material | null;
27
- extendMaterialParams(materialIndex: number, materialParams: {
28
- [key: string]: any;
29
- }): Promise<any>;
30
- afterRoot(gltf: GLTF): Promise<void>;
31
- }
1
+ import * as THREE from 'three';
2
+ import { GLTF, GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js';
3
+ import { VRMExpressionLoaderPlugin, VRMFirstPersonLoaderPlugin, VRMHumanoidLoaderPlugin, VRMLookAtLoaderPlugin, VRMMetaLoaderPlugin } from '@pixiv/three-vrm-core';
4
+ import { MToonMaterialLoaderPlugin } from '@pixiv/three-vrm-materials-mtoon';
5
+ import { VRMMaterialsHDREmissiveMultiplierLoaderPlugin } from '@pixiv/three-vrm-materials-hdr-emissive-multiplier';
6
+ import { VRMMaterialsV0CompatPlugin } from '@pixiv/three-vrm-materials-v0compat';
7
+ import { VRMNodeConstraintLoaderPlugin } from '@pixiv/three-vrm-node-constraint';
8
+ import { VRMSpringBoneLoaderPlugin } from '@pixiv/three-vrm-springbone';
9
+ import { VRMLoaderPluginOptions } from './VRMLoaderPluginOptions';
10
+ export declare class VRMLoaderPlugin implements GLTFLoaderPlugin {
11
+ readonly parser: GLTFParser;
12
+ readonly expressionPlugin: VRMExpressionLoaderPlugin;
13
+ readonly firstPersonPlugin: VRMFirstPersonLoaderPlugin;
14
+ readonly humanoidPlugin: VRMHumanoidLoaderPlugin;
15
+ readonly lookAtPlugin: VRMLookAtLoaderPlugin;
16
+ readonly metaPlugin: VRMMetaLoaderPlugin;
17
+ readonly mtoonMaterialPlugin: MToonMaterialLoaderPlugin;
18
+ readonly materialsHDREmissiveMultiplierPlugin: VRMMaterialsHDREmissiveMultiplierLoaderPlugin;
19
+ readonly materialsV0CompatPlugin: VRMMaterialsV0CompatPlugin;
20
+ readonly springBonePlugin: VRMSpringBoneLoaderPlugin;
21
+ readonly nodeConstraintPlugin: VRMNodeConstraintLoaderPlugin;
22
+ get name(): string;
23
+ constructor(parser: GLTFParser, options?: VRMLoaderPluginOptions);
24
+ beforeRoot(): Promise<void>;
25
+ loadMesh(meshIndex: number): Promise<THREE.Group | THREE.Mesh | THREE.SkinnedMesh>;
26
+ getMaterialType(materialIndex: number): typeof THREE.Material | null;
27
+ extendMaterialParams(materialIndex: number, materialParams: {
28
+ [key: string]: any;
29
+ }): Promise<any>;
30
+ afterRoot(gltf: GLTF): Promise<void>;
31
+ }
@@ -1,25 +1,32 @@
1
- import type * as THREE from 'three';
2
- import type { VRMExpressionLoaderPlugin, VRMFirstPersonLoaderPlugin, VRMHumanoidLoaderPlugin, VRMLookAtLoaderPlugin, VRMMetaLoaderPlugin } from '@pixiv/three-vrm-core';
3
- import type { MToonMaterialLoaderPlugin } from '@pixiv/three-vrm-materials-mtoon';
4
- import type { VRMMaterialsHDREmissiveMultiplierLoaderPlugin } from '@pixiv/three-vrm-materials-hdr-emissive-multiplier';
5
- import type { VRMMaterialsV0CompatPlugin } from '@pixiv/three-vrm-materials-v0compat';
6
- import type { VRMNodeConstraintLoaderPlugin } from '@pixiv/three-vrm-node-constraint';
7
- import type { VRMSpringBoneLoaderPlugin } from '@pixiv/three-vrm-springbone';
8
- export interface VRMLoaderPluginOptions {
9
- expressionPlugin?: VRMExpressionLoaderPlugin;
10
- firstPersonPlugin?: VRMFirstPersonLoaderPlugin;
11
- humanoidPlugin?: VRMHumanoidLoaderPlugin;
12
- lookAtPlugin?: VRMLookAtLoaderPlugin;
13
- metaPlugin?: VRMMetaLoaderPlugin;
14
- mtoonMaterialPlugin?: MToonMaterialLoaderPlugin;
15
- materialsHDREmissiveMultiplierPlugin?: VRMMaterialsHDREmissiveMultiplierLoaderPlugin;
16
- materialsV0CompatPlugin?: VRMMaterialsV0CompatPlugin;
17
- springBonePlugin?: VRMSpringBoneLoaderPlugin;
18
- nodeConstraintPlugin?: VRMNodeConstraintLoaderPlugin;
19
- /**
20
- * If assigned, the object will be used as a helper root of every component.
21
- * Useful for debug.
22
- * Will be overwritten if you use custom loader plugins for each components.
23
- */
24
- helperRoot?: THREE.Object3D;
25
- }
1
+ import type * as THREE from 'three';
2
+ import type { VRMExpressionLoaderPlugin, VRMFirstPersonLoaderPlugin, VRMHumanoidLoaderPlugin, VRMLookAtLoaderPlugin, VRMMetaLoaderPlugin } from '@pixiv/three-vrm-core';
3
+ import type { MToonMaterialLoaderPlugin } from '@pixiv/three-vrm-materials-mtoon';
4
+ import type { VRMMaterialsHDREmissiveMultiplierLoaderPlugin } from '@pixiv/three-vrm-materials-hdr-emissive-multiplier';
5
+ import type { VRMMaterialsV0CompatPlugin } from '@pixiv/three-vrm-materials-v0compat';
6
+ import type { VRMNodeConstraintLoaderPlugin } from '@pixiv/three-vrm-node-constraint';
7
+ import type { VRMSpringBoneLoaderPlugin } from '@pixiv/three-vrm-springbone';
8
+ export interface VRMLoaderPluginOptions {
9
+ expressionPlugin?: VRMExpressionLoaderPlugin;
10
+ firstPersonPlugin?: VRMFirstPersonLoaderPlugin;
11
+ humanoidPlugin?: VRMHumanoidLoaderPlugin;
12
+ lookAtPlugin?: VRMLookAtLoaderPlugin;
13
+ metaPlugin?: VRMMetaLoaderPlugin;
14
+ mtoonMaterialPlugin?: MToonMaterialLoaderPlugin;
15
+ materialsHDREmissiveMultiplierPlugin?: VRMMaterialsHDREmissiveMultiplierLoaderPlugin;
16
+ materialsV0CompatPlugin?: VRMMaterialsV0CompatPlugin;
17
+ springBonePlugin?: VRMSpringBoneLoaderPlugin;
18
+ nodeConstraintPlugin?: VRMNodeConstraintLoaderPlugin;
19
+ /**
20
+ * If assigned, the object will be used as a helper root of every component.
21
+ * Useful for debug.
22
+ * Will be overwritten if you use custom loader plugins for each components.
23
+ */
24
+ helperRoot?: THREE.Object3D;
25
+ /**
26
+ * Whether it copies pose from normalizedHumanBones to rawHumanBones on {@link update}.
27
+ * `true` by default.
28
+ *
29
+ * @default true
30
+ */
31
+ autoUpdateHumanBones?: boolean;
32
+ }
@@ -1,11 +1,11 @@
1
- import { VRMCoreParameters } from '@pixiv/three-vrm-core';
2
- import { VRMSpringBoneManager } from '@pixiv/three-vrm-springbone';
3
- import { VRMNodeConstraintManager } from '@pixiv/three-vrm-node-constraint';
4
- /**
5
- * Parameters for a {@link VRM} class.
6
- */
7
- export interface VRMParameters extends VRMCoreParameters {
8
- materials?: THREE.Material[];
9
- springBoneManager?: VRMSpringBoneManager;
10
- nodeConstraintManager?: VRMNodeConstraintManager;
11
- }
1
+ import { VRMCoreParameters } from '@pixiv/three-vrm-core';
2
+ import { VRMSpringBoneManager } from '@pixiv/three-vrm-springbone';
3
+ import { VRMNodeConstraintManager } from '@pixiv/three-vrm-node-constraint';
4
+ /**
5
+ * Parameters for a {@link VRM} class.
6
+ */
7
+ export interface VRMParameters extends VRMCoreParameters {
8
+ materials?: THREE.Material[];
9
+ springBoneManager?: VRMSpringBoneManager;
10
+ nodeConstraintManager?: VRMNodeConstraintManager;
11
+ }
@@ -1,2 +1,2 @@
1
- import * as THREE from 'three';
2
- export declare function deepDispose(object3D: THREE.Object3D): void;
1
+ import * as THREE from 'three';
2
+ export declare function deepDispose(object3D: THREE.Object3D): void;
@@ -1,11 +1,11 @@
1
- import { deepDispose } from './deepDispose';
2
- import { removeUnnecessaryJoints } from './removeUnnecessaryJoints';
3
- import { removeUnnecessaryVertices } from './removeUnnecessaryVertices';
4
- import { rotateVRM0 } from './rotateVRM0';
5
- export declare class VRMUtils {
6
- private constructor();
7
- static deepDispose: typeof deepDispose;
8
- static removeUnnecessaryJoints: typeof removeUnnecessaryJoints;
9
- static removeUnnecessaryVertices: typeof removeUnnecessaryVertices;
10
- static rotateVRM0: typeof rotateVRM0;
11
- }
1
+ import { deepDispose } from './deepDispose';
2
+ import { removeUnnecessaryJoints } from './removeUnnecessaryJoints';
3
+ import { removeUnnecessaryVertices } from './removeUnnecessaryVertices';
4
+ import { rotateVRM0 } from './rotateVRM0';
5
+ export declare class VRMUtils {
6
+ private constructor();
7
+ static deepDispose: typeof deepDispose;
8
+ static removeUnnecessaryJoints: typeof removeUnnecessaryJoints;
9
+ static removeUnnecessaryVertices: typeof removeUnnecessaryVertices;
10
+ static rotateVRM0: typeof rotateVRM0;
11
+ }
@@ -1,9 +1,9 @@
1
- import * as THREE from 'three';
2
- /**
3
- * Traverse given object and remove unnecessarily bound joints from every `THREE.SkinnedMesh`.
4
- * Some environments like mobile devices have a lower limit of bones and might be unable to perform mesh skinning, this function might resolve such an issue.
5
- * Also this function might greatly improve the performance of mesh skinning.
6
- *
7
- * @param root Root object that will be traversed
8
- */
9
- export declare function removeUnnecessaryJoints(root: THREE.Object3D): void;
1
+ import * as THREE from 'three';
2
+ /**
3
+ * Traverse given object and remove unnecessarily bound joints from every `THREE.SkinnedMesh`.
4
+ * Some environments like mobile devices have a lower limit of bones and might be unable to perform mesh skinning, this function might resolve such an issue.
5
+ * Also this function might greatly improve the performance of mesh skinning.
6
+ *
7
+ * @param root Root object that will be traversed
8
+ */
9
+ export declare function removeUnnecessaryJoints(root: THREE.Object3D): void;
@@ -1,12 +1,12 @@
1
- import * as THREE from 'three';
2
- /**
3
- * Traverse given object and remove unnecessary vertices from every BufferGeometries.
4
- * This only processes buffer geometries with index buffer.
5
- *
6
- * Three.js creates morph textures for each geometries and it sometimes consumes unnecessary amount of VRAM for certain models.
7
- * This function will optimize geometries to reduce the size of morph texture.
8
- * See: https://github.com/mrdoob/three.js/issues/23095
9
- *
10
- * @param root Root object that will be traversed
11
- */
12
- export declare function removeUnnecessaryVertices(root: THREE.Object3D): void;
1
+ import * as THREE from 'three';
2
+ /**
3
+ * Traverse given object and remove unnecessary vertices from every BufferGeometries.
4
+ * This only processes buffer geometries with index buffer.
5
+ *
6
+ * Three.js creates morph textures for each geometries and it sometimes consumes unnecessary amount of VRAM for certain models.
7
+ * This function will optimize geometries to reduce the size of morph texture.
8
+ * See: https://github.com/mrdoob/three.js/issues/23095
9
+ *
10
+ * @param root Root object that will be traversed
11
+ */
12
+ export declare function removeUnnecessaryVertices(root: THREE.Object3D): void;
@@ -1,2 +1,7 @@
1
- import { VRM } from '../VRM';
2
- export declare function rotateVRM0(vrm: VRM): void;
1
+ import { VRM } from '../VRM';
2
+ /**
3
+ * If the given VRM is VRM0.0, rotate the `vrm.scene` by 180 degrees around the Y axis.
4
+ *
5
+ * @param vrm The target VRM
6
+ */
7
+ export declare function rotateVRM0(vrm: VRM): void;
package/types/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { VRM } from './VRM';
2
- export { VRMLoaderPlugin } from './VRMLoaderPlugin';
3
- export type { VRMLoaderPluginOptions } from './VRMLoaderPluginOptions';
4
- export type { VRMParameters } from './VRMParameters';
5
- export * from './VRMUtils';
6
- export * from '@pixiv/three-vrm-core';
7
- export * from '@pixiv/three-vrm-materials-mtoon';
8
- export * from '@pixiv/three-vrm-node-constraint';
9
- export * from '@pixiv/three-vrm-springbone';
1
+ export { VRM } from './VRM';
2
+ export { VRMLoaderPlugin } from './VRMLoaderPlugin';
3
+ export type { VRMLoaderPluginOptions } from './VRMLoaderPluginOptions';
4
+ export type { VRMParameters } from './VRMParameters';
5
+ export * from './VRMUtils';
6
+ export * from '@pixiv/three-vrm-core';
7
+ export * from '@pixiv/three-vrm-materials-mtoon';
8
+ export * from '@pixiv/three-vrm-node-constraint';
9
+ export * from '@pixiv/three-vrm-springbone';
@@ -1,28 +1,28 @@
1
- import * as THREE from 'three';
2
- export declare class Matrix4InverseCache {
3
- /**
4
- * The target matrix.
5
- */
6
- readonly matrix: THREE.Matrix4;
7
- /**
8
- * A cache of inverse of current matrix.
9
- */
10
- private readonly _inverseCache;
11
- /**
12
- * A flag that makes it want to recalculate its {@link _inverseCache}.
13
- * Will be set `true` when `elements` are mutated and be used in `getInverse`.
14
- */
15
- private _shouldUpdateInverse;
16
- /**
17
- * The original of `matrix.elements`
18
- */
19
- private readonly _originalElements;
20
- /**
21
- * Inverse of given matrix.
22
- * Note that it will return its internal private instance.
23
- * Make sure copying this before mutate this.
24
- */
25
- get inverse(): THREE.Matrix4;
26
- constructor(matrix: THREE.Matrix4);
27
- revert(): void;
28
- }
1
+ import * as THREE from 'three';
2
+ export declare class Matrix4InverseCache {
3
+ /**
4
+ * The target matrix.
5
+ */
6
+ readonly matrix: THREE.Matrix4;
7
+ /**
8
+ * A cache of inverse of current matrix.
9
+ */
10
+ private readonly _inverseCache;
11
+ /**
12
+ * A flag that makes it want to recalculate its {@link _inverseCache}.
13
+ * Will be set `true` when `elements` are mutated and be used in `getInverse`.
14
+ */
15
+ private _shouldUpdateInverse;
16
+ /**
17
+ * The original of `matrix.elements`
18
+ */
19
+ private readonly _originalElements;
20
+ /**
21
+ * Inverse of given matrix.
22
+ * Note that it will return its internal private instance.
23
+ * Make sure copying this before mutate this.
24
+ */
25
+ get inverse(): THREE.Matrix4;
26
+ constructor(matrix: THREE.Matrix4);
27
+ revert(): void;
28
+ }
@@ -1,8 +1,8 @@
1
- import * as THREE from 'three';
2
- /**
3
- * A compat function for `Matrix4.invert()` / `Matrix4.getInverse()`.
4
- * `Matrix4.invert()` is introduced in r123 and `Matrix4.getInverse()` emits a warning.
5
- * We are going to use this compat for a while.
6
- * @param target A target matrix
7
- */
8
- export declare function mat4InvertCompat<T extends THREE.Matrix4>(target: T): T;
1
+ import * as THREE from 'three';
2
+ /**
3
+ * A compat function for `Matrix4.invert()` / `Matrix4.getInverse()`.
4
+ * `Matrix4.invert()` is introduced in r123 and `Matrix4.getInverse()` emits a warning.
5
+ * We are going to use this compat for a while.
6
+ * @param target A target matrix
7
+ */
8
+ export declare function mat4InvertCompat<T extends THREE.Matrix4>(target: T): T;
@@ -1,40 +1,40 @@
1
- import * as THREE from 'three';
2
- /**
3
- * Clamp an input number within [ `0.0` - `1.0` ].
4
- *
5
- * @param value The input value
6
- */
7
- export declare function saturate(value: number): number;
8
- /**
9
- * Map the range of an input value from [ `min` - `max` ] to [ `0.0` - `1.0` ].
10
- * If input value is less than `min` , it returns `0.0`.
11
- * If input value is greater than `max` , it returns `1.0`.
12
- *
13
- * See also: https://threejs.org/docs/#api/en/math/Math.smoothstep
14
- *
15
- * @param x The value that will be mapped into the specified range
16
- * @param min Minimum value of the range
17
- * @param max Maximum value of the range
18
- */
19
- export declare function linstep(x: number, min: number, max: number): number;
20
- /**
21
- * Extract world position of an object from its world space matrix, in cheaper way.
22
- *
23
- * @param object The object
24
- * @param out Target vector
25
- */
26
- export declare function getWorldPositionLite(object: THREE.Object3D, out: THREE.Vector3): THREE.Vector3;
27
- /**
28
- * Extract world scale of an object from its world space matrix, in cheaper way.
29
- *
30
- * @param object The object
31
- * @param out Target vector
32
- */
33
- export declare function getWorldScaleLite(object: THREE.Object3D, out: THREE.Vector3): THREE.Vector3;
34
- /**
35
- * Extract world rotation of an object from its world space matrix, in cheaper way.
36
- *
37
- * @param object The object
38
- * @param out Target vector
39
- */
40
- export declare function getWorldQuaternionLite(object: THREE.Object3D, out: THREE.Quaternion): THREE.Quaternion;
1
+ import * as THREE from 'three';
2
+ /**
3
+ * Clamp an input number within [ `0.0` - `1.0` ].
4
+ *
5
+ * @param value The input value
6
+ */
7
+ export declare function saturate(value: number): number;
8
+ /**
9
+ * Map the range of an input value from [ `min` - `max` ] to [ `0.0` - `1.0` ].
10
+ * If input value is less than `min` , it returns `0.0`.
11
+ * If input value is greater than `max` , it returns `1.0`.
12
+ *
13
+ * See also: https://threejs.org/docs/#api/en/math/Math.smoothstep
14
+ *
15
+ * @param x The value that will be mapped into the specified range
16
+ * @param min Minimum value of the range
17
+ * @param max Maximum value of the range
18
+ */
19
+ export declare function linstep(x: number, min: number, max: number): number;
20
+ /**
21
+ * Extract world position of an object from its world space matrix, in cheaper way.
22
+ *
23
+ * @param object The object
24
+ * @param out Target vector
25
+ */
26
+ export declare function getWorldPositionLite(object: THREE.Object3D, out: THREE.Vector3): THREE.Vector3;
27
+ /**
28
+ * Extract world scale of an object from its world space matrix, in cheaper way.
29
+ *
30
+ * @param object The object
31
+ * @param out Target vector
32
+ */
33
+ export declare function getWorldScaleLite(object: THREE.Object3D, out: THREE.Vector3): THREE.Vector3;
34
+ /**
35
+ * Extract world rotation of an object from its world space matrix, in cheaper way.
36
+ *
37
+ * @param object The object
38
+ * @param out Target vector
39
+ */
40
+ export declare function getWorldQuaternionLite(object: THREE.Object3D, out: THREE.Quaternion): THREE.Quaternion;
@@ -1,8 +1,8 @@
1
- import * as THREE from 'three';
2
- /**
3
- * A compat function for `Quaternion.invert()` / `Quaternion.inverse()`.
4
- * `Quaternion.invert()` is introduced in r123 and `Quaternion.inverse()` emits a warning.
5
- * We are going to use this compat for a while.
6
- * @param target A target quaternion
7
- */
8
- export declare function quatInvertCompat<T extends THREE.Quaternion>(target: T): T;
1
+ import * as THREE from 'three';
2
+ /**
3
+ * A compat function for `Quaternion.invert()` / `Quaternion.inverse()`.
4
+ * `Quaternion.invert()` is introduced in r123 and `Quaternion.inverse()` emits a warning.
5
+ * We are going to use this compat for a while.
6
+ * @param target A target quaternion
7
+ */
8
+ export declare function quatInvertCompat<T extends THREE.Quaternion>(target: T): T;
@@ -1 +0,0 @@
1
- export declare function renameMaterialProperty(name: string): string;
@@ -1 +0,0 @@
1
- export declare function renameMaterialProperty(name: string): string;