@combos-fun/plugin-renderer-3d-img 0.0.6 → 0.0.7

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 ADDED
@@ -0,0 +1,27 @@
1
+ # @combos-fun/plugin-renderer-3d-img
2
+
3
+ @combos-fun/plugin-renderer-3d-img — part of the Combos Fun engine monorepo.
4
+
5
+ Keywords: `3d`, `image`, `texture`, `plane`, `billboard`.
6
+
7
+ ## Documentation
8
+
9
+ - Per-package agent / developer notes: [`agent-skill.md`](./agent-skill.md)
10
+ - Machine-readable manifest: [`combos-plugin.json`](./combos-plugin.json)
11
+ (validated against `schemas/combos-plugin.schema.json` in the repo
12
+ root)
13
+ - Entry skill (single source of truth for AI agents working with this
14
+ monorepo): `skills/combos-engine-development/SKILL.md`
15
+
16
+ When consumed from npm, the manifest and agent notes are exposed as
17
+ stable subpaths:
18
+
19
+ ```ts
20
+ import manifest from '@combos-fun/plugin-renderer-3d-img/plugin-manifest';
21
+ // or fetch the markdown directly:
22
+ // require.resolve('@combos-fun/plugin-renderer-3d-img/agent-skill')
23
+ ```
24
+
25
+ ## License
26
+
27
+ Internal workspace package, part of the Combos Fun engine monorepo.
package/agent-skill.md ADDED
@@ -0,0 +1,59 @@
1
+ # `@combos-fun/plugin-renderer-3d-img` — Agent notes
2
+
3
+ 3D textured plane. Renders an image as a `THREE.Mesh` with a
4
+ `PlaneGeometry` sized by the image's aspect ratio.
5
+
6
+ ## When to read
7
+
8
+ Read when you need to put a 2D image into a 3D scene: billboards, flat
9
+ backdrops, decals, UI panels in 3D space.
10
+
11
+ ## Public API
12
+
13
+ ```ts
14
+ import { Img3D, Img3DSystem, type Img3DParams } from '@combos-fun/plugin-renderer-3d-img';
15
+ ```
16
+
17
+ `componentName = 'Img3D'`, `systemName = 'Img3DSystem'`.
18
+
19
+ ### `Img3DParams`
20
+
21
+ | Field | Type | Default |
22
+ |-------|------|---------|
23
+ | `resource` | `string` | `''` (image URL — direct, not engine resource name) |
24
+ | `positionX` / `Y` / `Z` | `number` | `0` |
25
+ | `rotationX` / `Y` / `Z` | `number` | `0` |
26
+ | `scaleX` / `Y` | `number` | `1` (no `scaleZ` — plane is 2D) |
27
+ | `opacity` | `number` | `1` |
28
+ | `doubleSide` | `boolean` | `false` |
29
+
30
+ The plane geometry size matches the image's natural pixel aspect ratio in
31
+ world units.
32
+
33
+ ## Required setup
34
+
35
+ `Renderer3DSystem` then `Img3DSystem`. URL must be CORS-accessible.
36
+
37
+ ## Common pitfalls
38
+
39
+ | Symptom | Fix |
40
+ |---------|-----|
41
+ | Image only visible from front | Set `doubleSide: true` |
42
+ | Image too large in world | Scale via `scaleX` / `scaleY`, not `width`/`height` (no such fields here) |
43
+ | 404 / CORS | Direct URL, must be CORS-enabled |
44
+ | Stale image after fast remove | The system uses `increaseAsyncId` / `validateAsyncId` to drop stale work — no action needed unless extending |
45
+
46
+ ## Minimal example
47
+
48
+ ```ts
49
+ const billboard = new GameObject('billboard');
50
+ billboard.addComponent(new Img3D({
51
+ resource: '/assets/poster.png',
52
+ positionZ: -3,
53
+ doubleSide: true,
54
+ }));
55
+ ```
56
+
57
+ ## Verification
58
+
59
+ `pnpm --filter @combos-fun/plugin-renderer-3d-img run build`.
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@combos-fun/plugin-renderer-3d-img",
3
+ "pluginId": "renderer-3d-img",
4
+ "category": "rendering",
5
+ "dimension": "3d",
6
+ "isCore": false,
7
+ "keywords": ["3d", "image", "texture", "plane", "billboard"],
8
+ "agentSkill": "./agent-skill.md",
9
+ "requires": ["@combos-fun/engine", "@combos-fun/plugin-renderer-3d"],
10
+ "exports": ["Img3D", "Img3DSystem"]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-3d-img",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "@combos-fun/plugin-renderer-3d-img",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-3d-img.esm.js",
@@ -9,13 +9,27 @@
9
9
  "types": "dist/plugin-renderer-3d-img.d.ts",
10
10
  "files": [
11
11
  "index.js",
12
- "dist"
12
+ "dist",
13
+ "agent-skill.md",
14
+ "combos-plugin.json"
13
15
  ],
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/plugin-renderer-3d-img.esm.js",
19
+ "require": "./index.js",
20
+ "types": "./dist/plugin-renderer-3d-img.d.ts"
21
+ },
22
+ "./plugin-manifest": "./combos-plugin.json",
23
+ "./agent-skill": "./agent-skill.md"
24
+ },
25
+ "combos": {
26
+ "pluginManifest": "./combos-plugin.json"
27
+ },
14
28
  "dependencies": {
15
29
  "three": "^0.172.0",
16
- "@combos-fun/engine": "0.0.6",
17
- "@combos-fun/inspector-decorator": "0.0.6",
18
- "@combos-fun/plugin-renderer-3d": "0.0.6"
30
+ "@combos-fun/engine": "0.0.7",
31
+ "@combos-fun/inspector-decorator": "0.0.7",
32
+ "@combos-fun/plugin-renderer-3d": "0.0.7"
19
33
  },
20
34
  "scripts": {
21
35
  "build": "node ../../scripts/build-package.mjs"