@pixiv/types-vrmc-node-constraint-1.0 1.0.0-beta.3

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2019-2021 pixiv Inc.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @pixiv/types-vrmc-node-constraint-1.0
2
+
3
+ Type definitions of VRMC_node_constraint 1.0 schema.
4
+
5
+ https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_node_constraint-1.0_draft
6
+
7
+ There should not be any implementation in this package. Just type definitions of the schema.
8
+
9
+ The extension root is named `VRMCNodeConstraint` .
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@pixiv/types-vrmc-node-constraint-1.0",
3
+ "version": "1.0.0-beta.3",
4
+ "description": "Type definitions of VRMC_node_constraint 1.0 schema",
5
+ "license": "MIT",
6
+ "author": "pixiv",
7
+ "files": [
8
+ "/ts*/",
9
+ "/types/",
10
+ "LICENSE"
11
+ ],
12
+ "main": "",
13
+ "types": "types/index.d.ts",
14
+ "typesVersions": {
15
+ "<3.9": {
16
+ "*": [
17
+ "ts3.4/*"
18
+ ]
19
+ }
20
+ },
21
+ "scripts": {
22
+ "version": "yarn all",
23
+ "all": "yarn lint && yarn clean && yarn build && yarn docs",
24
+ "clean": "rimraf docs/ ts*/ types/",
25
+ "build": "tsc --declaration --declarationDir ./types --emitDeclarationOnly && downlevel-dts types ts3.4/types",
26
+ "docs": "typedoc --entryPoints ./src/index.ts --out docs",
27
+ "lint": "eslint \"src/**/*.{ts,tsx}\" && prettier \"src/**/*.{ts,tsx}\" --check",
28
+ "lint-fix": "eslint \"src/**/*.{ts,tsx}\" --fix && prettier \"src/**/*.{ts,tsx}\" --write"
29
+ },
30
+ "lint-staged": {
31
+ "./src/**/*.{ts,tsx}": [
32
+ "eslint --fix",
33
+ "prettier --write"
34
+ ]
35
+ },
36
+ "gitHead": "fb89b23619d6e4b14aab1be3c482a0d5424ee7d8"
37
+ }
@@ -0,0 +1,45 @@
1
+ import { ConstraintObjectSpace } from './ConstraintObjectSpace';
2
+ /**
3
+ * A constraint that rotates the node to face sources.
4
+ */
5
+ export interface AimConstraint {
6
+ /**
7
+ * The index of the node constrains the node.
8
+ */
9
+ source: number;
10
+ /**
11
+ * The source node will be evaluated in this space.
12
+ */
13
+ sourceSpace?: ConstraintObjectSpace;
14
+ /**
15
+ * The destination node will be evaluated in this space.
16
+ */
17
+ destinationSpace?: ConstraintObjectSpace;
18
+ /**
19
+ * An axis which faces the direction of its sources.
20
+ */
21
+ aimVector?: [
22
+ number,
23
+ number,
24
+ number
25
+ ];
26
+ /**
27
+ * An up axis of the constraint.
28
+ */
29
+ upVector?: [
30
+ number,
31
+ number,
32
+ number
33
+ ];
34
+ /**
35
+ * Axes be constrained by this constraint, in Yaw-Pitch order.
36
+ */
37
+ freezeAxes?: [
38
+ boolean,
39
+ boolean
40
+ ];
41
+ /**
42
+ * The weight of the constraint.
43
+ */
44
+ weight?: number;
45
+ }
@@ -0,0 +1 @@
1
+ export declare type ConstraintObjectSpace = 'model' | 'local';
@@ -0,0 +1,30 @@
1
+ import { ConstraintObjectSpace } from './ConstraintObjectSpace';
2
+ /**
3
+ * A constraint that links the position with sources.
4
+ */
5
+ export interface PositionConstraint {
6
+ /**
7
+ * The index of the node constrains the node.
8
+ */
9
+ source: number;
10
+ /**
11
+ * The source node will be evaluated in this space.
12
+ */
13
+ sourceSpace?: ConstraintObjectSpace;
14
+ /**
15
+ * The destination node will be evaluated in this space.
16
+ */
17
+ destinationSpace?: ConstraintObjectSpace;
18
+ /**
19
+ * Axes be constrained by this constraint, in X-Y-Z order.
20
+ */
21
+ freezeAxes?: [
22
+ boolean,
23
+ boolean,
24
+ boolean
25
+ ];
26
+ /**
27
+ * The weight of the constraint.
28
+ */
29
+ weight?: number;
30
+ }
@@ -0,0 +1,30 @@
1
+ import { ConstraintObjectSpace } from './ConstraintObjectSpace';
2
+ /**
3
+ * A constraint that links the rotation with sources.
4
+ */
5
+ export interface RotationConstraint {
6
+ /**
7
+ * The index of the node constrains the node.
8
+ */
9
+ source: number;
10
+ /**
11
+ * The source node will be evaluated in this space.
12
+ */
13
+ sourceSpace?: ConstraintObjectSpace;
14
+ /**
15
+ * The destination node will be evaluated in this space.
16
+ */
17
+ destinationSpace?: ConstraintObjectSpace;
18
+ /**
19
+ * Axes be constrained by this constraint, in X-Y-Z order.
20
+ */
21
+ freezeAxes?: [
22
+ boolean,
23
+ boolean,
24
+ boolean
25
+ ];
26
+ /**
27
+ * The weight of the constraint.
28
+ */
29
+ weight?: number;
30
+ }
@@ -0,0 +1,19 @@
1
+ import { AimConstraint } from './AimConstraint';
2
+ import { PositionConstraint } from './PositionConstraint';
3
+ import { RotationConstraint } from './RotationConstraint';
4
+ /**
5
+ * glTF extension that defines a node constraint.
6
+ */
7
+ export interface VRMCNodeConstraint {
8
+ /**
9
+ * Specification version of VRMC_node_constraint
10
+ */
11
+ specVersion: '1.0-draft';
12
+ position?: PositionConstraint;
13
+ rotation?: RotationConstraint;
14
+ aim?: AimConstraint;
15
+ extensions?: {
16
+ [name: string]: any;
17
+ };
18
+ extras?: any;
19
+ }
@@ -0,0 +1,5 @@
1
+ export { AimConstraint } from './AimConstraint';
2
+ export { ConstraintObjectSpace } from './ConstraintObjectSpace';
3
+ export { PositionConstraint } from './PositionConstraint';
4
+ export { RotationConstraint } from './RotationConstraint';
5
+ export { VRMCNodeConstraint } from './VRMCNodeConstraint';
@@ -0,0 +1,34 @@
1
+ import type { ConstraintObjectSpace } from './ConstraintObjectSpace';
2
+ /**
3
+ * A constraint that rotates the node to face sources.
4
+ */
5
+ export interface AimConstraint {
6
+ /**
7
+ * The index of the node constrains the node.
8
+ */
9
+ source: number;
10
+ /**
11
+ * The source node will be evaluated in this space.
12
+ */
13
+ sourceSpace?: ConstraintObjectSpace;
14
+ /**
15
+ * The destination node will be evaluated in this space.
16
+ */
17
+ destinationSpace?: ConstraintObjectSpace;
18
+ /**
19
+ * An axis which faces the direction of its sources.
20
+ */
21
+ aimVector?: [number, number, number];
22
+ /**
23
+ * An up axis of the constraint.
24
+ */
25
+ upVector?: [number, number, number];
26
+ /**
27
+ * Axes be constrained by this constraint, in Yaw-Pitch order.
28
+ */
29
+ freezeAxes?: [boolean, boolean];
30
+ /**
31
+ * The weight of the constraint.
32
+ */
33
+ weight?: number;
34
+ }
@@ -0,0 +1 @@
1
+ export declare type ConstraintObjectSpace = 'model' | 'local';
@@ -0,0 +1,26 @@
1
+ import type { ConstraintObjectSpace } from './ConstraintObjectSpace';
2
+ /**
3
+ * A constraint that links the position with sources.
4
+ */
5
+ export interface PositionConstraint {
6
+ /**
7
+ * The index of the node constrains the node.
8
+ */
9
+ source: number;
10
+ /**
11
+ * The source node will be evaluated in this space.
12
+ */
13
+ sourceSpace?: ConstraintObjectSpace;
14
+ /**
15
+ * The destination node will be evaluated in this space.
16
+ */
17
+ destinationSpace?: ConstraintObjectSpace;
18
+ /**
19
+ * Axes be constrained by this constraint, in X-Y-Z order.
20
+ */
21
+ freezeAxes?: [boolean, boolean, boolean];
22
+ /**
23
+ * The weight of the constraint.
24
+ */
25
+ weight?: number;
26
+ }
@@ -0,0 +1,26 @@
1
+ import type { ConstraintObjectSpace } from './ConstraintObjectSpace';
2
+ /**
3
+ * A constraint that links the rotation with sources.
4
+ */
5
+ export interface RotationConstraint {
6
+ /**
7
+ * The index of the node constrains the node.
8
+ */
9
+ source: number;
10
+ /**
11
+ * The source node will be evaluated in this space.
12
+ */
13
+ sourceSpace?: ConstraintObjectSpace;
14
+ /**
15
+ * The destination node will be evaluated in this space.
16
+ */
17
+ destinationSpace?: ConstraintObjectSpace;
18
+ /**
19
+ * Axes be constrained by this constraint, in X-Y-Z order.
20
+ */
21
+ freezeAxes?: [boolean, boolean, boolean];
22
+ /**
23
+ * The weight of the constraint.
24
+ */
25
+ weight?: number;
26
+ }
@@ -0,0 +1,19 @@
1
+ import type { AimConstraint } from './AimConstraint';
2
+ import type { PositionConstraint } from './PositionConstraint';
3
+ import type { RotationConstraint } from './RotationConstraint';
4
+ /**
5
+ * glTF extension that defines a node constraint.
6
+ */
7
+ export interface VRMCNodeConstraint {
8
+ /**
9
+ * Specification version of VRMC_node_constraint
10
+ */
11
+ specVersion: '1.0-draft';
12
+ position?: PositionConstraint;
13
+ rotation?: RotationConstraint;
14
+ aim?: AimConstraint;
15
+ extensions?: {
16
+ [name: string]: any;
17
+ };
18
+ extras?: any;
19
+ }
@@ -0,0 +1,5 @@
1
+ export type { AimConstraint } from './AimConstraint';
2
+ export type { ConstraintObjectSpace } from './ConstraintObjectSpace';
3
+ export type { PositionConstraint } from './PositionConstraint';
4
+ export type { RotationConstraint } from './RotationConstraint';
5
+ export type { VRMCNodeConstraint } from './VRMCNodeConstraint';