@3dsource/angular-unreal-module 0.0.44 → 0.0.49
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 +0 -0
- package/README.md +105 -50
- package/fesm2022/3dsource-angular-unreal-module.mjs +557 -366
- package/fesm2022/3dsource-angular-unreal-module.mjs.map +1 -1
- package/index.d.ts +210 -96
- package/package.json +7 -7
- package/index.d.ts.map +0 -1
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# @3dsource/angular-unreal-module
|
|
2
2
|
|
|
3
|
-
A standalone Angular
|
|
4
|
-
communication between Angular applications and Unreal Engine, enabling interactive 3D experiences.
|
|
3
|
+
A set of standalone Angular components, services, and providers for integrating Unreal Engine (WebRTC) scenes into Angular applications. It facilitates communication between Angular and Unreal Engine and enables interactive 3D experiences.
|
|
5
4
|
|
|
6
5
|
## Overview
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
This package provides:
|
|
9
8
|
|
|
10
|
-
-
|
|
11
|
-
- Communication bridge
|
|
12
|
-
-
|
|
13
|
-
-
|
|
9
|
+
- Standalone Unreal scene component to embed UE stream
|
|
10
|
+
- Communication bridge (commands, UI interactions, input data)
|
|
11
|
+
- NgRx state and effects for 3D stream lifecycle
|
|
12
|
+
- Config and utilities for telemetry, errors, and regions ping
|
|
14
13
|
|
|
15
14
|
## Installation
|
|
16
15
|
|
|
@@ -21,82 +20,138 @@ The Angular Unreal Module provides:
|
|
|
21
20
|
|
|
22
21
|
### Peer Dependencies
|
|
23
22
|
|
|
24
|
-
This library requires the following peer dependencies:
|
|
23
|
+
This library requires the following peer dependencies (match or exceed versions):
|
|
25
24
|
|
|
26
25
|
```json
|
|
27
26
|
{
|
|
28
|
-
"@3dsource/source-ui-native": "
|
|
29
|
-
"@3dsource/types-unreal": "
|
|
30
|
-
"@3dsource/utils": "
|
|
31
|
-
"@angular/cdk": "
|
|
32
|
-
"@angular/common": "
|
|
33
|
-
"@angular/core": "
|
|
34
|
-
"@angular/forms": "
|
|
35
|
-
"@ngrx/effects": "
|
|
36
|
-
"@ngrx/
|
|
37
|
-
"@ngrx/store": "^19.1.0"
|
|
27
|
+
"@3dsource/source-ui-native": ">=1.0.9",
|
|
28
|
+
"@3dsource/types-unreal": ">=0.0.5",
|
|
29
|
+
"@3dsource/utils": ">=1.0.21",
|
|
30
|
+
"@angular/cdk": ">=19.0.0",
|
|
31
|
+
"@angular/common": ">=19.0.0",
|
|
32
|
+
"@angular/core": ">=19.0.0",
|
|
33
|
+
"@angular/forms": ">=19.0.0",
|
|
34
|
+
"@ngrx/effects": ">=19.0.0",
|
|
35
|
+
"@ngrx/store": ">=19.0.0"
|
|
38
36
|
}
|
|
39
37
|
```
|
|
40
38
|
|
|
41
39
|
### Library Installation
|
|
42
40
|
|
|
43
41
|
```shell
|
|
44
|
-
|
|
42
|
+
npm i @3dsource/angular-unreal-module
|
|
45
43
|
```
|
|
46
44
|
|
|
47
45
|
## Usage
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
The API is fully standalone (no NgModule). Use providers and components as shown below.
|
|
48
|
+
|
|
49
|
+
### 1) Provide the module services and store slice
|
|
50
|
+
|
|
51
|
+
Add providers in your application bootstrap (e.g., app.config.ts):
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { ApplicationConfig } from '@angular/core';
|
|
55
|
+
import { provideRouter } from '@angular/router';
|
|
56
|
+
import { provideStore } from '@ngrx/store';
|
|
57
|
+
import { provideEffects } from '@ngrx/effects';
|
|
58
|
+
import { provideAngularUnrealModule, UNREAL_CONFIG } from '@3dsource/angular-unreal-module';
|
|
59
|
+
|
|
60
|
+
export const appConfig: ApplicationConfig = {
|
|
61
|
+
providers: [
|
|
62
|
+
provideRouter([]),
|
|
63
|
+
// Root NgRx (if not already added in your app)
|
|
64
|
+
provideStore(),
|
|
65
|
+
provideEffects(),
|
|
66
|
+
|
|
67
|
+
// Unreal providers (adds feature state and effects internally)
|
|
68
|
+
...provideAngularUnrealModule(),
|
|
69
|
+
|
|
70
|
+
// Optional initial config
|
|
71
|
+
{
|
|
72
|
+
provide: UNREAL_CONFIG,
|
|
73
|
+
useValue: {
|
|
74
|
+
// customErrorsEndpoint?: string,
|
|
75
|
+
// commandTelemetryReceiver?: string,
|
|
76
|
+
// regionsPingUrl?: string,
|
|
77
|
+
// screenLockerContainerId?: string,
|
|
78
|
+
// dataChannelConnectionTimeout?: number,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
```
|
|
50
84
|
|
|
51
|
-
|
|
85
|
+
### 2) Use the Unreal scene component
|
|
52
86
|
|
|
53
|
-
|
|
54
|
-
import { UnrealModule } from '@3dsource/angular-unreal-module';
|
|
87
|
+
Import the component into a standalone component and use it in the template.
|
|
55
88
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
89
|
+
```ts
|
|
90
|
+
import { Component } from '@angular/core';
|
|
91
|
+
import { UnrealSceneComponent } from '@3dsource/angular-unreal-module';
|
|
92
|
+
|
|
93
|
+
@Component({
|
|
94
|
+
selector: 'app-root',
|
|
95
|
+
standalone: true,
|
|
96
|
+
imports: [UnrealSceneComponent],
|
|
97
|
+
template: ` <app-unreal-scene [isStudio]="false" [useContainerAsSizeProvider]="true" [studioResolutionSize]="{ width: 1920, height: 1080 }" (changeMouseOverScene)="onHover($event)"></app-unreal-scene> `,
|
|
62
98
|
})
|
|
63
|
-
export class
|
|
99
|
+
export class AppComponent {
|
|
100
|
+
onHover(isOver: boolean) {
|
|
101
|
+
// handle mouse over scene
|
|
102
|
+
}
|
|
103
|
+
}
|
|
64
104
|
```
|
|
65
105
|
|
|
66
|
-
|
|
106
|
+
Component selector: <app-unreal-scene>
|
|
67
107
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
108
|
+
Inputs:
|
|
109
|
+
|
|
110
|
+
- isStudio: boolean = false
|
|
111
|
+
- useContainerAsSizeProvider: boolean = true
|
|
112
|
+
- studioResolutionSize: { width: number; height: number } = { width: 1920, height: 1080 }
|
|
113
|
+
|
|
114
|
+
Outputs:
|
|
71
115
|
|
|
72
|
-
|
|
116
|
+
- changeMouseOverScene: EventEmitter<boolean>
|
|
73
117
|
|
|
74
|
-
|
|
118
|
+
### 3) Send commands / interactions to Unreal
|
|
75
119
|
|
|
76
|
-
|
|
77
|
-
import { UnrealService } from '@3dsource/angular-unreal-module';
|
|
120
|
+
Use UnrealCommunicatorService to send commands or UI interactions. Types for command packets are provided by @3dsource/types-unreal.
|
|
78
121
|
|
|
79
|
-
|
|
122
|
+
```ts
|
|
123
|
+
import { Component, inject } from '@angular/core';
|
|
124
|
+
import { UnrealCommunicatorService } from '@3dsource/angular-unreal-module';
|
|
125
|
+
import type { MetaBoxCommandPacket } from '@3dsource/types-unreal';
|
|
126
|
+
|
|
127
|
+
@Component({ standalone: true, template: '' })
|
|
80
128
|
export class MyComponent {
|
|
81
|
-
|
|
82
|
-
}
|
|
129
|
+
private unreal = inject(UnrealCommunicatorService);
|
|
83
130
|
|
|
84
|
-
|
|
85
|
-
|
|
131
|
+
sendSomeCommand() {
|
|
132
|
+
const packet: MetaBoxCommandPacket = {
|
|
86
133
|
command: 'SomeCommand',
|
|
87
|
-
parameters: {
|
|
88
|
-
|
|
134
|
+
parameters: {
|
|
135
|
+
/* command parameters */
|
|
136
|
+
},
|
|
137
|
+
} as MetaBoxCommandPacket;
|
|
138
|
+
|
|
139
|
+
// Records telemetry and dispatches store events
|
|
140
|
+
this.unreal.sendCommandToUnreal(packet);
|
|
141
|
+
// Or use:
|
|
142
|
+
// this.unreal.emitCommand(packet); // to send as Command message
|
|
143
|
+
// this.unreal.emitUIInteraction(packet); // to send as UIInteraction
|
|
89
144
|
}
|
|
90
145
|
}
|
|
91
146
|
```
|
|
92
147
|
|
|
93
148
|
## Features
|
|
94
149
|
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
150
|
+
- Standalone Unreal Scene Component
|
|
151
|
+
- Command and UI Interaction API via UnrealCommunicatorService
|
|
152
|
+
- Event-driven status UI (freeze frame, video stats, play overlay)
|
|
153
|
+
- NgRx-powered state management and effects
|
|
154
|
+
- Optional initial configuration via UNREAL_CONFIG token
|
|
100
155
|
|
|
101
156
|
## Examples
|
|
102
157
|
|