@margoengine/cinematic 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 +321 -321
- package/dist/brain.js +4 -4
- package/dist/index.js +4 -4
- package/package.json +91 -91
package/dist/brain.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
const t=(engine,version="
|
|
3
|
+
const t=(engine,version="1.0.0",source=import.meta.url)=>__margoRuntime(engine,version,source);
|
|
4
4
|
import { MargoError as e } from "@margoengine/math/errors";
|
|
5
5
|
import { engineRuntime as __margoRuntime } from "@margoengine/core/extension";
|
|
6
6
|
//#region src/brain.ts
|
|
@@ -104,7 +104,7 @@ function g(e, t, n, r) {
|
|
|
104
104
|
for (let r = 0; r < 3; r++) i ? (e.target[r] += (t.target[r] - e.target[r]) * n, e.position[r] = e.target[r] + m[r]) : (e.position[r] += (t.position[r] - e.position[r]) * n, e.target[r] = e.position[r] + m[r]);
|
|
105
105
|
e.fov += (t.fov - e.fov) * n, e.orthographicHeight !== void 0 && t.orthographicHeight !== void 0 && (e.orthographicHeight += (t.orthographicHeight - e.orthographicHeight) * n), e.roll += (t.roll - e.roll) * n, e.focusDistance ? t.focusDistance && (e.focusDistance += (t.focusDistance - e.focusDistance) * n) : e.focusDistance = t.focusDistance;
|
|
106
106
|
}
|
|
107
|
-
var _ = class n {coreRequirement=__margoCoreRequirement("
|
|
107
|
+
var _ = class n {coreRequirement=__margoCoreRequirement("1.0.0",import.meta.url);
|
|
108
108
|
constructor(e = {}) {
|
|
109
109
|
this.options = e, this.pose = c(), this.stages = [], this.cameras = [], this.listeners = {
|
|
110
110
|
change: /* @__PURE__ */ new Set(),
|
|
@@ -129,7 +129,7 @@ var _ = class n {coreRequirement=__margoCoreRequirement("0.1.0",import.meta.url)
|
|
|
129
129
|
for (let t of e.rules ?? []) if (s(t), typeof t.from != "string" || typeof t.to != "string") throw RangeError("Invalid camera blend rule; pass from and to as camera names or '*'");
|
|
130
130
|
e.aspect !== void 0 && a(e.aspect);
|
|
131
131
|
}
|
|
132
|
-
static attach(e, r = {}) {__margoAssertCore(e,__margoCoreRequirement("
|
|
132
|
+
static attach(e, r = {}) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
|
|
133
133
|
let i = new n(r);
|
|
134
134
|
return t(e).use(i), i;
|
|
135
135
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
-
const t=(engine,version="
|
|
3
|
+
const t=(engine,version="1.0.0",source=import.meta.url)=>__margoRuntime(engine,version,source);
|
|
4
4
|
import { MargoError as e } from "@margoengine/math/errors";
|
|
5
5
|
import { engineRuntime as __margoRuntime, meshRuntime as n } from "@margoengine/core/extension";
|
|
6
6
|
//#region src/index.ts
|
|
7
7
|
var r = (e) => {
|
|
8
8
|
if (e.length !== 3) throw TypeError("Expected 3D target");
|
|
9
9
|
for (let t = 0; t < 3; t++) if (!Number.isFinite(e[t])) throw RangeError("Target must be finite");
|
|
10
|
-
}, i = class i {coreRequirement=__margoCoreRequirement("
|
|
10
|
+
}, i = class i {coreRequirement=__margoCoreRequirement("1.0.0",import.meta.url);
|
|
11
11
|
constructor(e = {}) {
|
|
12
12
|
this.options = e, this.name = "cinematic", this.position = /* @__PURE__ */ new Float64Array(3), this.lookAt = /* @__PURE__ */ new Float64Array(3), this.velocity = /* @__PURE__ */ new Float64Array(6), this.target = /* @__PURE__ */ new Float64Array(3), this.cameraPosition = /* @__PURE__ */ new Float32Array(3), this.cameraTarget = /* @__PURE__ */ new Float32Array(3), this.armDirection = /* @__PURE__ */ new Float64Array(3), this.reach = Infinity, this.amplitude = 0, this.remaining = 0, this.shakeDuration = 1, this.frequency = 25, this.elapsed = 0, this.initialized = !1;
|
|
13
13
|
let t = e.offset ?? [
|
|
@@ -19,7 +19,7 @@ var r = (e) => {
|
|
|
19
19
|
if (!Math.hypot(t[0], t[1], t[2])) throw RangeError("Camera offset cannot be zero; pass a non-zero offset such as [0, 2, 6]");
|
|
20
20
|
this.validateGround(), this.offset = new Float64Array(t);
|
|
21
21
|
}
|
|
22
|
-
static attach(e, n = {}) {__margoAssertCore(e,__margoCoreRequirement("
|
|
22
|
+
static attach(e, n = {}) {__margoAssertCore(e,__margoCoreRequirement("1.0.0",import.meta.url));
|
|
23
23
|
let r = new i(n);
|
|
24
24
|
return t(e).use(r), r;
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@margoengine/cinematic",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Virtual cameras with priorities and blends, framing, dolly tracks, group framing, camera noise, confiners and focus tracking, on top of damped follow, look-at and shake.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"margoengine",
|
|
7
|
-
"webgpu",
|
|
8
|
-
"3d",
|
|
9
|
-
"cinematic"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://margoengine.com",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/scottcampbelldata/margoengine/issues"
|
|
14
|
-
},
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/scottcampbelldata/margoengine.git",
|
|
18
|
-
"directory": "packages/cinematic"
|
|
19
|
-
},
|
|
20
|
-
"license": "Apache-2.0",
|
|
21
|
-
"author": "Scott Campbell",
|
|
22
|
-
"type": "module",
|
|
23
|
-
"sideEffects": false,
|
|
24
|
-
"exports": {
|
|
25
|
-
".": {
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"import": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./brain": {
|
|
30
|
-
"types": "./dist/brain.d.ts",
|
|
31
|
-
"import": "./dist/brain.js"
|
|
32
|
-
},
|
|
33
|
-
"./composer": {
|
|
34
|
-
"types": "./dist/composer.d.ts",
|
|
35
|
-
"import": "./dist/composer.js"
|
|
36
|
-
},
|
|
37
|
-
"./dolly": {
|
|
38
|
-
"types": "./dist/dolly.d.ts",
|
|
39
|
-
"import": "./dist/dolly.js"
|
|
40
|
-
},
|
|
41
|
-
"./group": {
|
|
42
|
-
"types": "./dist/group.d.ts",
|
|
43
|
-
"import": "./dist/group.js"
|
|
44
|
-
},
|
|
45
|
-
"./noise": {
|
|
46
|
-
"types": "./dist/noise.d.ts",
|
|
47
|
-
"import": "./dist/noise.js"
|
|
48
|
-
},
|
|
49
|
-
"./confine": {
|
|
50
|
-
"types": "./dist/confine.d.ts",
|
|
51
|
-
"import": "./dist/confine.js"
|
|
52
|
-
},
|
|
53
|
-
"./lens": {
|
|
54
|
-
"types": "./dist/lens.d.ts",
|
|
55
|
-
"import": "./dist/lens.js"
|
|
56
|
-
},
|
|
57
|
-
"./physical-lens": {
|
|
58
|
-
"types": "./dist/physical-lens.d.ts",
|
|
59
|
-
"import": "./dist/physical-lens.js"
|
|
60
|
-
},
|
|
61
|
-
"./ortho": {
|
|
62
|
-
"types": "./dist/ortho.d.ts",
|
|
63
|
-
"import": "./dist/ortho.js"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"files": [
|
|
67
|
-
"dist",
|
|
68
|
-
"LICENSE",
|
|
69
|
-
"NOTICE"
|
|
70
|
-
],
|
|
71
|
-
"publishConfig": {
|
|
72
|
-
"access": "public"
|
|
73
|
-
},
|
|
74
|
-
"peerDependencies": {
|
|
75
|
-
"@margoengine/core": "^
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"@margoengine/math": "^
|
|
79
|
-
"@margoengine/splines": "^
|
|
80
|
-
},
|
|
81
|
-
"scripts": {
|
|
82
|
-
"build": "node ../../scripts/build-optional.js cinematic",
|
|
83
|
-
"test": "npm run build && node --test test/*.test.js",
|
|
84
|
-
"prepack": "npm run build",
|
|
85
|
-
"test:gpu": "cd ../.. && node packages/cinematic/test/browser-check.mjs && node packages/cinematic/test/physical-lens-browser.mjs && node packages/cinematic/test/ortho-browser.mjs"
|
|
86
|
-
},
|
|
87
|
-
"devDependencies": {
|
|
88
|
-
"@margoengine/cameras": "^
|
|
89
|
-
"@margoengine/dof": "^
|
|
90
|
-
}
|
|
91
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@margoengine/cinematic",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Virtual cameras with priorities and blends, framing, dolly tracks, group framing, camera noise, confiners and focus tracking, on top of damped follow, look-at and shake.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"margoengine",
|
|
7
|
+
"webgpu",
|
|
8
|
+
"3d",
|
|
9
|
+
"cinematic"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://margoengine.com",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/scottcampbelldata/margoengine/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/scottcampbelldata/margoengine.git",
|
|
18
|
+
"directory": "packages/cinematic"
|
|
19
|
+
},
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"author": "Scott Campbell",
|
|
22
|
+
"type": "module",
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./brain": {
|
|
30
|
+
"types": "./dist/brain.d.ts",
|
|
31
|
+
"import": "./dist/brain.js"
|
|
32
|
+
},
|
|
33
|
+
"./composer": {
|
|
34
|
+
"types": "./dist/composer.d.ts",
|
|
35
|
+
"import": "./dist/composer.js"
|
|
36
|
+
},
|
|
37
|
+
"./dolly": {
|
|
38
|
+
"types": "./dist/dolly.d.ts",
|
|
39
|
+
"import": "./dist/dolly.js"
|
|
40
|
+
},
|
|
41
|
+
"./group": {
|
|
42
|
+
"types": "./dist/group.d.ts",
|
|
43
|
+
"import": "./dist/group.js"
|
|
44
|
+
},
|
|
45
|
+
"./noise": {
|
|
46
|
+
"types": "./dist/noise.d.ts",
|
|
47
|
+
"import": "./dist/noise.js"
|
|
48
|
+
},
|
|
49
|
+
"./confine": {
|
|
50
|
+
"types": "./dist/confine.d.ts",
|
|
51
|
+
"import": "./dist/confine.js"
|
|
52
|
+
},
|
|
53
|
+
"./lens": {
|
|
54
|
+
"types": "./dist/lens.d.ts",
|
|
55
|
+
"import": "./dist/lens.js"
|
|
56
|
+
},
|
|
57
|
+
"./physical-lens": {
|
|
58
|
+
"types": "./dist/physical-lens.d.ts",
|
|
59
|
+
"import": "./dist/physical-lens.js"
|
|
60
|
+
},
|
|
61
|
+
"./ortho": {
|
|
62
|
+
"types": "./dist/ortho.d.ts",
|
|
63
|
+
"import": "./dist/ortho.js"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"files": [
|
|
67
|
+
"dist",
|
|
68
|
+
"LICENSE",
|
|
69
|
+
"NOTICE"
|
|
70
|
+
],
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@margoengine/core": "^1.0.0"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@margoengine/math": "^1.0.0",
|
|
79
|
+
"@margoengine/splines": "^1.0.0"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "node ../../scripts/build-optional.js cinematic",
|
|
83
|
+
"test": "npm run build && node --test test/*.test.js",
|
|
84
|
+
"prepack": "npm run build",
|
|
85
|
+
"test:gpu": "cd ../.. && node packages/cinematic/test/browser-check.mjs && node packages/cinematic/test/physical-lens-browser.mjs && node packages/cinematic/test/ortho-browser.mjs"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@margoengine/cameras": "^1.0.0",
|
|
89
|
+
"@margoengine/dof": "^1.0.0"
|
|
90
|
+
}
|
|
91
|
+
}
|