@combos-fun/plugin-renderer-3d-tiling-sprite 0.0.45 → 0.0.47
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 +30 -27
- 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
|
-
|
|
3
|
+
Repeats one IMAGE texture across a `PlaneGeometry` using `RepeatWrapping`, for floors, walls, and tiled patterns.
|
|
4
4
|
|
|
5
|
-
|
|
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 {
|
|
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'
|
|
17
|
+
`componentName = 'TilingSprite3D'`; `systemName = 'TilingSprite3DSystem'`.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
## Parameters
|
|
18
20
|
|
|
19
21
|
| Field | Type | Default |
|
|
20
22
|
|-------|------|---------|
|
|
21
|
-
| `resource` | `string` | `''
|
|
22
|
-
| `repeatX
|
|
23
|
-
| `width
|
|
24
|
-
| `positionX
|
|
25
|
-
| `rotationX
|
|
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
|
|
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
|
-
##
|
|
32
|
+
## Runtime and lifecycle
|
|
31
33
|
|
|
32
|
-
|
|
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
|
-
##
|
|
39
|
+
## Package-specific pitfalls
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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,
|
|
51
|
-
|
|
52
|
-
|
|
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.
|
|
3
|
+
"version": "0.0.47",
|
|
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/
|
|
31
|
-
"@combos-fun/
|
|
32
|
-
"@combos-fun/
|
|
30
|
+
"@combos-fun/engine": "0.0.47",
|
|
31
|
+
"@combos-fun/plugin-renderer-3d": "0.0.47",
|
|
32
|
+
"@combos-fun/inspector-decorator": "0.0.47"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"combos-fun",
|