@edv4h/usketch-css3d-renderer 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +131 -2
- package/dist/css3d-css.d.ts +94 -0
- package/dist/css3d-css.d.ts.map +1 -0
- package/dist/css3d-css.js +136 -0
- package/dist/css3d-css.js.map +1 -0
- package/dist/css3d-renderer.d.ts +85 -0
- package/dist/css3d-renderer.d.ts.map +1 -0
- package/dist/css3d-renderer.js +461 -0
- package/dist/css3d-renderer.js.map +1 -0
- package/dist/css3d-shapes.d.ts +23 -0
- package/dist/css3d-shapes.d.ts.map +1 -0
- package/dist/css3d-shapes.js +110 -0
- package/dist/css3d-shapes.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/shapes-layer.d.ts +53 -0
- package/dist/shapes-layer.d.ts.map +1 -0
- package/dist/shapes-layer.js +198 -0
- package/dist/shapes-layer.js.map +1 -0
- package/dist/shapes-layout.d.ts +163 -0
- package/dist/shapes-layout.d.ts.map +1 -0
- package/dist/shapes-layout.js +277 -0
- package/dist/shapes-layout.js.map +1 -0
- package/package.json +50 -3
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// Where and how each 3D shape is placed in the renderer's 3D shape layer — pure, React-free.
|
|
2
|
+
// (Moved here from the shape-3d plugin, which re-exports it until the next major.)
|
|
3
|
+
//
|
|
4
|
+
// The layer is a fixed (screen-space) depth layer: the Mode 7 runtime tilts its wrapper
|
|
5
|
+
// into the ground plane and keeps `preserve-3d` through it, so `translateZ` lifts out of
|
|
6
|
+
// the ground (as the map's cliffs and the character do). A shape is placed at its anchor
|
|
7
|
+
// on screen (`worldToScreen`): a stood-up shape is its own drawing folded up about its
|
|
8
|
+
// bottom edge (`rotateX(-90deg)`), like a cliff wall; a floating one is lifted flat; a
|
|
9
|
+
// box is lifted as a top with four walls folded down from it.
|
|
10
|
+
import { resolveShapeView3d, safeRotation, shapeTypeModes, shapeView3dAnchor, shapeView3dFoot, viewportRotation, worldToScreen, wrapDeg, } from "@edv4h/usketch-shared";
|
|
11
|
+
/** Screen px a shadow floats above its ground (no z-fighting with a raised terrain top). */
|
|
12
|
+
export const SHADOW_LIFT_PX = 0.5;
|
|
13
|
+
/** The foot of a stood-up shape: the middle of its (rotated) bottom edge, world units. */
|
|
14
|
+
export const standFoot = shapeView3dFoot;
|
|
15
|
+
/** The point a shape is placed by: the foot for `stand`, the centre otherwise. World units. */
|
|
16
|
+
export const shapeAnchor = shapeView3dAnchor;
|
|
17
|
+
/** `a` turned toward `b` by `t` (0…1) the short way round, degrees. Pure. */
|
|
18
|
+
export function lerpAngle(a, b, t) {
|
|
19
|
+
return a + wrapDeg(b - a) * t;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The pose of a 3D shape. At `amount` 0 it lies exactly where the flat board draws it
|
|
23
|
+
* (heading = its rotation on screen). As the view rises, a `stand` shape stands up and —
|
|
24
|
+
* when facing the camera — turns to face it, against the full camera `yaw` (the ground is
|
|
25
|
+
* spun by the yaw, so the plane turns back by it); a `box` / `float` face rises to its
|
|
26
|
+
* height.
|
|
27
|
+
*/
|
|
28
|
+
export function shapePose(shape, params, view) {
|
|
29
|
+
const anchor = shapeAnchor(shape, params.mode);
|
|
30
|
+
const at = worldToScreen(anchor.x, anchor.y, view.viewport);
|
|
31
|
+
const zoom = view.viewport.zoom;
|
|
32
|
+
const flat = safeRotation(shape.rotation) + viewportRotation(view.viewport);
|
|
33
|
+
const amount = clamp01(view.amount);
|
|
34
|
+
const stand = params.mode === "stand";
|
|
35
|
+
const face = stand && params.facing === "camera" ? lerpAngle(flat, -view.yaw, amount) : flat;
|
|
36
|
+
return {
|
|
37
|
+
mode: params.mode,
|
|
38
|
+
x: at.x,
|
|
39
|
+
y: at.y,
|
|
40
|
+
face: round(face),
|
|
41
|
+
raise: amount,
|
|
42
|
+
lift: params.ground ? Math.max(0, view.groundHeight) * zoom : 0,
|
|
43
|
+
rise: stand ? 0 : round(Math.max(0, params.height) * amount * zoom),
|
|
44
|
+
zoom,
|
|
45
|
+
width: shape.width,
|
|
46
|
+
height: shape.height,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The node of a 3D shape: a box of the shape's size on screen, placed so the anchor is
|
|
51
|
+
* its bottom-centre (`stand`, the pivot it folds up about) or its centre. The box must
|
|
52
|
+
* have its real size: Chrome drops a 3D-rotated element with an empty box even when its
|
|
53
|
+
* overflowing content isn't empty.
|
|
54
|
+
*/
|
|
55
|
+
export function poseBox(p) {
|
|
56
|
+
const w = p.width * p.zoom;
|
|
57
|
+
const h = p.height * p.zoom;
|
|
58
|
+
const top = !p.mode || p.mode === "stand" ? p.y - h : p.y - h / 2;
|
|
59
|
+
return { left: round(p.x - w / 2), top: round(top), width: round(w), height: round(h) };
|
|
60
|
+
}
|
|
61
|
+
/** `transform-origin` of a stood-up shape's node: the foot. */
|
|
62
|
+
export const STAND_ORIGIN = "50% 100%";
|
|
63
|
+
/** `transform-origin` of a 3D shape's node (see {@link poseBox}). */
|
|
64
|
+
export function poseOrigin(p) {
|
|
65
|
+
return p.mode === "stand" ? STAND_ORIGIN : "50% 50%";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* CSS for a 3D shape's node: lift to the ground, turn to the heading, then fold up
|
|
69
|
+
* (`stand`) or rise (`float`). A `box` node is only lifted and turned: its top and walls
|
|
70
|
+
* are children ({@link boxTopTransform}, {@link boxWalls}). `undefined` when flat.
|
|
71
|
+
*/
|
|
72
|
+
export function poseTransform(p) {
|
|
73
|
+
const parts = [];
|
|
74
|
+
const z = p.lift + (p.mode === "float" ? p.rise : 0);
|
|
75
|
+
if (z > 0)
|
|
76
|
+
parts.push(`translateZ(${round(z)}px)`);
|
|
77
|
+
if (p.face !== 0)
|
|
78
|
+
parts.push(`rotateZ(${round(p.face)}deg)`);
|
|
79
|
+
if (p.mode === "stand" && p.raise > 0)
|
|
80
|
+
parts.push(`rotateX(${round(-90 * p.raise)}deg)`);
|
|
81
|
+
return parts.length > 0 ? parts.join(" ") : undefined;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Where a type's own `render3d` draws: the shape's node (as {@link poseBox} /
|
|
85
|
+
* {@link poseOrigin}) lifted to the ground and turned to the shape's own heading, plus
|
|
86
|
+
* how far to turn back to face the camera (scaled by the transition). The generic
|
|
87
|
+
* camera-facing turn isn't applied: `render3d` decides. Pure.
|
|
88
|
+
*/
|
|
89
|
+
export function render3dFrame(shape, params, view) {
|
|
90
|
+
const pose = shapePose(shape, { ...params, facing: "fixed" }, view);
|
|
91
|
+
const parts = [];
|
|
92
|
+
if (pose.lift > 0)
|
|
93
|
+
parts.push(`translateZ(${round(pose.lift)}px)`);
|
|
94
|
+
if (pose.face !== 0)
|
|
95
|
+
parts.push(`rotateZ(${round(pose.face)}deg)`);
|
|
96
|
+
return {
|
|
97
|
+
pose,
|
|
98
|
+
transform: parts.length > 0 ? parts.join(" ") : undefined,
|
|
99
|
+
faceCamera: round(wrapDeg(-view.yaw - pose.face) * pose.raise),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** CSS for a `box` shape's top (the shape's own drawing), relative to its node. */
|
|
103
|
+
export function boxTopTransform(p) {
|
|
104
|
+
return p.rise > 0 ? `translateZ(${round(p.rise)}px)` : undefined;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The four walls of a `box` shape, in its node's px frame: each a flat strip along one
|
|
108
|
+
* edge of the box, folded up about that edge (like the map's cliff walls) so it reaches
|
|
109
|
+
* from the ground to the top, its face outward. None while the box has no height. Pure.
|
|
110
|
+
*/
|
|
111
|
+
export function boxWalls(p) {
|
|
112
|
+
const h = round(p.rise);
|
|
113
|
+
if (!(h > 0))
|
|
114
|
+
return [];
|
|
115
|
+
const w = round(p.width * p.zoom);
|
|
116
|
+
const d = round(p.height * p.zoom);
|
|
117
|
+
return [
|
|
118
|
+
{
|
|
119
|
+
side: "n",
|
|
120
|
+
left: 0,
|
|
121
|
+
top: 0,
|
|
122
|
+
width: w,
|
|
123
|
+
height: h,
|
|
124
|
+
transformOrigin: "50% 0%",
|
|
125
|
+
transform: "rotateX(90deg)",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
side: "e",
|
|
129
|
+
left: round(w - h),
|
|
130
|
+
top: 0,
|
|
131
|
+
width: h,
|
|
132
|
+
height: d,
|
|
133
|
+
transformOrigin: "100% 50%",
|
|
134
|
+
transform: "rotateY(90deg)",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
side: "s",
|
|
138
|
+
left: 0,
|
|
139
|
+
top: round(d - h),
|
|
140
|
+
width: w,
|
|
141
|
+
height: h,
|
|
142
|
+
transformOrigin: "50% 100%",
|
|
143
|
+
transform: "rotateX(-90deg)",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
side: "w",
|
|
147
|
+
left: 0,
|
|
148
|
+
top: 0,
|
|
149
|
+
width: h,
|
|
150
|
+
height: d,
|
|
151
|
+
transformOrigin: "0% 50%",
|
|
152
|
+
transform: "rotateY(-90deg)",
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* A `box` shape's wall colour: its fill (`style.fill`, else `color`) — the walls darken
|
|
158
|
+
* it with an overlay ({@link wallShade}) — or a neutral grey when it has none usable.
|
|
159
|
+
*/
|
|
160
|
+
export function wallColor(shape) {
|
|
161
|
+
const color = shape.color;
|
|
162
|
+
const fill = shape.style?.fill ?? (typeof color === "string" ? color : undefined);
|
|
163
|
+
if (typeof fill !== "string")
|
|
164
|
+
return "#9e9e9e";
|
|
165
|
+
const f = fill.trim().toLowerCase();
|
|
166
|
+
if (f === "" || f === "none" || f === "transparent")
|
|
167
|
+
return "#9e9e9e";
|
|
168
|
+
return fill;
|
|
169
|
+
}
|
|
170
|
+
/** The darkening overlay of a wall: east/west a touch darker, as the map's cliffs. */
|
|
171
|
+
export function wallShade(side) {
|
|
172
|
+
return `inset 0 0 0 9999px rgba(0,0,0,${side === "e" || side === "w" ? 0.35 : 0.22})`;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* CSS for a 3D shape's shadow, at its anchor on the ground: a soft ellipse along the
|
|
176
|
+
* heading — at the foot of a `stand` shape, under a `float` one. It grows in with the
|
|
177
|
+
* view (`raise`): the flat board has no shadows. `null` for a `box` (it sits on the
|
|
178
|
+
* ground).
|
|
179
|
+
*/
|
|
180
|
+
export function shadowStyle(p) {
|
|
181
|
+
if (p.mode === "box")
|
|
182
|
+
return null;
|
|
183
|
+
const float = p.mode === "float";
|
|
184
|
+
const width = Math.max(4, p.width * p.zoom * 0.9);
|
|
185
|
+
const height = float
|
|
186
|
+
? Math.max(2, p.height * p.zoom * 0.9)
|
|
187
|
+
: Math.max(2, Math.min(p.width, p.height) * p.zoom * 0.3);
|
|
188
|
+
return {
|
|
189
|
+
transform: `translateZ(${round(p.lift + SHADOW_LIFT_PX)}px) rotateZ(${round(p.face)}deg) translate(-50%, -50%)`,
|
|
190
|
+
width: round(width),
|
|
191
|
+
height: round(height),
|
|
192
|
+
opacity: round(p.raise * (float ? 0.7 : 1)),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export const DEFAULT_CSS3D_SHAPE_LIMITS = {
|
|
196
|
+
minPx: 8,
|
|
197
|
+
maxCount: 200,
|
|
198
|
+
groundFlat: true,
|
|
199
|
+
};
|
|
200
|
+
/** What a shape holding no 3D parameters is drawn as on raised ground: flat, at its height. */
|
|
201
|
+
export const GROUND_FLAT_PARAMS = {
|
|
202
|
+
mode: "float",
|
|
203
|
+
height: 0,
|
|
204
|
+
facing: "camera",
|
|
205
|
+
ground: true,
|
|
206
|
+
shadow: false,
|
|
207
|
+
collision: "none",
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* The shapes to draw in 3D now (in z-order). Only while the view is (partly) 3D, never
|
|
211
|
+
* in the global LOD mode, and only shapes whose anchor is on the drawn ground: the board
|
|
212
|
+
* box grown by the 3D view's overscan. A depth layer isn't clipped by the draw distance,
|
|
213
|
+
* so a shape farther out would stand in the sky past the ground's end. With
|
|
214
|
+
* `limits.groundFlat` and a `heightAt`, a shape holding no 3D parameters whose centre is
|
|
215
|
+
* on raised ground is drawn too, lying flat at that height ({@link GROUND_FLAT_PARAMS}).
|
|
216
|
+
* Pure.
|
|
217
|
+
*/
|
|
218
|
+
export function selectShapes3d(input) {
|
|
219
|
+
if (!(input.amount > 0) || input.renderMode === "lod")
|
|
220
|
+
return [];
|
|
221
|
+
const zoom = input.viewport.zoom;
|
|
222
|
+
if (!(zoom > 0))
|
|
223
|
+
return [];
|
|
224
|
+
const pad = input.overscanPx > 0 ? input.overscanPx / zoom : 0;
|
|
225
|
+
const b = input.viewportBounds;
|
|
226
|
+
const x0 = b.x - pad;
|
|
227
|
+
const y0 = b.y - pad;
|
|
228
|
+
const x1 = b.x + b.width + pad;
|
|
229
|
+
const y1 = b.y + b.height + pad;
|
|
230
|
+
const found = [];
|
|
231
|
+
for (const shape of input.shapes) {
|
|
232
|
+
if (!shape || typeof shape.id !== "string")
|
|
233
|
+
continue;
|
|
234
|
+
// Size and place first: they need no terrain, so a shape too small or off screen never
|
|
235
|
+
// samples `heightAt` (on a wide board that thrashes the terrain's chunk cache every frame).
|
|
236
|
+
if (Math.max(shape.width, shape.height) * zoom < input.limits.minPx)
|
|
237
|
+
continue;
|
|
238
|
+
const own = resolveShapeView3d(shape, input.types[shape.type]);
|
|
239
|
+
const at = shapeAnchor(shape, own?.mode ?? GROUND_FLAT_PARAMS.mode);
|
|
240
|
+
if (at.x < x0 || at.x > x1 || at.y < y0 || at.y > y1)
|
|
241
|
+
continue;
|
|
242
|
+
const params = own ?? groundFlatParams(shape, input);
|
|
243
|
+
if (!params)
|
|
244
|
+
continue;
|
|
245
|
+
found.push({ shape, params, screenY: worldToScreen(at.x, at.y, input.viewport).y });
|
|
246
|
+
}
|
|
247
|
+
const max = Math.max(0, Math.floor(input.limits.maxCount));
|
|
248
|
+
if (found.length > max) {
|
|
249
|
+
const keep = new Set([...found]
|
|
250
|
+
.sort((a, b) => b.screenY - a.screenY)
|
|
251
|
+
.slice(0, max)
|
|
252
|
+
.map((e) => e.shape.id));
|
|
253
|
+
return found
|
|
254
|
+
.filter((e) => keep.has(e.shape.id))
|
|
255
|
+
.map(({ shape, params }) => ({ shape, params }));
|
|
256
|
+
}
|
|
257
|
+
return found.map(({ shape, params }) => ({ shape, params }));
|
|
258
|
+
}
|
|
259
|
+
/** {@link GROUND_FLAT_PARAMS} for a parameterless shape on raised ground, else `null`. */
|
|
260
|
+
function groundFlatParams(shape, input) {
|
|
261
|
+
if (!input.limits.groundFlat || !input.heightAt)
|
|
262
|
+
return null;
|
|
263
|
+
if (!shapeTypeModes(input.types[shape.type]).includes("float"))
|
|
264
|
+
return null;
|
|
265
|
+
const at = shapeAnchor(shape, "float");
|
|
266
|
+
const h = input.heightAt(at.x, at.y);
|
|
267
|
+
return Number.isFinite(h) && h > 0 ? GROUND_FLAT_PARAMS : null;
|
|
268
|
+
}
|
|
269
|
+
function clamp01(n) {
|
|
270
|
+
if (!Number.isFinite(n))
|
|
271
|
+
return 0;
|
|
272
|
+
return Math.min(1, Math.max(0, n));
|
|
273
|
+
}
|
|
274
|
+
function round(n) {
|
|
275
|
+
return Math.round(n * 1000) / 1000;
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=shapes-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapes-layout.js","sourceRoot":"","sources":["../src/shapes-layout.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,mFAAmF;AACnF,EAAE;AACF,wFAAwF;AACxF,yFAAyF;AACzF,yFAAyF;AACzF,uFAAuF;AACvF,uFAAuF;AACvF,8DAA8D;AAC9D,OAAO,EAGN,k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C,IAAI,CAAC;AAChE,CAAC;AAED,SAAS,OAAO,CAAC,CAAS;IACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,KAAK,CAAC,CAAS;IACvB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edv4h/usketch-css3d-renderer",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@edv4h/usketch-dom-renderer": "2.4.0",
|
|
16
|
+
"@edv4h/usketch-shared": "4.25.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": ">=19"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/react": "19.3.0",
|
|
23
|
+
"@types/react-dom": "19.3.0",
|
|
24
|
+
"jsdom": "31.0.0",
|
|
25
|
+
"react-dom": "19.3.1",
|
|
26
|
+
"typescript": "7.0.2",
|
|
27
|
+
"vitest": "5.1.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/EdV4H/usketch.git",
|
|
40
|
+
"directory": "packages/css3d-renderer"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/EdV4H/usketch#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/EdV4H/usketch/issues"
|
|
45
|
+
},
|
|
46
|
+
"description": "CSS 3D renderer for the board 3D view: tilts the layers into a ground plane and stands 3D shapes up out of it with CSS transforms",
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -p tsconfig.json",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"test": "vitest run --passWithNoTests",
|
|
51
|
+
"clean": "rm -rf dist"
|
|
52
|
+
}
|
|
6
53
|
}
|