angular-three 4.0.0-next.66 → 4.0.0-next.68
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/README.md +21 -21
- package/fesm2022/angular-three.mjs +3 -1
- package/fesm2022/angular-three.mjs.map +1 -1
- package/lib/three-types.d.ts +9 -2
- package/lib/utils/make.d.ts +1 -0
- package/metadata.json +1195 -67
- package/package.json +2 -2
- package/web-types.json +1195 -67
package/README.md
CHANGED
|
@@ -22,10 +22,10 @@ import { extend } from 'angular-three';
|
|
|
22
22
|
import { Mesh, BoxGeometry } from 'three';
|
|
23
23
|
|
|
24
24
|
extend({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
Mesh, // makes ngt-mesh available
|
|
26
|
+
BoxGeometry, // makes ngt-box-geometry available
|
|
27
|
+
/* ... */
|
|
28
|
+
MyMesh: Mesh, // makes ngt-my-mesh available
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
// alternatively for demo purposes, you can use the following
|
|
@@ -33,14 +33,14 @@ extend({
|
|
|
33
33
|
// This includes the entire THREE.js namespace
|
|
34
34
|
|
|
35
35
|
@Component({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
selector: 'app-scene-graph',
|
|
37
|
+
template: `
|
|
38
|
+
<ngt-mesh>
|
|
39
|
+
<ngt-box-geometry />
|
|
40
|
+
</ngt-mesh>
|
|
41
|
+
`,
|
|
42
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA], // required
|
|
43
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
44
44
|
})
|
|
45
45
|
export class SceneGraph {}
|
|
46
46
|
```
|
|
@@ -52,14 +52,14 @@ import { NgtCanvas } from 'angular-three/dom';
|
|
|
52
52
|
import { SceneGraph } from './scene-graph';
|
|
53
53
|
|
|
54
54
|
@Component({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
// This Component is rendered normally in Angular.
|
|
56
|
+
selector: 'app-my-experience',
|
|
57
|
+
template: `
|
|
58
|
+
<ngt-canvas>
|
|
59
|
+
<app-scene-graph *canvasContent />
|
|
60
|
+
</ngt-canvas>
|
|
61
|
+
`,
|
|
62
|
+
imports: [NgtCanvas],
|
|
63
63
|
})
|
|
64
64
|
export class MyExperience {}
|
|
65
65
|
```
|
|
@@ -72,6 +72,6 @@ export class MyExperience {}
|
|
|
72
72
|
import { provideNgtRenderer } from 'angular-three/dom';
|
|
73
73
|
|
|
74
74
|
bootstrapApplication(AppComponent, {
|
|
75
|
-
|
|
75
|
+
providers: [provideNgtRenderer()],
|
|
76
76
|
});
|
|
77
77
|
```
|
|
@@ -332,7 +332,7 @@ function makeCameraInstance(isOrthographic, size) {
|
|
|
332
332
|
return new THREE.PerspectiveCamera(75, size.width / size.height, 0.1, 1000);
|
|
333
333
|
}
|
|
334
334
|
function makeObjectGraph(object) {
|
|
335
|
-
const data = { nodes: {}, materials: {} };
|
|
335
|
+
const data = { nodes: {}, materials: {}, meshes: {} };
|
|
336
336
|
if (object) {
|
|
337
337
|
object.traverse((child) => {
|
|
338
338
|
if (child.name)
|
|
@@ -341,6 +341,8 @@ function makeObjectGraph(object) {
|
|
|
341
341
|
data.materials[child.material.name] = child
|
|
342
342
|
.material;
|
|
343
343
|
}
|
|
344
|
+
if (is.three(child, 'isMesh') && !data.meshes[child.name])
|
|
345
|
+
data.meshes[child.name] = child;
|
|
344
346
|
});
|
|
345
347
|
}
|
|
346
348
|
return data;
|