@margoengine/horses 0.1.0 → 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/LICENSE +201 -201
- package/NOTICE +4 -4
- package/README.md +348 -348
- package/dist/scene-scope-BIsfeY-W.js +3 -3
- package/dist/shared/settings.d.ts +89 -89
- package/package.json +86 -86
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @margo/core-built
|
|
1
|
+
// @margo/core-built 1.0.0
|
|
2
2
|
import {coreRequirement as __margoCoreRequirement,assertCore as __margoAssertCore} from '@margoengine/core/extension';
|
|
3
3
|
|
|
4
4
|
//#region ../shared/scene-scope.js
|
|
@@ -12,7 +12,7 @@ function n(e) {
|
|
|
12
12
|
if (typeof e?.sceneOf == "function") {
|
|
13
13
|
for (let t of e.plugins?.values() ?? []) if (n = e.sceneOf(t)) break;
|
|
14
14
|
if (!n) {
|
|
15
|
-
let r = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("
|
|
15
|
+
let r = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
|
|
16
16
|
name: t(e, "scene-scope:"),
|
|
17
17
|
setup() {
|
|
18
18
|
n = e.sceneOf(r);
|
|
@@ -28,7 +28,7 @@ function r(e, n) {
|
|
|
28
28
|
scene: n,
|
|
29
29
|
run(r) {
|
|
30
30
|
if (!n) return r();
|
|
31
|
-
let i, a = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("
|
|
31
|
+
let i, a = {coreRequirement:/*@__PURE__*/__margoCoreRequirement("1.0.0",import.meta.url),
|
|
32
32
|
name: t(e, "scene-scope:"),
|
|
33
33
|
setup() {
|
|
34
34
|
i = r();
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
/** A colour value: linear RGB. */
|
|
2
|
-
export type SettingColor = readonly [number, number, number];
|
|
3
|
-
/** One gradient stop: a colour at a position (`elevation` unless the row's `stopKey` says otherwise). */
|
|
4
|
-
export type SettingStop = { readonly color: SettingColor };
|
|
5
|
-
/** One value of a setting: a number, a colour, a choice, gradient stops, or null where `nullable`. */
|
|
6
|
-
export type SettingValue = number | SettingColor | string | readonly SettingStop[] | null;
|
|
7
|
-
/** Values by setting name; a name left out takes its default. */
|
|
8
|
-
export type SettingValues = Readonly<Record<string, SettingValue>>;
|
|
9
|
-
/** One slider row, the shape every package's `/settings` entry shares. */
|
|
10
|
-
export interface SettingRow {
|
|
11
|
-
readonly name: string;
|
|
12
|
-
readonly group: string;
|
|
13
|
-
/** `number` is a slider, `color` three sliders or a picker, `choice` a list, `gradient` a stop editor. */
|
|
14
|
-
readonly kind: 'number' | 'color' | 'choice' | 'gradient';
|
|
15
|
-
/** The value with which the target draws exactly as it does without the option (null: follow the weather). */
|
|
16
|
-
readonly default: SettingValue;
|
|
17
|
-
readonly min?: number;
|
|
18
|
-
readonly max?: number;
|
|
19
|
-
readonly step?: number;
|
|
20
|
-
readonly choices?: readonly string[];
|
|
21
|
-
/** May be null: the target uses its own value, or follows the weather when `weather` is set. */
|
|
22
|
-
readonly nullable?: boolean;
|
|
23
|
-
/** The weather master slider that drives this row while it is null. */
|
|
24
|
-
readonly weather?: string;
|
|
25
|
-
/** The key a gradient stop is placed by (default `elevation`). */
|
|
26
|
-
readonly stopKey?: string;
|
|
27
|
-
readonly unit: string;
|
|
28
|
-
readonly about: string;
|
|
29
|
-
/** True: cheap to write every frame (no pipeline, buffer or texture is created), so it can be keyed over a shot. False: writing it rebuilds something. */
|
|
30
|
-
readonly live: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare const numberSetting: (
|
|
33
|
-
name: string,
|
|
34
|
-
group: string,
|
|
35
|
-
value: number,
|
|
36
|
-
min: number,
|
|
37
|
-
max: number,
|
|
38
|
-
step: number,
|
|
39
|
-
unit: string,
|
|
40
|
-
about: string,
|
|
41
|
-
live?: boolean,
|
|
42
|
-
) => SettingRow;
|
|
43
|
-
export declare const colorSetting: (
|
|
44
|
-
name: string,
|
|
45
|
-
group: string,
|
|
46
|
-
value: SettingColor,
|
|
47
|
-
min: number,
|
|
48
|
-
max: number,
|
|
49
|
-
about: string,
|
|
50
|
-
live?: boolean,
|
|
51
|
-
) => SettingRow;
|
|
52
|
-
export declare const choiceSetting: (
|
|
53
|
-
name: string,
|
|
54
|
-
group: string,
|
|
55
|
-
choices: readonly string[],
|
|
56
|
-
about: string,
|
|
57
|
-
live?: boolean,
|
|
58
|
-
) => SettingRow;
|
|
59
|
-
/** The row with a null default that follows the weather master slider `weather` until a value is given. */
|
|
60
|
-
export declare const followsWeather: (row: SettingRow, weather: string) => SettingRow;
|
|
61
|
-
/** Marks `key` of `target` as set by hand (`held` true) or hands it back to the weather (false). */
|
|
62
|
-
export declare function holdFromWeather(target: object, key: string, held?: boolean): void;
|
|
63
|
-
/** True while `key` of `target` holds a value set by hand, which the weather drive leaves alone. */
|
|
64
|
-
export declare const heldFromWeather: (target: object, key: string) => boolean;
|
|
65
|
-
export declare const sameSettingValue: (a: unknown, b: unknown) => boolean;
|
|
66
|
-
export declare function copySettingValue(v: SettingValue): SettingValue;
|
|
67
|
-
/** A fresh object holding every row at its default (a slider panel's state). */
|
|
68
|
-
export declare function settingDefaults(rows: readonly SettingRow[]): Record<string, SettingValue>;
|
|
69
|
-
/** The rows that may change every frame without a rebuild. */
|
|
70
|
-
export declare const liveSettings: (rows: readonly SettingRow[]) => SettingRow[];
|
|
71
|
-
/** A name to row map. */
|
|
72
|
-
export declare const settingIndex: (rows: readonly SettingRow[]) => Map<string, SettingRow>;
|
|
73
|
-
/** @throws RangeError when `v` is not a value of `row`. */
|
|
74
|
-
export declare function checkSettingValue(row: SettingRow, v: unknown, label: string): void;
|
|
75
|
-
/** @throws TypeError for an unknown name; RangeError for a bad value or a null on a row that is not nullable. */
|
|
76
|
-
export declare function checkSettings(
|
|
77
|
-
rows: readonly SettingRow[] | ReadonlyMap<string, SettingRow>,
|
|
78
|
-
values: SettingValues,
|
|
79
|
-
label: string,
|
|
80
|
-
entry?: string,
|
|
81
|
-
): void;
|
|
82
|
-
/** Checks `values`, then calls `write` once per row (or per row `only` accepts) with the given value or the default. */
|
|
83
|
-
export declare function applySettings(
|
|
84
|
-
rows: readonly SettingRow[],
|
|
85
|
-
values: SettingValues,
|
|
86
|
-
label: string,
|
|
87
|
-
write: (row: SettingRow, value: SettingValue) => void,
|
|
88
|
-
only?: (row: SettingRow) => boolean,
|
|
89
|
-
): void;
|
|
1
|
+
/** A colour value: linear RGB. */
|
|
2
|
+
export type SettingColor = readonly [number, number, number];
|
|
3
|
+
/** One gradient stop: a colour at a position (`elevation` unless the row's `stopKey` says otherwise). */
|
|
4
|
+
export type SettingStop = { readonly color: SettingColor };
|
|
5
|
+
/** One value of a setting: a number, a colour, a choice, gradient stops, or null where `nullable`. */
|
|
6
|
+
export type SettingValue = number | SettingColor | string | readonly SettingStop[] | null;
|
|
7
|
+
/** Values by setting name; a name left out takes its default. */
|
|
8
|
+
export type SettingValues = Readonly<Record<string, SettingValue>>;
|
|
9
|
+
/** One slider row, the shape every package's `/settings` entry shares. */
|
|
10
|
+
export interface SettingRow {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly group: string;
|
|
13
|
+
/** `number` is a slider, `color` three sliders or a picker, `choice` a list, `gradient` a stop editor. */
|
|
14
|
+
readonly kind: 'number' | 'color' | 'choice' | 'gradient';
|
|
15
|
+
/** The value with which the target draws exactly as it does without the option (null: follow the weather). */
|
|
16
|
+
readonly default: SettingValue;
|
|
17
|
+
readonly min?: number;
|
|
18
|
+
readonly max?: number;
|
|
19
|
+
readonly step?: number;
|
|
20
|
+
readonly choices?: readonly string[];
|
|
21
|
+
/** May be null: the target uses its own value, or follows the weather when `weather` is set. */
|
|
22
|
+
readonly nullable?: boolean;
|
|
23
|
+
/** The weather master slider that drives this row while it is null. */
|
|
24
|
+
readonly weather?: string;
|
|
25
|
+
/** The key a gradient stop is placed by (default `elevation`). */
|
|
26
|
+
readonly stopKey?: string;
|
|
27
|
+
readonly unit: string;
|
|
28
|
+
readonly about: string;
|
|
29
|
+
/** True: cheap to write every frame (no pipeline, buffer or texture is created), so it can be keyed over a shot. False: writing it rebuilds something. */
|
|
30
|
+
readonly live: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const numberSetting: (
|
|
33
|
+
name: string,
|
|
34
|
+
group: string,
|
|
35
|
+
value: number,
|
|
36
|
+
min: number,
|
|
37
|
+
max: number,
|
|
38
|
+
step: number,
|
|
39
|
+
unit: string,
|
|
40
|
+
about: string,
|
|
41
|
+
live?: boolean,
|
|
42
|
+
) => SettingRow;
|
|
43
|
+
export declare const colorSetting: (
|
|
44
|
+
name: string,
|
|
45
|
+
group: string,
|
|
46
|
+
value: SettingColor,
|
|
47
|
+
min: number,
|
|
48
|
+
max: number,
|
|
49
|
+
about: string,
|
|
50
|
+
live?: boolean,
|
|
51
|
+
) => SettingRow;
|
|
52
|
+
export declare const choiceSetting: (
|
|
53
|
+
name: string,
|
|
54
|
+
group: string,
|
|
55
|
+
choices: readonly string[],
|
|
56
|
+
about: string,
|
|
57
|
+
live?: boolean,
|
|
58
|
+
) => SettingRow;
|
|
59
|
+
/** The row with a null default that follows the weather master slider `weather` until a value is given. */
|
|
60
|
+
export declare const followsWeather: (row: SettingRow, weather: string) => SettingRow;
|
|
61
|
+
/** Marks `key` of `target` as set by hand (`held` true) or hands it back to the weather (false). */
|
|
62
|
+
export declare function holdFromWeather(target: object, key: string, held?: boolean): void;
|
|
63
|
+
/** True while `key` of `target` holds a value set by hand, which the weather drive leaves alone. */
|
|
64
|
+
export declare const heldFromWeather: (target: object, key: string) => boolean;
|
|
65
|
+
export declare const sameSettingValue: (a: unknown, b: unknown) => boolean;
|
|
66
|
+
export declare function copySettingValue(v: SettingValue): SettingValue;
|
|
67
|
+
/** A fresh object holding every row at its default (a slider panel's state). */
|
|
68
|
+
export declare function settingDefaults(rows: readonly SettingRow[]): Record<string, SettingValue>;
|
|
69
|
+
/** The rows that may change every frame without a rebuild. */
|
|
70
|
+
export declare const liveSettings: (rows: readonly SettingRow[]) => SettingRow[];
|
|
71
|
+
/** A name to row map. */
|
|
72
|
+
export declare const settingIndex: (rows: readonly SettingRow[]) => Map<string, SettingRow>;
|
|
73
|
+
/** @throws RangeError when `v` is not a value of `row`. */
|
|
74
|
+
export declare function checkSettingValue(row: SettingRow, v: unknown, label: string): void;
|
|
75
|
+
/** @throws TypeError for an unknown name; RangeError for a bad value or a null on a row that is not nullable. */
|
|
76
|
+
export declare function checkSettings(
|
|
77
|
+
rows: readonly SettingRow[] | ReadonlyMap<string, SettingRow>,
|
|
78
|
+
values: SettingValues,
|
|
79
|
+
label: string,
|
|
80
|
+
entry?: string,
|
|
81
|
+
): void;
|
|
82
|
+
/** Checks `values`, then calls `write` once per row (or per row `only` accepts) with the given value or the default. */
|
|
83
|
+
export declare function applySettings(
|
|
84
|
+
rows: readonly SettingRow[],
|
|
85
|
+
values: SettingValues,
|
|
86
|
+
label: string,
|
|
87
|
+
write: (row: SettingRow, value: SettingValue) => void,
|
|
88
|
+
only?: (row: SettingRow) => boolean,
|
|
89
|
+
): void;
|
package/package.json
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@margoengine/horses",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Horses built in code from published equine measurements: draft, cavalry and riding builds, coats and markings, a mane and tail in strand hair, a 37-joint rig, walk, trot, canter and gallop from equine biomechanics, a rider seat, and crowds of hundreds in one draw.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"margoengine",
|
|
7
|
-
"webgpu",
|
|
8
|
-
"3d",
|
|
9
|
-
"horses",
|
|
10
|
-
"gaits",
|
|
11
|
-
"cavalry",
|
|
12
|
-
"animals"
|
|
13
|
-
],
|
|
14
|
-
"homepage": "https://margoengine.com",
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/scottcampbelldata/margoengine/issues"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/scottcampbelldata/margoengine.git",
|
|
21
|
-
"directory": "packages/horses"
|
|
22
|
-
},
|
|
23
|
-
"license": "Apache-2.0",
|
|
24
|
-
"author": "Scott Campbell",
|
|
25
|
-
"type": "module",
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "node ../../scripts/build-optional.js horses",
|
|
31
|
-
"test": "npm run build && node --test test/*.test.js",
|
|
32
|
-
"prepack": "npm --prefix ../.. run build:packages",
|
|
33
|
-
"test:gpu:strands": "cd ../.. && node packages/horses/test/strand-horse.browser.mjs",
|
|
34
|
-
"test:gpu": "cd ../.. && node packages/horses/test/horses-check.mjs"
|
|
35
|
-
},
|
|
36
|
-
"sideEffects": false,
|
|
37
|
-
"exports": {
|
|
38
|
-
".": {
|
|
39
|
-
"types": "./dist/index.d.ts",
|
|
40
|
-
"import": "./dist/index.js"
|
|
41
|
-
},
|
|
42
|
-
"./anatomy": {
|
|
43
|
-
"types": "./dist/anatomy.d.ts",
|
|
44
|
-
"import": "./dist/anatomy.js"
|
|
45
|
-
},
|
|
46
|
-
"./gaits": {
|
|
47
|
-
"types": "./dist/gaits.d.ts",
|
|
48
|
-
"import": "./dist/gaits.js"
|
|
49
|
-
},
|
|
50
|
-
"./model": {
|
|
51
|
-
"types": "./dist/model.d.ts",
|
|
52
|
-
"import": "./dist/model.js"
|
|
53
|
-
},
|
|
54
|
-
"./seat": {
|
|
55
|
-
"types": "./dist/seat.d.ts",
|
|
56
|
-
"import": "./dist/seat.js"
|
|
57
|
-
},
|
|
58
|
-
"./crowd": {
|
|
59
|
-
"types": "./dist/crowd.d.ts",
|
|
60
|
-
"import": "./dist/crowd.js"
|
|
61
|
-
},
|
|
62
|
-
"./settings": {
|
|
63
|
-
"types": "./dist/settings.d.ts",
|
|
64
|
-
"import": "./dist/settings.js"
|
|
65
|
-
},
|
|
66
|
-
"./strands": {
|
|
67
|
-
"types": "./dist/strands.d.ts",
|
|
68
|
-
"import": "./dist/strands.js"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"files": [
|
|
72
|
-
"dist",
|
|
73
|
-
"LICENSE",
|
|
74
|
-
"NOTICE"
|
|
75
|
-
],
|
|
76
|
-
"peerDependencies": {
|
|
77
|
-
"@margoengine/core": "^
|
|
78
|
-
"@margoengine/gltf": "^
|
|
79
|
-
},
|
|
80
|
-
"dependencies": {
|
|
81
|
-
"@margoengine/animation": "^
|
|
82
|
-
"@margoengine/math": "^
|
|
83
|
-
"@margoengine/materials": "^
|
|
84
|
-
"@margoengine/physics": "^
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@margoengine/horses",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Horses built in code from published equine measurements: draft, cavalry and riding builds, coats and markings, a mane and tail in strand hair, a 37-joint rig, walk, trot, canter and gallop from equine biomechanics, a rider seat, and crowds of hundreds in one draw.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"margoengine",
|
|
7
|
+
"webgpu",
|
|
8
|
+
"3d",
|
|
9
|
+
"horses",
|
|
10
|
+
"gaits",
|
|
11
|
+
"cavalry",
|
|
12
|
+
"animals"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://margoengine.com",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/scottcampbelldata/margoengine/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/scottcampbelldata/margoengine.git",
|
|
21
|
+
"directory": "packages/horses"
|
|
22
|
+
},
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"author": "Scott Campbell",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "node ../../scripts/build-optional.js horses",
|
|
31
|
+
"test": "npm run build && node --test test/*.test.js",
|
|
32
|
+
"prepack": "npm --prefix ../.. run build:packages",
|
|
33
|
+
"test:gpu:strands": "cd ../.. && node packages/horses/test/strand-horse.browser.mjs",
|
|
34
|
+
"test:gpu": "cd ../.. && node packages/horses/test/horses-check.mjs"
|
|
35
|
+
},
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./anatomy": {
|
|
43
|
+
"types": "./dist/anatomy.d.ts",
|
|
44
|
+
"import": "./dist/anatomy.js"
|
|
45
|
+
},
|
|
46
|
+
"./gaits": {
|
|
47
|
+
"types": "./dist/gaits.d.ts",
|
|
48
|
+
"import": "./dist/gaits.js"
|
|
49
|
+
},
|
|
50
|
+
"./model": {
|
|
51
|
+
"types": "./dist/model.d.ts",
|
|
52
|
+
"import": "./dist/model.js"
|
|
53
|
+
},
|
|
54
|
+
"./seat": {
|
|
55
|
+
"types": "./dist/seat.d.ts",
|
|
56
|
+
"import": "./dist/seat.js"
|
|
57
|
+
},
|
|
58
|
+
"./crowd": {
|
|
59
|
+
"types": "./dist/crowd.d.ts",
|
|
60
|
+
"import": "./dist/crowd.js"
|
|
61
|
+
},
|
|
62
|
+
"./settings": {
|
|
63
|
+
"types": "./dist/settings.d.ts",
|
|
64
|
+
"import": "./dist/settings.js"
|
|
65
|
+
},
|
|
66
|
+
"./strands": {
|
|
67
|
+
"types": "./dist/strands.d.ts",
|
|
68
|
+
"import": "./dist/strands.js"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"files": [
|
|
72
|
+
"dist",
|
|
73
|
+
"LICENSE",
|
|
74
|
+
"NOTICE"
|
|
75
|
+
],
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"@margoengine/core": "^1.0.0",
|
|
78
|
+
"@margoengine/gltf": "^1.0.0"
|
|
79
|
+
},
|
|
80
|
+
"dependencies": {
|
|
81
|
+
"@margoengine/animation": "^1.0.0",
|
|
82
|
+
"@margoengine/math": "^1.0.0",
|
|
83
|
+
"@margoengine/materials": "^1.0.0",
|
|
84
|
+
"@margoengine/physics": "^1.0.0"
|
|
85
|
+
}
|
|
86
|
+
}
|