@combos-fun/plugin-renderer-3d 0.0.7 → 0.0.9
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/agent-skill.md +6 -16
- package/package.json +13 -3
package/agent-skill.md
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
# `@combos-fun/plugin-renderer-3d` — Agent notes
|
|
2
2
|
|
|
3
|
-
3D rendering foundation for Combos Fun. Wraps Three.js (`three` ^0.172) and
|
|
4
|
-
exposes `Renderer3DSystem`, the `Renderer3D` base class, and a
|
|
5
|
-
`ThreeContext` that owns the Three.js scene / camera / lights / WebGL
|
|
6
|
-
renderer / `Clock` / `GLTFLoader`.
|
|
3
|
+
3D rendering foundation for Combos Fun. Wraps Three.js (`three` ^0.172) and exposes `Renderer3DSystem`, the `Renderer3D` base class, and a `ThreeContext` that owns the Three.js scene / camera / lights / WebGL renderer / `Clock` / `GLTFLoader`.
|
|
7
4
|
|
|
8
5
|
## When to read
|
|
9
6
|
|
|
10
|
-
Read for any 3D rendering task: setting up the canvas, blank-3D-canvas
|
|
11
|
-
debugging, custom 3D renderer plugins, async asset loading. All
|
|
12
|
-
`plugin-renderer-3d-*` sub-plugins assume this file is already loaded.
|
|
7
|
+
Read for any 3D rendering task: setting up the canvas, blank-3D-canvas debugging, custom 3D renderer plugins, async asset loading. All `plugin-renderer-3d-*` sub-plugins assume this file is already loaded.
|
|
13
8
|
|
|
14
9
|
## Public API
|
|
15
10
|
|
|
@@ -71,9 +66,7 @@ class MyRenderer3D extends Renderer3D {
|
|
|
71
66
|
|
|
72
67
|
### Async loading pattern
|
|
73
68
|
|
|
74
|
-
For 3D plugins that load assets (`Img3D`, `Model3D`, etc.) use the
|
|
75
|
-
inherited helpers to drop stale work when a component is removed
|
|
76
|
-
mid-load:
|
|
69
|
+
For 3D plugins that load assets (`Img3D`, `Model3D`, etc.) use the inherited helpers to drop stale work when a component is removed mid-load:
|
|
77
70
|
|
|
78
71
|
```ts
|
|
79
72
|
const asyncId = this.increaseAsyncId(gameObject.id);
|
|
@@ -82,13 +75,11 @@ if (!this.validateAsyncId(gameObject.id, asyncId)) return; // stale
|
|
|
82
75
|
/* attach data */
|
|
83
76
|
```
|
|
84
77
|
|
|
85
|
-
This prevents memory leaks and double-add bugs when the same `GameObject`
|
|
86
|
-
is re-used quickly.
|
|
78
|
+
This prevents memory leaks and double-add bugs when the same `GameObject` is re-used quickly.
|
|
87
79
|
|
|
88
80
|
## Required setup
|
|
89
81
|
|
|
90
|
-
`Renderer3DSystem` **must** be the first system added before any 3D
|
|
91
|
-
sub-system that calls `getSystem(Renderer3DSystem)` in `init`.
|
|
82
|
+
`Renderer3DSystem` **must** be the first system added before any 3D sub-system that calls `getSystem(Renderer3DSystem)` in `init`.
|
|
92
83
|
|
|
93
84
|
```ts
|
|
94
85
|
new Game({
|
|
@@ -138,8 +129,7 @@ new Game({
|
|
|
138
129
|
});
|
|
139
130
|
```
|
|
140
131
|
|
|
141
|
-
This alone shows an empty 3D scene with default lighting. Add
|
|
142
|
-
`Graphics3DSystem` etc. and matching components to render anything.
|
|
132
|
+
This alone shows an empty 3D scene with default lighting. Add `Graphics3DSystem` etc. and matching components to render anything.
|
|
143
133
|
|
|
144
134
|
## Verification
|
|
145
135
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-3d",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "dist/plugin-renderer-3d.esm.js",
|
|
6
6
|
"bundle": "CombosFun.plugin.renderer.3d",
|
|
@@ -26,9 +26,19 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"three": "^0.172.0",
|
|
29
|
-
"@combos-fun/engine": "0.0.
|
|
30
|
-
"@combos-fun/inspector-decorator": "0.0.
|
|
29
|
+
"@combos-fun/engine": "0.0.9",
|
|
30
|
+
"@combos-fun/inspector-decorator": "0.0.9"
|
|
31
31
|
},
|
|
32
|
+
"description": "3D rendering foundation",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"combos-fun",
|
|
35
|
+
"three.js",
|
|
36
|
+
"3d",
|
|
37
|
+
"rendering",
|
|
38
|
+
"webgl",
|
|
39
|
+
"renderer-base",
|
|
40
|
+
"scene"
|
|
41
|
+
],
|
|
32
42
|
"scripts": {
|
|
33
43
|
"build": "node ../../scripts/build-package.mjs"
|
|
34
44
|
}
|