pelican-engine 0.3.26 → 0.3.28
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/AGENTS.md +2 -0
- package/distribution.json +11 -11
- package/docs/STATUS.md +18 -28
- package/docs/api/REFERENCE.md +2 -2
- package/docs/api/index.json +2 -2
- package/docs/npm/GAME-AUTHOR.md +2 -0
- package/engine.manifest.json +1 -1
- package/lib/sdk/index.d.ts +1 -1
- package/lib/sdk/index.js +1 -1
- package/lib/simulation/cloth.js +15 -5
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -240,6 +240,8 @@ not mass-coupled with cloth velocity. The body receives no reaction when the
|
|
|
240
240
|
option is omitted. Destroyed bodies are removed on the next automatic step.
|
|
241
241
|
This is not complete cloth-rigid-body coupling.
|
|
242
242
|
|
|
243
|
+
Sampled planes use the triangle centroid for discrete surface projection; this is not continuous triangle-plane collision.
|
|
244
|
+
|
|
243
245
|
New cloth also resolves detected sphere overlaps against triangle surface interiors
|
|
244
246
|
using closest-point barycentric projection. `inspect(id).surfaceContacts` reports
|
|
245
247
|
the triangle and barycentric position. `surfaceCollisions` defaults to true for new
|
package/distribution.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "pelican.npm-distribution",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"files": {
|
|
5
|
-
"AGENTS.md": "
|
|
5
|
+
"AGENTS.md": "ea6e8d183ab104bfa3569ad56d3d86fce3503f14dcb94782ab7656ecc4f9c0cd",
|
|
6
6
|
"CONTRIBUTING.md": "0ffad5d841d90f319fc50a75b81d3c0ad6dab8d5d9bec2846c65c7f8358d5a50",
|
|
7
7
|
"docs/AI-WORKFLOW.md": "aa992686df93f791795f6f3fce01713d812eea6a1b9556f07411ac5847278efa",
|
|
8
|
-
"docs/api/index.json": "
|
|
9
|
-
"docs/api/REFERENCE.md": "
|
|
8
|
+
"docs/api/index.json": "8c53f123d2ac1cb92d38be69d423d6b5b8dea6896ebfdbbd3ad210a6c8a33518",
|
|
9
|
+
"docs/api/REFERENCE.md": "ac2dd4b76aae621a1c1d55e8861d13b2cb106e8239baaf7ed4b04cbb44ddb727",
|
|
10
10
|
"docs/ARCHITECTURE.md": "3184b73592d466390e7793b1cf39bbb80d6052b523fba7e7cb377b5207074627",
|
|
11
11
|
"docs/assets/pelican-mark.svg": "407b10cd7e292ea83cf5dba4046fb2f01c7d566a14014c55deda3a2984562b4d",
|
|
12
12
|
"docs/CAPABILITIES.md": "92950817497d8c63db07830db96dc93c877befa8d038320feed1ae1f1a053cb1",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"docs/GETTING-STARTED.md": "5519ebe4e513e8ae4517c04948ee9dc70bcb1e3d04a65d468a6537c838502663",
|
|
15
15
|
"docs/GRAPHICS-GUIDE.md": "e3d0f7df6189ca3f88d81af5ffaf393f5d6bf39b9e66167bb2f64b39194b514c",
|
|
16
16
|
"docs/npm/DISTRIBUTION.md": "ff25e039921a85ba253c27608c77ed614a036117d7a04f908a78d1e3ed3f19ef",
|
|
17
|
-
"docs/npm/GAME-AUTHOR.md": "
|
|
17
|
+
"docs/npm/GAME-AUTHOR.md": "ea6e8d183ab104bfa3569ad56d3d86fce3503f14dcb94782ab7656ecc4f9c0cd",
|
|
18
18
|
"docs/PELICAN-MIGRATION.md": "c5d6ab8e5186f4d36720a0a01d1a7e4157a5d386c5400e2db99571a7d10a1e49",
|
|
19
19
|
"docs/PHYSICS-LIFECYCLE-ISSUE.md": "cc78917462de4e7e9b68e77c742192ce213b4be5b516d2ba943251fff46977ac",
|
|
20
20
|
"docs/RENDER-BACKENDS.md": "d981ea94742a835d028db37d536fb7fba05102e37bc6274a37baf74f5034b954",
|
|
21
21
|
"docs/ROADMAP.md": "29ac1c54f36064e23c17cfe7f549d6860889257a57d1227e322958aa9c281568",
|
|
22
|
-
"docs/STATUS.md": "
|
|
22
|
+
"docs/STATUS.md": "b0d40d527f0865171042c46aed02091911a4d8000eb4dcf3d08f64f8a44959a1",
|
|
23
23
|
"docs/THIRD-PARTY-NOTICES.md": "58f9b72e2b4dfaaaf2a4c08b9bde9ecef3d2b7e7d65fccd782ed54f39fa76fdc",
|
|
24
|
-
"engine.manifest.json": "
|
|
24
|
+
"engine.manifest.json": "00d672c85db2dbe0899ba13f00e2bb6d4caf91d5c29683128ad69130ca4a2f35",
|
|
25
25
|
"lib/assets/audio.js": "6facdce4e053afd172af5b9407569b035169844ea17b49f93f8b67f72b78895f",
|
|
26
26
|
"lib/assets/errors.js": "70572678655c6e53179d31920d71f29882d373a0e12d560220bb0fc2cd74f2cc",
|
|
27
27
|
"lib/assets/glb.js": "b808479a36299c154db97f50c16863a3b5a2c61f725e66bf01d01a5f62a288a5",
|
|
@@ -125,10 +125,10 @@
|
|
|
125
125
|
"lib/runtime/world.js": "c43621fbaca8bd2b0d6477a96e60e895312f0f7b1eb97614b6e4f9b716129ea1",
|
|
126
126
|
"lib/schema/index.js": "594429eecb4494c4af2f3d04537be3211f2c9297a1fc555bbba5d028d8627965",
|
|
127
127
|
"lib/sdk/graph-values.js": "a58c00f127cb82aba5fd2824981942844e06d9a59a88a05e35d1d3df2fc7ed2f",
|
|
128
|
-
"lib/sdk/index.d.ts": "
|
|
129
|
-
"lib/sdk/index.js": "
|
|
128
|
+
"lib/sdk/index.d.ts": "c03c050d63aeed5f368cfedc56b3939b2bd059e2d7ce079995a52f1dc1d0b2a0",
|
|
129
|
+
"lib/sdk/index.js": "fbc5ba0ba5f48c17155d58df8128cf247a14844107df2473c466dd66bb121d54",
|
|
130
130
|
"lib/simulation/cloth-plugin.js": "f9e29445b40d2b072c9b7bf61570a52e0785a5f05a58f5cc152ceabd5533a10a",
|
|
131
|
-
"lib/simulation/cloth.js": "
|
|
131
|
+
"lib/simulation/cloth.js": "8914b77ad4af29ca0221edf6a9628f031b560475ee6d183ac915799a0c8347e1",
|
|
132
132
|
"lib/simulation/rope-body-coupling.js": "70694b73d17c79f223803a51fbf4a4dae551b717cd29bbea1fa38386ac98d621",
|
|
133
133
|
"lib/simulation/rope-plugin.js": "08c7c4800053b3e8f255b6dd5be2b532b8e259300666c31de5494d15704717d4",
|
|
134
134
|
"lib/simulation/rope-self-collision.js": "4d8dc5d5a88f0ae0ad5463f553f49b2ad3c8c126b98344a0966f619635bdb17f",
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"licenses/undici-types/LICENSE": "a6db8096b2707bc0102d256917d4d33f298ba36d8c3f25de067a2b5bb379db27",
|
|
204
204
|
"licenses/uniq/LICENSE": "e67aed7df22dc8031e4fcf5338fe91cb33e3817e5c58a99a2a2802eea9069791",
|
|
205
205
|
"licenses/vite/LICENSE.md": "a22152baa1aef74402443008e767e7c689a524c0909d19b0431d97f5ab066a13",
|
|
206
|
-
"package.json": "
|
|
206
|
+
"package.json": "bb7f348ace4b73be1e7e355b00ebb1dd32fc4aa7ff62c59d05422f518841cb5c",
|
|
207
207
|
"README.md": "ff25e039921a85ba253c27608c77ed614a036117d7a04f908a78d1e3ed3f19ef",
|
|
208
208
|
"web/index.html": "d89d6a5b5be3beae3627a8ed506ac308b165d264fb8696be3afd79fcca2f26ee"
|
|
209
209
|
}
|
package/docs/STATUS.md
CHANGED
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ??????
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## ?????
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
5
|
+
- ????? 0.3.28??????????SDK??????????????
|
|
6
|
+
- ??????? GitHub Actions ? npm ?????? latest?GitHub Release ????????????
|
|
7
|
+
- ??????????????????????????GPU???????????
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## ???????
|
|
10
10
|
|
|
11
|
-
- TypeScript SDK
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- 布料、绳索、软体、流体、连续世界、导航、动画、音频和其他首发能力仍需按各自依赖完成,不能把独立候选或局部实现写成整项完成。
|
|
11
|
+
- TypeScript SDK?????????????????? CLI ??????????? pelican-engine ?????
|
|
12
|
+
- ????????????????? WebGL2 ?????????????????????????????????
|
|
13
|
+
- ????????????????????????????????????????????????
|
|
14
|
+
- ?????????????????????????????????????
|
|
15
|
+
- ????????????????????????????????????????????????????????????????
|
|
16
|
+
- ?????????????????????????????????????????????????????????????????????????????????
|
|
17
|
+
- ?????????????????????????????????????????
|
|
19
18
|
|
|
19
|
+
## ????
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
?? main ???????????? Git ???????????.git/worktrees ????????????????????????????????????????????
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
?????????????????????????????????????????????????????API ???????????
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## ????
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
每次工作只积累一个功能、修复或下一版本的相关变更;完成后及时提交并推送,不等待里程碑。推送前同步递增标准版本,以便 npm 使用同一版本发布。历史本机开发报告可由本机 Git 排除配置隐藏,不删除原文件;正式证据和未来新报告不能因此被默认为已提交。
|
|
30
|
-
|
|
31
|
-
下一步优先分析物理生命周期与旧状态兼容的实现边界,再按依赖逐步集成可用功能。保留真实失败、局限和历史来源;不在禁止验证期间声称修复已通过。
|
|
32
|
-
|
|
33
|
-
- ?????????????????????????????
|
|
34
|
-
|
|
35
|
-
- ?????????????????????????????????????????????????
|
|
36
|
-
|
|
37
|
-
- ???????????? `bodyReactions`??????/????????????????????????????????????
|
|
27
|
+
?????????? npm latest ?????????????????????????????
|
package/docs/api/REFERENCE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# pelican 0.3.
|
|
1
|
+
# pelican 0.3.28 API 索引
|
|
2
2
|
|
|
3
3
|
Installed declarations: `lib/sdk/index.d.ts` (relative to the package root).
|
|
4
4
|
The signatures below come from the same public SDK source as repository games.
|
|
@@ -11,7 +11,7 @@ Source-file paths and line numbers are build-time provenance only; TypeScript so
|
|
|
11
11
|
来源:`packages/sdk/src/index.ts:2`
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
SDK_VERSION = "0.3.
|
|
14
|
+
SDK_VERSION = "0.3.28"
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Vec2
|
package/docs/api/index.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "pelican.api-index",
|
|
3
3
|
"version": 1,
|
|
4
|
-
"engineVersion": "0.3.
|
|
4
|
+
"engineVersion": "0.3.28",
|
|
5
5
|
"entry": "pelican-engine",
|
|
6
6
|
"source": "packages/sdk/src/index.ts",
|
|
7
7
|
"symbols": [
|
|
8
8
|
{
|
|
9
9
|
"name": "SDK_VERSION",
|
|
10
10
|
"kind": "constant",
|
|
11
|
-
"signature": "SDK_VERSION = \"0.3.
|
|
11
|
+
"signature": "SDK_VERSION = \"0.3.28\"",
|
|
12
12
|
"line": 2
|
|
13
13
|
},
|
|
14
14
|
{
|
package/docs/npm/GAME-AUTHOR.md
CHANGED
|
@@ -240,6 +240,8 @@ not mass-coupled with cloth velocity. The body receives no reaction when the
|
|
|
240
240
|
option is omitted. Destroyed bodies are removed on the next automatic step.
|
|
241
241
|
This is not complete cloth-rigid-body coupling.
|
|
242
242
|
|
|
243
|
+
Sampled planes use the triangle centroid for discrete surface projection; this is not continuous triangle-plane collision.
|
|
244
|
+
|
|
243
245
|
New cloth also resolves detected sphere overlaps against triangle surface interiors
|
|
244
246
|
using closest-point barycentric projection. `inspect(id).surfaceContacts` reports
|
|
245
247
|
the triangle and barycentric position. `surfaceCollisions` defaults to true for new
|
package/engine.manifest.json
CHANGED
package/lib/sdk/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Pelican Engine public API. No renderer or GPU implementation types escape this module. */
|
|
2
|
-
export declare const SDK_VERSION = "0.3.
|
|
2
|
+
export declare const SDK_VERSION = "0.3.28";
|
|
3
3
|
export type Vec2 = readonly [number, number];
|
|
4
4
|
export type Vec3 = readonly [number, number, number];
|
|
5
5
|
export type Vec4 = readonly [number, number, number, number];
|
package/lib/sdk/index.js
CHANGED
package/lib/simulation/cloth.js
CHANGED
|
@@ -299,12 +299,22 @@ export class ClothSolver {
|
|
|
299
299
|
for (let triangleIndex = 0; triangleIndex < this.config.triangles.length; triangleIndex++) {
|
|
300
300
|
const triangle = this.config.triangles[triangleIndex], a = positions[triangle[0]], b = positions[triangle[1]], c = positions[triangle[2]];
|
|
301
301
|
for (const collider of this.colliders) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
302
|
+
let closest, normal, depth;
|
|
303
|
+
if (collider.kind === "sphere") {
|
|
304
|
+
closest = closestTriangle(collider.center, a, b, c);
|
|
305
|
+
const delta = [closest.point[0] - collider.center[0], closest.point[1] - collider.center[1], closest.point[2] - collider.center[2]], length = Math.hypot(...delta);
|
|
306
|
+
depth = collider.radius + radius - length;
|
|
307
|
+
normal = length < 1e-12 ? [0, 1, 0] : [delta[0] / length, delta[1] / length, delta[2] / length];
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
const centroid = [(a[0] + b[0] + c[0]) / 3, (a[1] + b[1] + c[1]) / 3, (a[2] + b[2] + c[2]) / 3];
|
|
311
|
+
normal = collider.normal;
|
|
312
|
+
depth = collider.offset + radius - (centroid[0] * normal[0] + centroid[1] * normal[1] + centroid[2] * normal[2]);
|
|
313
|
+
closest = { point: centroid, barycentric: [1 / 3, 1 / 3, 1 / 3] };
|
|
314
|
+
}
|
|
305
315
|
if (depth <= 0)
|
|
306
316
|
continue;
|
|
307
|
-
const
|
|
317
|
+
const weights = [this.anchors.has(triangle[0]) ? 0 : closest.barycentric[0], this.anchors.has(triangle[1]) ? 0 : closest.barycentric[1], this.anchors.has(triangle[2]) ? 0 : closest.barycentric[2]], denominator = weights.reduce((sum, value) => sum + value * value, 0);
|
|
308
318
|
if (denominator === 0)
|
|
309
319
|
continue;
|
|
310
320
|
const correction = depth / denominator;
|
|
@@ -430,7 +440,7 @@ export class ClothSolver {
|
|
|
430
440
|
const surfaceKeys = new Set();
|
|
431
441
|
if (!Array.isArray(surfaceContacts) || surfaceContacts.length > this.config.triangles.length * colliders.length || (!this.config.surfaceCollisions && surfaceContacts.length > 0) ||
|
|
432
442
|
surfaceContacts.some(contact => !contact || contact.tick !== input.tick || !Number.isSafeInteger(contact.triangle) || contact.triangle < 0 || contact.triangle >= this.config.triangles.length ||
|
|
433
|
-
!colliders.some(collider => collider.id === contact.colliderId
|
|
443
|
+
!colliders.some(collider => collider.id === contact.colliderId) || typeof contact.penetration !== "number" || !Number.isFinite(contact.penetration) || contact.penetration <= 0 ||
|
|
434
444
|
!Array.isArray(contact.barycentric) || contact.barycentric.length !== 3 || !contact.barycentric.every(value => typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1) ||
|
|
435
445
|
Math.abs(contact.barycentric[0] + contact.barycentric[1] + contact.barycentric[2] - 1) > 1e-5 || (contact.reactionImpulse === undefined) !== (contact.reactionAngularImpulse === undefined) || (contact.reactionImpulse !== undefined && (!vec(contact.reactionImpulse) || !vec(contact.reactionAngularImpulse)))))
|
|
436
446
|
fail("CLOTH_SNAPSHOT", "invalid surface contact state");
|