@combos-fun/plugin-renderer-3d-tiling-sprite 0.0.44 → 0.0.46

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.
Files changed (2) hide show
  1. package/agent-skill.md +30 -27
  2. package/package.json +4 -4
package/agent-skill.md CHANGED
@@ -1,45 +1,46 @@
1
1
  # `@combos-fun/plugin-renderer-3d-tiling-sprite` — Agent notes
2
2
 
3
- Repeating texture on a 3D plane (`PlaneGeometry` + `RepeatWrapping` texture). `resource` is an engine **name** (`RESOURCE_TYPE.IMAGE`), never a URL.
3
+ Repeats one IMAGE texture across a `PlaneGeometry` using `RepeatWrapping`, for floors, walls, and tiled patterns.
4
4
 
5
- ## When to read
6
-
7
- Read for any tiled 3D surface: floors, walls, repeating patterns on a plane.
5
+ Prerequisite: follow the parent `@combos-fun/plugin-renderer-3d` skill for system order, named resources, pose seeding, hierarchy, and stale-async handling.
8
6
 
9
7
  ## Public API
10
8
 
11
9
  ```ts
12
- import { TilingSprite3D, TilingSprite3DSystem, type TilingSprite3DParams } from '@combos-fun/plugin-renderer-3d-tiling-sprite';
10
+ import {
11
+ TilingSprite3D,
12
+ TilingSprite3DSystem,
13
+ type TilingSprite3DParams,
14
+ } from '@combos-fun/plugin-renderer-3d-tiling-sprite';
13
15
  ```
14
16
 
15
- `componentName = 'TilingSprite3D'`, `systemName = 'TilingSprite3DSystem'`.
17
+ `componentName = 'TilingSprite3D'`; `systemName = 'TilingSprite3DSystem'`.
16
18
 
17
- ### `TilingSprite3DParams`
19
+ ## Parameters
18
20
 
19
21
  | Field | Type | Default |
20
22
  |-------|------|---------|
21
- | `resource` | `string` | `''` (engine resource name, `RESOURCE_TYPE.IMAGE`) |
22
- | `repeatX` / `repeatY` | `number` | `1` |
23
- | `width` / `height` | `number` | `10` |
24
- | `positionX` / `Y` / `Z` | `number` | `0` |
25
- | `rotationX` / `Y` / `Z` | `number` | `0` |
23
+ | `resource` | `string` | `''`; empty on ADD is a silent no-op |
24
+ | `repeatX/Y` | `number` | `1` |
25
+ | `width/height` | `number` | `10` |
26
+ | `positionX/Y/Z` | `number` | `0` |
27
+ | `rotationX/Y/Z` | `number` | `0` radians |
26
28
  | `opacity` | `number` | `1` |
27
29
 
28
- There are **no scale fields** — use `width` / `height` for size in world units. Texture uses `THREE.RepeatWrapping`.
30
+ There are no scale or double-side fields. `width/height` are the plane's world-unit dimensions; the material is front-sided.
29
31
 
30
- ## Required setup
32
+ ## Runtime and lifecycle
31
33
 
32
- `Renderer3DSystem` then `TilingSprite3DSystem`. Register the image with `resource.addResource`.
34
+ - IMAGE loading is async. Replacement/removal invalidates old work; a stale loaded texture is disposed before return.
35
+ - `resource` replacement rebuilds the mesh. `repeatX/Y` update texture repeat, `width/height` replace and dispose geometry, and `opacity` updates material transparency.
36
+ - Pose synchronizes per frame. With renderer shadows enabled, the mesh casts and receives shadows.
37
+ - Removal disposes geometry, material, and texture.
33
38
 
34
- ## Common pitfalls
39
+ ## Package-specific pitfalls
35
40
 
36
- | Symptom | Fix |
37
- |---------|-----|
38
- | `Unknown resource` throw | Use the engine name, not a URL |
39
- | Texture stretched | Increase `repeatX` / `repeatY` to tile more |
40
- | Visible seams | Use a power-of-two seamless texture |
41
- | Plane invisible from below | Plane is single-sided — orient via `rotation*` so the camera sees the front |
42
- | Need scale | Use `width` / `height`, not non-existent `scale*` |
41
+ - Rotate the plane toward the camera; it is invisible from the back.
42
+ - Use a seamless texture to avoid visible tile boundaries.
43
+ - `TilingSprite3D.opacity` can be overwritten each frame by a sibling `Render3D`.
43
44
 
44
45
  ## Minimal example
45
46
 
@@ -47,12 +48,14 @@ There are **no scale fields** — use `width` / `height` for size in world units
47
48
  const floor = new GameObject('floor');
48
49
  floor.addComponent(new TilingSprite3D({
49
50
  resource: 'floor',
50
- repeatX: 4, repeatY: 4,
51
- width: 10, height: 10,
52
- rotationX: -Math.PI / 2, // lay flat
51
+ repeatX: 4,
52
+ repeatY: 4,
53
+ width: 10,
54
+ height: 10,
55
+ rotationX: -Math.PI / 2,
53
56
  }));
54
57
  ```
55
58
 
56
59
  ## Verification
57
60
 
58
- `pnpm --filter @combos-fun/plugin-renderer-3d-tiling-sprite run build`.
61
+ `pnpm --filter @combos-fun/plugin-renderer-3d-tiling-sprite run build`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-3d-tiling-sprite",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "Repeating texture on a 3D plane (PlaneGeometry + RepeatWrapping texture)",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-3d-tiling-sprite.esm.js",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "three": "^0.172.0",
30
- "@combos-fun/engine": "0.0.44",
31
- "@combos-fun/plugin-renderer-3d": "0.0.44",
32
- "@combos-fun/inspector-decorator": "0.0.44"
30
+ "@combos-fun/engine": "0.0.46",
31
+ "@combos-fun/plugin-renderer-3d": "0.0.46",
32
+ "@combos-fun/inspector-decorator": "0.0.46"
33
33
  },
34
34
  "keywords": [
35
35
  "combos-fun",