@doki-land/live2d 0.0.20 → 0.0.22
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/README.md +11 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -116,7 +116,7 @@ Parameter availability and ranges belong to the loaded model. Do not assume ever
|
|
|
116
116
|
|
|
117
117
|
## 🖱️ Hit Testing
|
|
118
118
|
|
|
119
|
-
`hitTest(x, y)` expects normalized model coordinates
|
|
119
|
+
`hitTest(x, y)` expects **normalized model coordinates** (approximately `-1..1` on both axes). The single-actor facade returns a string area id; Stage APIs return structured `ActorHit`.
|
|
120
120
|
|
|
121
121
|
```ts
|
|
122
122
|
const area = runtime.hitTest(modelX, modelY);
|
|
@@ -126,8 +126,16 @@ if (area) {
|
|
|
126
126
|
}
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
Current
|
|
130
|
-
|
|
129
|
+
### Current contract (`drawable:N` fallback)
|
|
130
|
+
|
|
131
|
+
1. The runtime finds the front-most visible drawable triangle under the point.
|
|
132
|
+
2. It then looks up `model.settings.hitAreas` for an entry whose `id` is exactly `D_{drawableIndex}` or `"{drawableIndex}"`.
|
|
133
|
+
3. If that lookup succeeds, the returned string is the HitArea **name** (e.g. `Head`).
|
|
134
|
+
4. Otherwise the string is **`drawable:{index}`** (example: `drawable:12`).
|
|
135
|
+
|
|
136
|
+
Many Cubism sample settings use ids such as `HitArea` / `HitArea2` that **do not** match step 2, so dogfood models usually surface `drawable:N`. That is expected until a named HitArea mapping lands (planned after v0.0.21). Do not treat `drawable:N` as a stable product name for UI chrome.
|
|
137
|
+
|
|
138
|
+
Stage `hitTest` / `hitTestAll` populate `ActorHit.area` with the same string; `drawableIndex` is set when `area` matches `/^drawable:(\d+)$/`.
|
|
131
139
|
|
|
132
140
|
## 📊 Frame Profiling
|
|
133
141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doki-land/live2d",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Live2D in the browser — load moc2/moc3 models, Stage + multi-actor, motion; WebGPU/WebGL2/Canvas2D. Main entry for live2d.ts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"test": "vitest run --passWithNoTests"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@doki-land/live2d-core": "0.0.
|
|
63
|
-
"@doki-land/live2d-loader": "0.0.
|
|
64
|
-
"@doki-land/live2d-renderer": "0.0.
|
|
62
|
+
"@doki-land/live2d-core": "0.0.22",
|
|
63
|
+
"@doki-land/live2d-loader": "0.0.22",
|
|
64
|
+
"@doki-land/live2d-renderer": "0.0.22"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": false
|
|
67
67
|
}
|