@iwsdk/core 0.1.0 → 0.2.1
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/dist/camera/camera-source.d.ts +61 -0
- package/dist/camera/camera-source.d.ts.map +1 -0
- package/dist/camera/camera-source.js +40 -0
- package/dist/camera/camera-source.js.map +1 -0
- package/dist/camera/camera-system.d.ts +139 -0
- package/dist/camera/camera-system.d.ts.map +1 -0
- package/dist/camera/camera-system.js +210 -0
- package/dist/camera/camera-system.js.map +1 -0
- package/dist/camera/camera-utils.d.ts +63 -0
- package/dist/camera/camera-utils.d.ts.map +1 -0
- package/dist/camera/camera-utils.js +141 -0
- package/dist/camera/camera-utils.js.map +1 -0
- package/dist/camera/index.d.ts +11 -0
- package/dist/camera/index.d.ts.map +1 -0
- package/dist/camera/types.d.ts +28 -0
- package/dist/camera/types.d.ts.map +1 -0
- package/dist/camera/types.js +23 -0
- package/dist/camera/types.js.map +1 -0
- package/dist/grab/distance-grabbable.d.ts +6 -0
- package/dist/grab/distance-grabbable.d.ts.map +1 -1
- package/dist/grab/distance-grabbable.js +6 -0
- package/dist/grab/distance-grabbable.js.map +1 -1
- package/dist/grab/handles.d.ts +2 -0
- package/dist/grab/handles.d.ts.map +1 -1
- package/dist/grab/handles.js +34 -11
- package/dist/grab/handles.js.map +1 -1
- package/dist/grab/pointer-events-patch.d.ts.map +1 -1
- package/dist/grab/pointer-events-patch.js +34 -7
- package/dist/grab/pointer-events-patch.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/init/world-initializer.d.ts +4 -0
- package/dist/init/world-initializer.d.ts.map +1 -1
- package/dist/init/world-initializer.js +15 -2
- package/dist/init/world-initializer.js.map +1 -1
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/html.js +128 -0
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/html.js.map +1 -0
- package/dist/node_modules/.pnpm/{@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_ → @pmndrs_uikitml@0.1.7_super-three@0.177.0}/node_modules/@pmndrs/uikitml/dist/interpreter/index.js +34 -27
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.1.7_super-three@0.177.0/node_modules/@pmndrs/uikitml/dist/interpreter/index.js.map +1 -0
- package/dist/physics/physics-system.d.ts +32 -0
- package/dist/physics/physics-system.d.ts.map +1 -1
- package/dist/physics/physics-system.js +15 -6
- package/dist/physics/physics-system.js.map +1 -1
- package/dist/physics/physicsBody.d.ts +9 -0
- package/dist/physics/physicsBody.d.ts.map +1 -1
- package/dist/physics/physicsBody.js +4 -1
- package/dist/physics/physicsBody.js.map +1 -1
- package/dist/scene-understanding/scene-understanding-system.d.ts.map +1 -1
- package/dist/scene-understanding/scene-understanding-system.js +5 -5
- package/dist/scene-understanding/scene-understanding-system.js.map +1 -1
- package/dist/transform/transform.d.ts.map +1 -1
- package/dist/transform/transform.js +1 -0
- package/dist/transform/transform.js.map +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/ui.d.ts +27 -0
- package/dist/ui/ui.d.ts.map +1 -1
- package/dist/ui/ui.js +21 -3
- package/dist/ui/ui.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -6
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/index.js +0 -13
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@pmndrs_uikitml@0.0.10_@pmndrs_uikit@1.0.32_super-three@0.177.0_/node_modules/@pmndrs/uikitml/dist/interpreter/index.js.map +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { Types } from '../ecs/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* CameraSource - Component for accessing device cameras
|
|
10
|
+
* Provides VideoTexture for rendering and HTMLVideoElement for advanced use
|
|
11
|
+
*/
|
|
12
|
+
export declare const CameraSource: import("elics").Component<{
|
|
13
|
+
deviceId: {
|
|
14
|
+
type: Types.String;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
facing: {
|
|
18
|
+
type: Types.Enum;
|
|
19
|
+
enum: {
|
|
20
|
+
readonly Back: "back";
|
|
21
|
+
readonly Front: "front";
|
|
22
|
+
readonly Unknown: "unknown";
|
|
23
|
+
};
|
|
24
|
+
default: "unknown";
|
|
25
|
+
};
|
|
26
|
+
width: {
|
|
27
|
+
type: Types.Int16;
|
|
28
|
+
default: number;
|
|
29
|
+
};
|
|
30
|
+
height: {
|
|
31
|
+
type: Types.Int16;
|
|
32
|
+
default: number;
|
|
33
|
+
};
|
|
34
|
+
frameRate: {
|
|
35
|
+
type: Types.Int16;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
38
|
+
state: {
|
|
39
|
+
type: Types.Enum;
|
|
40
|
+
enum: {
|
|
41
|
+
readonly Inactive: "inactive";
|
|
42
|
+
readonly Starting: "starting";
|
|
43
|
+
readonly Active: "active";
|
|
44
|
+
readonly Error: "error";
|
|
45
|
+
};
|
|
46
|
+
default: "inactive";
|
|
47
|
+
};
|
|
48
|
+
texture: {
|
|
49
|
+
type: Types.Object;
|
|
50
|
+
default: null;
|
|
51
|
+
};
|
|
52
|
+
videoElement: {
|
|
53
|
+
type: Types.Object;
|
|
54
|
+
default: null;
|
|
55
|
+
};
|
|
56
|
+
stream: {
|
|
57
|
+
type: Types.Object;
|
|
58
|
+
default: null;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
//# sourceMappingURL=camera-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-source.d.ts","sourceRoot":"","sources":["../../src/camera/camera-source.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAGzD;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBxB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import '@preact/signals-core';
|
|
2
|
+
import '../ecs/world.js';
|
|
3
|
+
import { createComponent, Types } from 'elics';
|
|
4
|
+
import '../ecs/component-registry.js';
|
|
5
|
+
import { CameraState, CameraFacing } from './types.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* CameraSource - Component for accessing device cameras
|
|
15
|
+
* Provides VideoTexture for rendering and HTMLVideoElement for advanced use
|
|
16
|
+
*/
|
|
17
|
+
const CameraSource = createComponent('CameraSource', {
|
|
18
|
+
// Input (set by user)
|
|
19
|
+
deviceId: { type: Types.String, default: '' }, // Empty = auto-select based on facing
|
|
20
|
+
facing: {
|
|
21
|
+
type: Types.Enum,
|
|
22
|
+
enum: CameraFacing,
|
|
23
|
+
default: CameraFacing.Unknown,
|
|
24
|
+
}, // 'front' | 'back' | 'unknown' - used for auto-selection (unknown = any camera)
|
|
25
|
+
width: { type: Types.Int16, default: 1920 },
|
|
26
|
+
height: { type: Types.Int16, default: 1080 },
|
|
27
|
+
frameRate: { type: Types.Int16, default: 30 },
|
|
28
|
+
// Output (managed by system, read-only for users)
|
|
29
|
+
state: {
|
|
30
|
+
type: Types.Enum,
|
|
31
|
+
enum: CameraState,
|
|
32
|
+
default: CameraState.Inactive,
|
|
33
|
+
}, // 'inactive' | 'starting' | 'active' | 'error'
|
|
34
|
+
texture: { type: Types.Object, default: null }, // VideoTexture
|
|
35
|
+
videoElement: { type: Types.Object, default: null }, // HTMLVideoElement (for advanced use)
|
|
36
|
+
stream: { type: Types.Object, default: null }, // MediaStream (internal)
|
|
37
|
+
}, 'Camera video source with texture output');
|
|
38
|
+
|
|
39
|
+
export { CameraSource };
|
|
40
|
+
//# sourceMappingURL=camera-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-source.js","sources":["../../src/camera/camera-source.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;;;AAKG;AAKH;;;AAGG;AACI,MAAM,YAAY,GAAG,eAAe,CACzC,cAAc,EACd;;AAEE,IAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AAC7C,IAAA,MAAM,EAAE;QACN,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,QAAA,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,YAAY,CAAC,OAAO;AAC9B,KAAA;IACD,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;IAC3C,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;IAC5C,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;;AAG7C,IAAA,KAAK,EAAE;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,QAAA,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,WAAW,CAAC,QAAQ;AAC9B,KAAA;AACD,IAAA,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AAC9C,IAAA,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AACnD,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;CAC9C,EACD,yCAAyC;;;;"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
declare const CameraSystem_base: import("elics").SystemConstructor<import("elics").SystemSchema, {
|
|
8
|
+
cameras: {
|
|
9
|
+
required: import("elics").Component<{
|
|
10
|
+
deviceId: {
|
|
11
|
+
type: import("elics/lib/types.js").Types.String;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
facing: {
|
|
15
|
+
type: import("elics/lib/types.js").Types.Enum;
|
|
16
|
+
enum: {
|
|
17
|
+
readonly Back: "back";
|
|
18
|
+
readonly Front: "front";
|
|
19
|
+
readonly Unknown: "unknown";
|
|
20
|
+
};
|
|
21
|
+
default: "unknown";
|
|
22
|
+
};
|
|
23
|
+
width: {
|
|
24
|
+
type: import("elics/lib/types.js").Types.Int16;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
height: {
|
|
28
|
+
type: import("elics/lib/types.js").Types.Int16;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
frameRate: {
|
|
32
|
+
type: import("elics/lib/types.js").Types.Int16;
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
state: {
|
|
36
|
+
type: import("elics/lib/types.js").Types.Enum;
|
|
37
|
+
enum: {
|
|
38
|
+
readonly Inactive: "inactive";
|
|
39
|
+
readonly Starting: "starting";
|
|
40
|
+
readonly Active: "active";
|
|
41
|
+
readonly Error: "error";
|
|
42
|
+
};
|
|
43
|
+
default: "inactive";
|
|
44
|
+
};
|
|
45
|
+
texture: {
|
|
46
|
+
type: import("elics/lib/types.js").Types.Object;
|
|
47
|
+
default: null;
|
|
48
|
+
};
|
|
49
|
+
videoElement: {
|
|
50
|
+
type: import("elics/lib/types.js").Types.Object;
|
|
51
|
+
default: null;
|
|
52
|
+
};
|
|
53
|
+
stream: {
|
|
54
|
+
type: import("elics/lib/types.js").Types.Object;
|
|
55
|
+
default: null;
|
|
56
|
+
};
|
|
57
|
+
}>[];
|
|
58
|
+
};
|
|
59
|
+
}, import("../ecs/world.js").World, import("../ecs/system.js").System<import("elics").SystemSchema, {
|
|
60
|
+
cameras: {
|
|
61
|
+
required: import("elics").Component<{
|
|
62
|
+
deviceId: {
|
|
63
|
+
type: import("elics/lib/types.js").Types.String;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
facing: {
|
|
67
|
+
type: import("elics/lib/types.js").Types.Enum;
|
|
68
|
+
enum: {
|
|
69
|
+
readonly Back: "back";
|
|
70
|
+
readonly Front: "front";
|
|
71
|
+
readonly Unknown: "unknown";
|
|
72
|
+
};
|
|
73
|
+
default: "unknown";
|
|
74
|
+
};
|
|
75
|
+
width: {
|
|
76
|
+
type: import("elics/lib/types.js").Types.Int16;
|
|
77
|
+
default: number;
|
|
78
|
+
};
|
|
79
|
+
height: {
|
|
80
|
+
type: import("elics/lib/types.js").Types.Int16;
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
83
|
+
frameRate: {
|
|
84
|
+
type: import("elics/lib/types.js").Types.Int16;
|
|
85
|
+
default: number;
|
|
86
|
+
};
|
|
87
|
+
state: {
|
|
88
|
+
type: import("elics/lib/types.js").Types.Enum;
|
|
89
|
+
enum: {
|
|
90
|
+
readonly Inactive: "inactive";
|
|
91
|
+
readonly Starting: "starting";
|
|
92
|
+
readonly Active: "active";
|
|
93
|
+
readonly Error: "error";
|
|
94
|
+
};
|
|
95
|
+
default: "inactive";
|
|
96
|
+
};
|
|
97
|
+
texture: {
|
|
98
|
+
type: import("elics/lib/types.js").Types.Object;
|
|
99
|
+
default: null;
|
|
100
|
+
};
|
|
101
|
+
videoElement: {
|
|
102
|
+
type: import("elics/lib/types.js").Types.Object;
|
|
103
|
+
default: null;
|
|
104
|
+
};
|
|
105
|
+
stream: {
|
|
106
|
+
type: import("elics/lib/types.js").Types.Object;
|
|
107
|
+
default: null;
|
|
108
|
+
};
|
|
109
|
+
}>[];
|
|
110
|
+
};
|
|
111
|
+
}>>;
|
|
112
|
+
/**
|
|
113
|
+
* CameraSystem - Manages camera stream lifecycle for CameraSource components
|
|
114
|
+
* Automatically starts streams when XR session is active, stops when inactive
|
|
115
|
+
*
|
|
116
|
+
* System is stateless - all state is stored in CameraSource components
|
|
117
|
+
*/
|
|
118
|
+
export declare class CameraSystem extends CameraSystem_base {
|
|
119
|
+
init(): void;
|
|
120
|
+
update(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Start camera stream for an entity
|
|
123
|
+
* Async operation - sets state to Starting, then Active when complete
|
|
124
|
+
* Users should check state or null-check texture/videoElement before using
|
|
125
|
+
*
|
|
126
|
+
* Checks state after each async operation to abort if stopCamera was called
|
|
127
|
+
*/
|
|
128
|
+
private startCamera;
|
|
129
|
+
/**
|
|
130
|
+
* Stop camera stream for an entity
|
|
131
|
+
*/
|
|
132
|
+
private stopCamera;
|
|
133
|
+
/**
|
|
134
|
+
* Clean up camera resources (stream, video element, texture)
|
|
135
|
+
*/
|
|
136
|
+
private cleanupCameraResources;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=camera-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-system.d.ts","sourceRoot":"","sources":["../../src/camera/camera-system.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,iBAEhC;IACA,IAAI;IAWJ,MAAM;IAkBN;;;;;;OAMG;YACW,WAAW;IAsJzB;;OAEG;IACH,OAAO,CAAC,UAAU;IAuBlB;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAgB/B"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { createSystem } from '../ecs/system.js';
|
|
2
|
+
import { VisibilityState } from '../ecs/world.js';
|
|
3
|
+
import 'elics';
|
|
4
|
+
import '../ecs/component-registry.js';
|
|
5
|
+
import '../runtime/three.js';
|
|
6
|
+
import { CameraSource } from './camera-source.js';
|
|
7
|
+
import { CameraUtils } from './camera-utils.js';
|
|
8
|
+
import { CameraState, CameraFacing } from './types.js';
|
|
9
|
+
import { VideoTexture, LinearFilter } from 'three';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* CameraSystem - Manages camera stream lifecycle for CameraSource components
|
|
19
|
+
* Automatically starts streams when XR session is active, stops when inactive
|
|
20
|
+
*
|
|
21
|
+
* System is stateless - all state is stored in CameraSource components
|
|
22
|
+
*/
|
|
23
|
+
class CameraSystem extends createSystem({
|
|
24
|
+
cameras: { required: [CameraSource] },
|
|
25
|
+
}) {
|
|
26
|
+
init() {
|
|
27
|
+
// Stop all cameras when leaving XR
|
|
28
|
+
this.world.visibilityState.subscribe((state) => {
|
|
29
|
+
if (state !== VisibilityState.Visible) {
|
|
30
|
+
for (const entity of this.queries.cameras.entities) {
|
|
31
|
+
this.stopCamera(entity);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
update() {
|
|
37
|
+
// Only manage cameras when XR is active
|
|
38
|
+
const isXRActive = this.world.visibilityState.value === VisibilityState.Visible;
|
|
39
|
+
if (!isXRActive) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
for (const entity of this.queries.cameras.entities) {
|
|
43
|
+
const state = entity.getValue(CameraSource, 'state');
|
|
44
|
+
// Start camera if inactive (not started or errored)
|
|
45
|
+
if (state === CameraState.Inactive || state === CameraState.Error) {
|
|
46
|
+
this.startCamera(entity);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Start camera stream for an entity
|
|
52
|
+
* Async operation - sets state to Starting, then Active when complete
|
|
53
|
+
* Users should check state or null-check texture/videoElement before using
|
|
54
|
+
*
|
|
55
|
+
* Checks state after each async operation to abort if stopCamera was called
|
|
56
|
+
*/
|
|
57
|
+
async startCamera(entity) {
|
|
58
|
+
// Set state to Starting to prevent duplicate attempts
|
|
59
|
+
entity.setValue(CameraSource, 'state', CameraState.Starting);
|
|
60
|
+
try {
|
|
61
|
+
let deviceId = entity.getValue(CameraSource, 'deviceId');
|
|
62
|
+
// Auto-select camera if no deviceId provided
|
|
63
|
+
if (!deviceId) {
|
|
64
|
+
const devices = await CameraUtils.getDevices();
|
|
65
|
+
// Check if we should abort (stopCamera was called during async operation)
|
|
66
|
+
const currentState = entity.getValue(CameraSource, 'state');
|
|
67
|
+
if (currentState !== CameraState.Starting) {
|
|
68
|
+
return; // Aborted
|
|
69
|
+
}
|
|
70
|
+
const facing = entity.getValue(CameraSource, 'facing');
|
|
71
|
+
if (facing === CameraFacing.Unknown) {
|
|
72
|
+
// Unknown = any camera is fine, use first available
|
|
73
|
+
if (devices.length > 0) {
|
|
74
|
+
deviceId = devices[0].deviceId;
|
|
75
|
+
entity.setValue(CameraSource, 'deviceId', deviceId);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.error('No cameras available');
|
|
79
|
+
entity.setValue(CameraSource, 'state', CameraState.Error);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Specific facing requested - must match or fail
|
|
85
|
+
const selected = CameraUtils.findByFacing(devices, facing);
|
|
86
|
+
if (selected) {
|
|
87
|
+
deviceId = selected.deviceId;
|
|
88
|
+
entity.setValue(CameraSource, 'deviceId', deviceId);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const facingStr = facing === CameraFacing.Back ? 'back' : 'front';
|
|
92
|
+
console.error(`No ${facingStr}-facing camera available (found ${devices.length} camera(s))`);
|
|
93
|
+
entity.setValue(CameraSource, 'state', CameraState.Error);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Get stream constraints
|
|
99
|
+
const width = entity.getValue(CameraSource, 'width');
|
|
100
|
+
const height = entity.getValue(CameraSource, 'height');
|
|
101
|
+
const frameRate = entity.getValue(CameraSource, 'frameRate');
|
|
102
|
+
// Request camera stream
|
|
103
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
104
|
+
video: {
|
|
105
|
+
deviceId: { exact: deviceId },
|
|
106
|
+
width: { ideal: width },
|
|
107
|
+
height: { ideal: height },
|
|
108
|
+
frameRate: { ideal: frameRate },
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
// Check if we should abort after getting stream
|
|
112
|
+
const currentState = entity.getValue(CameraSource, 'state');
|
|
113
|
+
if (currentState !== CameraState.Starting) {
|
|
114
|
+
// Aborted - clean up the stream we just created
|
|
115
|
+
this.cleanupCameraResources(stream, null, null);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// Create video element
|
|
119
|
+
const video = document.createElement('video');
|
|
120
|
+
video.setAttribute('playsinline', '');
|
|
121
|
+
video.setAttribute('autoplay', '');
|
|
122
|
+
video.muted = true;
|
|
123
|
+
video.srcObject = stream;
|
|
124
|
+
// Wait for video to be ready
|
|
125
|
+
await new Promise((resolve, reject) => {
|
|
126
|
+
const onCanPlay = () => {
|
|
127
|
+
video.removeEventListener('canplay', onCanPlay);
|
|
128
|
+
video.removeEventListener('error', onError);
|
|
129
|
+
resolve();
|
|
130
|
+
};
|
|
131
|
+
const onError = (error) => {
|
|
132
|
+
video.removeEventListener('canplay', onCanPlay);
|
|
133
|
+
video.removeEventListener('error', onError);
|
|
134
|
+
reject(error);
|
|
135
|
+
};
|
|
136
|
+
video.addEventListener('canplay', onCanPlay);
|
|
137
|
+
video.addEventListener('error', onError);
|
|
138
|
+
});
|
|
139
|
+
// Check if we should abort after video ready
|
|
140
|
+
const finalState = entity.getValue(CameraSource, 'state');
|
|
141
|
+
if (finalState !== CameraState.Starting) {
|
|
142
|
+
// Aborted - clean up everything
|
|
143
|
+
this.cleanupCameraResources(stream, video, null);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
// Start playback
|
|
147
|
+
await video.play();
|
|
148
|
+
// Create VideoTexture
|
|
149
|
+
const texture = new VideoTexture(video);
|
|
150
|
+
texture.minFilter = LinearFilter;
|
|
151
|
+
texture.magFilter = LinearFilter;
|
|
152
|
+
// Final check before committing - ensure state is still Starting
|
|
153
|
+
const committingState = entity.getValue(CameraSource, 'state');
|
|
154
|
+
if (committingState !== CameraState.Starting) {
|
|
155
|
+
// Aborted at the last moment - clean up everything
|
|
156
|
+
this.cleanupCameraResources(stream, video, texture);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
// Commit all resources atomically
|
|
160
|
+
entity.setValue(CameraSource, 'stream', stream);
|
|
161
|
+
entity.setValue(CameraSource, 'videoElement', video);
|
|
162
|
+
entity.setValue(CameraSource, 'texture', texture);
|
|
163
|
+
entity.setValue(CameraSource, 'state', CameraState.Active);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
console.error('Failed to start camera:', error);
|
|
167
|
+
// Clean up any partial state
|
|
168
|
+
const stream = entity.getValue(CameraSource, 'stream');
|
|
169
|
+
const video = entity.getValue(CameraSource, 'videoElement');
|
|
170
|
+
const texture = entity.getValue(CameraSource, 'texture');
|
|
171
|
+
this.cleanupCameraResources(stream, video, texture);
|
|
172
|
+
entity.setValue(CameraSource, 'stream', null);
|
|
173
|
+
entity.setValue(CameraSource, 'videoElement', null);
|
|
174
|
+
entity.setValue(CameraSource, 'texture', null);
|
|
175
|
+
entity.setValue(CameraSource, 'state', CameraState.Error);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Stop camera stream for an entity
|
|
180
|
+
*/
|
|
181
|
+
stopCamera(entity) {
|
|
182
|
+
const stream = entity.getValue(CameraSource, 'stream');
|
|
183
|
+
const video = entity.getValue(CameraSource, 'videoElement');
|
|
184
|
+
const texture = entity.getValue(CameraSource, 'texture');
|
|
185
|
+
this.cleanupCameraResources(stream, video, texture);
|
|
186
|
+
// Clear component values and set state to Inactive
|
|
187
|
+
entity.setValue(CameraSource, 'stream', null);
|
|
188
|
+
entity.setValue(CameraSource, 'videoElement', null);
|
|
189
|
+
entity.setValue(CameraSource, 'texture', null);
|
|
190
|
+
entity.setValue(CameraSource, 'state', CameraState.Inactive);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Clean up camera resources (stream, video element, texture)
|
|
194
|
+
*/
|
|
195
|
+
cleanupCameraResources(stream, video, texture) {
|
|
196
|
+
if (stream) {
|
|
197
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
198
|
+
}
|
|
199
|
+
if (video) {
|
|
200
|
+
video.pause();
|
|
201
|
+
video.srcObject = null;
|
|
202
|
+
}
|
|
203
|
+
if (texture) {
|
|
204
|
+
texture.dispose();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export { CameraSystem };
|
|
210
|
+
//# sourceMappingURL=camera-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-system.js","sources":["../../src/camera/camera-system.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAQH;;;;;AAKG;AACG,MAAO,YAAa,SAAQ,YAAY,CAAC;AAC7C,IAAA,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE;CACtC,CAAC,CAAA;IACA,IAAI,GAAA;;QAEF,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,KAAK,KAAI;AAC7C,YAAA,IAAI,KAAK,KAAK,eAAe,CAAC,OAAO,EAAE;gBACrC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;AAClD,oBAAA,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;gBACzB;YACF;AACF,QAAA,CAAC,CAAC;IACJ;IAEA,MAAM,GAAA;;AAEJ,QAAA,MAAM,UAAU,GACd,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,KAAK,eAAe,CAAC,OAAO;QAC9D,IAAI,CAAC,UAAU,EAAE;YACf;QACF;QAEA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;YAClD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAoB;;AAGvE,YAAA,IAAI,KAAK,KAAK,WAAW,CAAC,QAAQ,IAAI,KAAK,KAAK,WAAW,CAAC,KAAK,EAAE;AACjE,gBAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YAC1B;QACF;IACF;AAEA;;;;;;AAMG;IACK,MAAM,WAAW,CAAC,MAAc,EAAA;;QAEtC,MAAM,CAAC,QAAQ,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EACZ,cAAc,CACY;QAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAC7B,YAAY,EACZ,SAAS,CACa;QAExB,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;;QAGnD,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC;QAC7C,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,cAAc,EAAE,IAAI,CAAC;QACnD,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,EAAE,IAAI,CAAC;QAC9C,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC;IAC9D;AAEA;;AAEG;AACK,IAAA,sBAAsB,CAC5B,MAA0B,EAC1B,KAA8B,EAC9B,OAA4B,EAAA;QAE5B,IAAI,MAAM,EAAE;AACV,YAAA,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QACrD;QACA,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,KAAK,EAAE;AACb,YAAA,KAAK,CAAC,SAAS,GAAG,IAAI;QACxB;QACA,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,OAAO,EAAE;QACnB;IACF;AACD;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { Entity } from '../ecs/index.js';
|
|
8
|
+
import { type CameraDeviceInfo, type CameraFacingType } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* CameraUtils - Static utilities for camera discovery and selection
|
|
11
|
+
* Handles permission requests and device enumeration with caching
|
|
12
|
+
*/
|
|
13
|
+
export declare class CameraUtils {
|
|
14
|
+
private static cachedDevices;
|
|
15
|
+
/**
|
|
16
|
+
* Get available camera devices
|
|
17
|
+
*
|
|
18
|
+
* On first call or if refresh=true:
|
|
19
|
+
* - Requests camera permission (if not granted)
|
|
20
|
+
* - Enumerates all video input devices
|
|
21
|
+
* - Caches results for subsequent calls
|
|
22
|
+
*
|
|
23
|
+
* On subsequent calls with refresh=false:
|
|
24
|
+
* - Returns cached results immediately
|
|
25
|
+
*
|
|
26
|
+
* @param refresh - Force re-enumeration (useful for hot-plugged devices)
|
|
27
|
+
* @returns Array of available camera devices
|
|
28
|
+
*/
|
|
29
|
+
static getDevices(refresh?: boolean): Promise<CameraDeviceInfo[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Find camera by facing direction from device list
|
|
32
|
+
*/
|
|
33
|
+
static findByFacing(devices: CameraDeviceInfo[], facing: CameraFacingType): CameraDeviceInfo | null;
|
|
34
|
+
/**
|
|
35
|
+
* Check if camera permission is granted (doesn't request)
|
|
36
|
+
*/
|
|
37
|
+
static hasPermission(): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Capture current video frame as a canvas
|
|
40
|
+
* Returns canvas at full video resolution, ready for processing
|
|
41
|
+
*
|
|
42
|
+
* @param entity - Entity with CameraSource component
|
|
43
|
+
* @returns HTMLCanvasElement or null if camera not ready
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // Simple texture creation
|
|
47
|
+
* const canvas = CameraUtils.captureFrame(cameraEntity);
|
|
48
|
+
* if (canvas) {
|
|
49
|
+
* const texture = new CanvasTexture(canvas);
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // With post-processing
|
|
54
|
+
* const canvas = CameraUtils.captureFrame(cameraEntity);
|
|
55
|
+
* if (canvas) {
|
|
56
|
+
* const ctx = canvas.getContext('2d');
|
|
57
|
+
* ctx.filter = 'blur(2px)';
|
|
58
|
+
* const texture = new CanvasTexture(canvas);
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
static captureFrame(entity: Entity): HTMLCanvasElement | null;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=camera-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-utils.d.ts","sourceRoot":"","sources":["../../src/camera/camera-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAgB,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExF;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,aAAa,CAAmC;IAE/D;;;;;;;;;;;;;OAaG;WACU,UAAU,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAoDrE;;OAEG;IACH,MAAM,CAAC,YAAY,CACjB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,MAAM,EAAE,gBAAgB,GACvB,gBAAgB,GAAG,IAAI;IAI1B;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAY9C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;CA+B9D"}
|