@vincentt-xr/sdk 2.0.0-alpha.18 → 2.0.0-alpha.19
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/GROUNDING.md +44 -0
- package/components.json +78 -1
- package/dist/components/Light/index.d.ts +26 -0
- package/dist/components/PaintedFace/index.d.ts +24 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +1 -1
- package/dist/editor-defs/types.d.ts +1 -1
- package/dist/entries/core.d.ts +2 -0
- package/dist/entries/face-effects.d.ts +2 -0
- package/dist/face-effects.cjs +68 -68
- package/dist/face-effects.js +1352 -1332
- package/dist/{index-DN_eHnag.js → index-CM3jkleV.js} +46 -35
- package/dist/{index-B5X4N2tc.cjs → index-fDwL47CM.cjs} +3 -3
- package/dist/main.cjs +1 -1
- package/dist/main.js +713 -664
- package/package.json +1 -1
- package/settings.json +1 -1
package/GROUNDING.md
CHANGED
|
@@ -8897,6 +8897,30 @@ Insert:
|
|
|
8897
8897
|
<HtmlRegion />
|
|
8898
8898
|
```
|
|
8899
8899
|
|
|
8900
|
+
### `<Light>` - Light
|
|
8901
|
+
|
|
8902
|
+
Import: `import { Light } from "@vincentt-xr/sdk"`.
|
|
8903
|
+
A light. `castShadow` is off by default because shadows cost frame time on phones. `distance` and `decay` apply to point and spot, `angle` (radians) and `penumbra` to spot only; the editor lists them only when written in the tag. Move it with `position={{ x, y, z }}` written as literal numbers; rotation stays in code.
|
|
8904
|
+
Placement: position3.
|
|
8905
|
+
|
|
8906
|
+
| Prop | Label | Control |
|
|
8907
|
+
| ------------ | ---------------------------- | ----------------------------------------------- |
|
|
8908
|
+
| `type` | Type | choice, ambient or directional or point or spot |
|
|
8909
|
+
| `color` | Colour | colour |
|
|
8910
|
+
| `intensity` | Intensity | number, 0.. |
|
|
8911
|
+
| `enabled` | On | switch |
|
|
8912
|
+
| `castShadow` | Casts shadows (slows phones) | switch |
|
|
8913
|
+
| `distance` | Distance | number, 0.. |
|
|
8914
|
+
| `decay` | Decay | number, 0.. |
|
|
8915
|
+
| `angle` | Angle | number, 0..1.57 |
|
|
8916
|
+
| `penumbra` | Edge softness | number, 0..1 |
|
|
8917
|
+
|
|
8918
|
+
Insert:
|
|
8919
|
+
|
|
8920
|
+
```tsx
|
|
8921
|
+
<Light type="point" />
|
|
8922
|
+
```
|
|
8923
|
+
|
|
8900
8924
|
### `<Model>` - Model
|
|
8901
8925
|
|
|
8902
8926
|
Import: `import { Model } from "@vincentt-xr/sdk"`.
|
|
@@ -8931,6 +8955,26 @@ Insert:
|
|
|
8931
8955
|
<Object3D />
|
|
8932
8956
|
```
|
|
8933
8957
|
|
|
8958
|
+
### `<PaintedFace>` - Face texture
|
|
8959
|
+
|
|
8960
|
+
Import: `import { PaintedFace } from "@vincentt-xr/sdk"`.
|
|
8961
|
+
A painted face from an image, drawn on the tracked face. Paint it in the canonical face layout (`canonicalFaceTextureUrl` is the template). Tracking is unchanged. Live-face swap and mirror modes stay in code (`FaceSwap`, `FaceTextureLayer`).
|
|
8962
|
+
|
|
8963
|
+
| Prop | Label | Control |
|
|
8964
|
+
| ---------- | --------- | ---------------------------------- |
|
|
8965
|
+
| `src` | Image | file, accepts image |
|
|
8966
|
+
| `amount` | Strength | number, 0..1 |
|
|
8967
|
+
| `layout` | Layout | choice, asIs or flip or upsideDown |
|
|
8968
|
+
| `ownEyes` | Own eyes | switch |
|
|
8969
|
+
| `ownMouth` | Own mouth | switch |
|
|
8970
|
+
| `visible` | Show | switch |
|
|
8971
|
+
|
|
8972
|
+
Insert:
|
|
8973
|
+
|
|
8974
|
+
```tsx
|
|
8975
|
+
<PaintedFace src="/images/face.png" />
|
|
8976
|
+
```
|
|
8977
|
+
|
|
8934
8978
|
### `<Scene>` - Scene
|
|
8935
8979
|
|
|
8936
8980
|
Import: `import { Scene } from "@vincentt-xr/sdk"`.
|
package/components.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "vincentt.components/1",
|
|
3
3
|
"package": "@vincentt-xr/sdk",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.19",
|
|
5
5
|
"components": {
|
|
6
6
|
"AudioPlayer": {
|
|
7
7
|
"kind": "sound",
|
|
@@ -53,6 +53,62 @@
|
|
|
53
53
|
"props": {},
|
|
54
54
|
"insert": { "jsx": "<HtmlRegion />" }
|
|
55
55
|
},
|
|
56
|
+
"Light": {
|
|
57
|
+
"kind": "light",
|
|
58
|
+
"label": "Light",
|
|
59
|
+
"tree": "3d",
|
|
60
|
+
"from": "@vincentt-xr/sdk",
|
|
61
|
+
"nameFrom": "label",
|
|
62
|
+
"place": "position3",
|
|
63
|
+
"props": {
|
|
64
|
+
"type": {
|
|
65
|
+
"control": "choice",
|
|
66
|
+
"label": "Type",
|
|
67
|
+
"showWhenAbsent": true,
|
|
68
|
+
"options": ["ambient", "directional", "point", "spot"]
|
|
69
|
+
},
|
|
70
|
+
"color": { "control": "colour", "label": "Colour", "showWhenAbsent": true },
|
|
71
|
+
"intensity": {
|
|
72
|
+
"control": "number",
|
|
73
|
+
"label": "Intensity",
|
|
74
|
+
"showWhenAbsent": true,
|
|
75
|
+
"min": 0,
|
|
76
|
+
"step": 0.1
|
|
77
|
+
},
|
|
78
|
+
"enabled": { "control": "switch", "label": "On", "showWhenAbsent": true },
|
|
79
|
+
"castShadow": {
|
|
80
|
+
"control": "switch",
|
|
81
|
+
"label": "Casts shadows (slows phones)",
|
|
82
|
+
"showWhenAbsent": true,
|
|
83
|
+
"group": "Shadows"
|
|
84
|
+
},
|
|
85
|
+
"distance": {
|
|
86
|
+
"control": "number",
|
|
87
|
+
"label": "Distance",
|
|
88
|
+
"group": "Reach",
|
|
89
|
+
"min": 0,
|
|
90
|
+
"step": 0.5
|
|
91
|
+
},
|
|
92
|
+
"decay": { "control": "number", "label": "Decay", "group": "Reach", "min": 0, "step": 0.1 },
|
|
93
|
+
"angle": {
|
|
94
|
+
"control": "number",
|
|
95
|
+
"label": "Angle",
|
|
96
|
+
"group": "Spot",
|
|
97
|
+
"min": 0,
|
|
98
|
+
"max": 1.57,
|
|
99
|
+
"step": 0.05
|
|
100
|
+
},
|
|
101
|
+
"penumbra": {
|
|
102
|
+
"control": "number",
|
|
103
|
+
"label": "Edge softness",
|
|
104
|
+
"group": "Spot",
|
|
105
|
+
"min": 0,
|
|
106
|
+
"max": 1,
|
|
107
|
+
"step": 0.05
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"insert": { "jsx": "<Light type=\"point\" />" }
|
|
111
|
+
},
|
|
56
112
|
"Model": {
|
|
57
113
|
"kind": "model",
|
|
58
114
|
"label": "Model",
|
|
@@ -78,6 +134,27 @@
|
|
|
78
134
|
},
|
|
79
135
|
"insert": { "jsx": "<Object3D />" }
|
|
80
136
|
},
|
|
137
|
+
"PaintedFace": {
|
|
138
|
+
"kind": "facetexture",
|
|
139
|
+
"label": "Face texture",
|
|
140
|
+
"tree": "3d",
|
|
141
|
+
"from": "@vincentt-xr/sdk",
|
|
142
|
+
"nameFrom": "fixed",
|
|
143
|
+
"exposeByPresence": true,
|
|
144
|
+
"props": {
|
|
145
|
+
"src": { "control": "file", "label": "Image", "accept": "image" },
|
|
146
|
+
"amount": { "control": "number", "label": "Strength", "min": 0, "max": 1, "step": 0.05 },
|
|
147
|
+
"layout": {
|
|
148
|
+
"control": "choice",
|
|
149
|
+
"label": "Layout",
|
|
150
|
+
"options": ["asIs", "flip", "upsideDown"]
|
|
151
|
+
},
|
|
152
|
+
"ownEyes": { "control": "switch", "label": "Own eyes" },
|
|
153
|
+
"ownMouth": { "control": "switch", "label": "Own mouth" },
|
|
154
|
+
"visible": { "control": "switch", "label": "Show" }
|
|
155
|
+
},
|
|
156
|
+
"insert": { "jsx": "<PaintedFace src=\"/images/face.png\" />", "asset": "image" }
|
|
157
|
+
},
|
|
81
158
|
"Scene": {
|
|
82
159
|
"kind": "scene",
|
|
83
160
|
"label": "Scene",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { KnownComponentProps } from '../../editor-defs/types';
|
|
2
|
+
import { LightType } from '../LightObject';
|
|
3
|
+
import { Transform3DVector } from '../Transform3D';
|
|
4
|
+
export type LightProps = KnownComponentProps & {
|
|
5
|
+
type?: LightType;
|
|
6
|
+
/** CSS colour, for example `#ffffff`. */
|
|
7
|
+
color?: string;
|
|
8
|
+
intensity?: number;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
/** Shadows cost frame time on phones, so this is off unless asked for. */
|
|
11
|
+
castShadow?: boolean;
|
|
12
|
+
/** Point and spot only. */
|
|
13
|
+
distance?: number;
|
|
14
|
+
/** Point and spot only. */
|
|
15
|
+
decay?: number;
|
|
16
|
+
/** Spot only, radians. */
|
|
17
|
+
angle?: number;
|
|
18
|
+
/** Spot only. */
|
|
19
|
+
penumbra?: number;
|
|
20
|
+
/** An axis left out keeps its default, so the editor may write one axis at a time. */
|
|
21
|
+
position?: Partial<Transform3DVector>;
|
|
22
|
+
/** Degrees; code only. */
|
|
23
|
+
rotation?: Partial<Transform3DVector>;
|
|
24
|
+
showHelper?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare function Light({ type, color, intensity, enabled, castShadow, distance, decay, angle, penumbra, position, rotation, showHelper, name: _name, locked: _locked, }: LightProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { KnownComponentProps } from '../../editor-defs/types';
|
|
2
|
+
export declare const PAINTED_FACE_LAYOUTS: readonly ["asIs", "flip", "upsideDown"];
|
|
3
|
+
export type PaintedFaceLayout = (typeof PAINTED_FACE_LAYOUTS)[number];
|
|
4
|
+
export type PaintedFaceProps = KnownComponentProps & {
|
|
5
|
+
/** Painted face image (project path or library URL), laid out like the canonical face texture. */
|
|
6
|
+
src?: string;
|
|
7
|
+
/** Strength, 0..1. Default 1. */
|
|
8
|
+
amount?: number;
|
|
9
|
+
/** How the painted face is laid on the person. Default `asIs`. */
|
|
10
|
+
layout?: PaintedFaceLayout;
|
|
11
|
+
/** Keep the person's own eyes. */
|
|
12
|
+
ownEyes?: boolean;
|
|
13
|
+
/** Keep the person's own mouth. */
|
|
14
|
+
ownMouth?: boolean;
|
|
15
|
+
/** `false` hides it. Default true. */
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A painted face on the tracked face, from an image file. A flat wrapper over
|
|
20
|
+
* `useFaceTexture({ kind: "canonicalTexture", src })` and `FaceTextureLayer`: it
|
|
21
|
+
* never reads the camera face as a source, so live-face swap and mirror modes
|
|
22
|
+
* stay with those two in code.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PaintedFace: ({ src, amount, layout, ownEyes, ownMouth, visible, }: PaintedFaceProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -29,8 +29,10 @@ export * from './HairLock';
|
|
|
29
29
|
export * from './MeshRenderer';
|
|
30
30
|
export * from './Model';
|
|
31
31
|
export * from './Object3D';
|
|
32
|
+
export * from './PaintedFace';
|
|
32
33
|
export * from './ThemeProvider';
|
|
33
34
|
export * from './Button';
|
|
35
|
+
export * from './Light';
|
|
34
36
|
export * from './LightObject';
|
|
35
37
|
export * from './LookAt';
|
|
36
38
|
export * from './Panel';
|