aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bluebey-studio/src/face.js
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-05 21:46:21 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-05 21:46:21 +0900
commit7329ba8c8901ee095ad7316b8554c5e44431eebc (patch)
tree471d3994df66e38a3bd12b38d2899193985c9f2f /public/bluebey-studio/src/face.js
parent27220fe6aa19f8e63be3984be1bc3288002252f7 (diff)
bluebey-studio: 縦書きのセリフとナレーション枠、コック帽改善、小物に鉛筆とコップなど
セリフを縦書き可能にし、縦書きのナレーションボックスを追加。ハートでも下まぶたを閉じられるようにし、ふつうの目の瞳を少し鼻側へ。HairPlateは髪が無いとき非表示(iPhoneの色ずれ対策)。コック帽をトック帽に、鉛筆とコップを小物に追加。
Diffstat (limited to 'public/bluebey-studio/src/face.js')
-rw-r--r--public/bluebey-studio/src/face.js35
1 files changed, 22 insertions, 13 deletions
diff --git a/public/bluebey-studio/src/face.js b/public/bluebey-studio/src/face.js
index ac48527..3d21022 100644
--- a/public/bluebey-studio/src/face.js
+++ b/public/bluebey-studio/src/face.js
@@ -278,19 +278,28 @@ export class Face {
}
if (this.hairMesh) {
- // `overEyes` decides the draw order: the hair plate sits in front of the
- // eyes (bangs over the face) or behind them.
- this.hairMesh.renderOrder = p.eyes.headMark?.overEyes === false ? 0 : 3;
- const layout = this.hairLayout;
- const ctx = this.hairCtx;
- ctx.setTransform(1, 0, 0, 1, 0, 0);
- ctx.clearRect(0, 0, layout.width * HAIR_SCALE, layout.height * HAIR_SCALE);
- ctx.scale(HAIR_SCALE, HAIR_SCALE);
- // `drawHeadCoverWrap` works in canvas coordinates (its x axis is the UV
- // angle already normalised), so it is not shifted by the window offset.
- drawHeadCoverWrap(ctx, p.eyes.headMark ?? {}, layout);
- ctx.setTransform(1, 0, 0, 1, 0, 0);
- this.hairTexture.needsUpdate = true;
+ const hairShape = p.eyes.headMark?.shape ?? 'off';
+ // Shapes that draw nothing (the retired front-plate ones, or なし). A fully
+ // transparent texture still tinted the head on iOS, so the plate is hidden
+ // outright when there is no hair rather than left showing an empty texture.
+ const hairShown = !(hairShape === 'off' || hairShape === 'none'
+ || hairShape === 'split' || hairShape === 'wave' || hairShape === 'side');
+ this.hairMesh.visible = hairShown;
+ if (hairShown) {
+ // `overEyes` decides the draw order: the hair plate sits in front of the
+ // eyes (bangs over the face) or behind them.
+ this.hairMesh.renderOrder = p.eyes.headMark?.overEyes === false ? 0 : 3;
+ const layout = this.hairLayout;
+ const ctx = this.hairCtx;
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
+ ctx.clearRect(0, 0, layout.width * HAIR_SCALE, layout.height * HAIR_SCALE);
+ ctx.scale(HAIR_SCALE, HAIR_SCALE);
+ // `drawHeadCoverWrap` works in canvas coordinates (its x axis is the UV
+ // angle already normalised), so it is not shifted by the window offset.
+ drawHeadCoverWrap(ctx, p.eyes.headMark ?? {}, layout);
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
+ this.hairTexture.needsUpdate = true;
+ }
}
this.dirty = false;