@hackbuild/avatar-host 0.1.4 → 0.1.5

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.
@@ -146,7 +146,7 @@ var HackbuildAvatarHost = (function(exports, three) {
146
146
  for (const k of ORDER) if (model = files.find((f) => kindOf(f.name) === k)) break;
147
147
  if (!model) {
148
148
  const ext = files.map((f) => extOf(f.name)).find((e) => e === "pmx" || e === "pmd" || e === "vrma" || e === "bvh");
149
- if (ext === "pmx" || ext === "pmd") throw new Error(`this file is a ${ext}. convert it to vrm or glb.`);
149
+ if (ext === "pmx" || ext === "pmd") throw new Error(`this file is a ${ext}. open it with the mmd loader of the avatar package.`);
150
150
  if (ext) throw new Error(`a ${ext} file is an animation. drop a body: a .vrm, .glb, .gltf or .fbx.`);
151
151
  throw new Error("this drop has no model. drop a .vrm, .glb, .gltf or .fbx file.");
152
152
  }
package/dist/portrait.js CHANGED
@@ -19,7 +19,6 @@ const MARGIN = 1.06;
19
19
  export const SAMPLES = 24;
20
20
  /** Bones that judge a frame; fingers would outvote them by count. */
21
21
  export const MEASURED = ["spine", "chest", "neck", "head", "leftShoulder", "leftUpperArm", "leftLowerArm", "rightShoulder", "rightUpperArm", "rightLowerArm", "leftUpperLeg", "leftLowerLeg", "rightUpperLeg", "rightLowerLeg"];
22
- const v = new Vector3();
23
22
  /** One renderer, scene, lights and camera, and the framing both portraits share. */
24
23
  class Shot {
25
24
  canvas;
@@ -57,6 +56,7 @@ class Shot {
57
56
  }
58
57
  /** Points an orthographic camera at `box` from the portrait angle and fits it, `aspect` width over height. */
59
58
  export function frameBox(cam, box, aspect = 1) {
59
+ const v = new Vector3();
60
60
  const center = box.getCenter(new Vector3());
61
61
  const reach = Math.max(1e-3, box.getSize(v).length() * 2);
62
62
  const dir = new Vector3(Math.sin(YAW) * Math.cos(PITCH), Math.sin(PITCH), Math.cos(YAW) * Math.cos(PITCH));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackbuild/avatar-host",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Host a character on a three.js stage in any container: ticketed loads through @hackbuild/avatar, a follow camera, the presence frame order, a loop that pauses when hidden, and a hb-avatar-host element.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "build": "node ../../tools/build-package.mjs avatar-host"
42
42
  },
43
43
  "dependencies": {
44
- "@hackbuild/avatar": "0.1.2",
44
+ "@hackbuild/avatar": "0.1.3",
45
45
  "@hackbuild/environment": "0.1.1",
46
46
  "@hackbuild/lipsync": "0.1.1",
47
47
  "@hackbuild/organic": "0.1.1",