angular-three-soba 1.10.0 → 1.11.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.
Files changed (77) hide show
  1. package/abstractions/index.d.ts +1 -0
  2. package/abstractions/lib/edges/edges.d.ts +18 -0
  3. package/cameras/index.d.ts +1 -0
  4. package/cameras/lib/camera/camera-content.d.ts +1 -1
  5. package/cameras/lib/cube-camera/cube-camera.d.ts +27 -0
  6. package/esm2020/abstractions/index.mjs +2 -1
  7. package/esm2020/abstractions/lib/edges/edges.mjs +95 -0
  8. package/esm2020/abstractions/lib/gizmo-helper/gizmo-helper.mjs +8 -3
  9. package/esm2020/abstractions/lib/text-3d/text-3d.mjs +1 -1
  10. package/esm2020/cameras/index.mjs +2 -1
  11. package/esm2020/cameras/lib/camera/camera-content.mjs +1 -1
  12. package/esm2020/cameras/lib/cube-camera/cube-camera.mjs +130 -0
  13. package/esm2020/materials/index.mjs +3 -1
  14. package/esm2020/materials/lib/mesh-refraction-material/mesh-refraction-material.mjs +157 -0
  15. package/esm2020/materials/lib/mesh-transmission-material/mesh-transmission-material.mjs +237 -0
  16. package/esm2020/misc/lib/fbo/fbo.mjs +5 -4
  17. package/esm2020/performance/lib/detailed/detailed.mjs +6 -3
  18. package/esm2020/shaders/index.mjs +6 -1
  19. package/esm2020/shaders/lib/caustics-material/caustics-material.mjs +128 -0
  20. package/esm2020/shaders/lib/caustics-projection-material/caustics-projection-material.mjs +33 -0
  21. package/esm2020/shaders/lib/discard-material/discard-material.mjs +3 -0
  22. package/esm2020/shaders/lib/mesh-transmission-material/mesh-transmission-material.mjs +268 -0
  23. package/esm2020/shaders/lib/soft-shadow-material/soft-shadow-material.mjs +33 -0
  24. package/esm2020/staging/index.mjs +2 -1
  25. package/esm2020/staging/lib/accumulative-shadows/accumulative-shadows.mjs +7 -38
  26. package/esm2020/staging/lib/accumulative-shadows/progressive-light-map.mjs +2 -3
  27. package/esm2020/staging/lib/accumulative-shadows/randomized-lights.mjs +6 -6
  28. package/esm2020/staging/lib/caustics/caustics.mjs +363 -0
  29. package/esm2020/staging/lib/center/center.mjs +6 -6
  30. package/fesm2015/angular-three-soba-abstractions.mjs +98 -4
  31. package/fesm2015/angular-three-soba-abstractions.mjs.map +1 -1
  32. package/fesm2015/angular-three-soba-cameras.mjs +127 -4
  33. package/fesm2015/angular-three-soba-cameras.mjs.map +1 -1
  34. package/fesm2015/angular-three-soba-materials.mjs +386 -2
  35. package/fesm2015/angular-three-soba-materials.mjs.map +1 -1
  36. package/fesm2015/angular-three-soba-misc.mjs +4 -3
  37. package/fesm2015/angular-three-soba-misc.mjs.map +1 -1
  38. package/fesm2015/angular-three-soba-performance.mjs +5 -2
  39. package/fesm2015/angular-three-soba-performance.mjs.map +1 -1
  40. package/fesm2015/angular-three-soba-shaders.mjs +485 -31
  41. package/fesm2015/angular-three-soba-shaders.mjs.map +1 -1
  42. package/fesm2015/angular-three-soba-staging.mjs +376 -53
  43. package/fesm2015/angular-three-soba-staging.mjs.map +1 -1
  44. package/fesm2020/angular-three-soba-abstractions.mjs +98 -4
  45. package/fesm2020/angular-three-soba-abstractions.mjs.map +1 -1
  46. package/fesm2020/angular-three-soba-cameras.mjs +127 -4
  47. package/fesm2020/angular-three-soba-cameras.mjs.map +1 -1
  48. package/fesm2020/angular-three-soba-materials.mjs +384 -2
  49. package/fesm2020/angular-three-soba-materials.mjs.map +1 -1
  50. package/fesm2020/angular-three-soba-misc.mjs +4 -3
  51. package/fesm2020/angular-three-soba-misc.mjs.map +1 -1
  52. package/fesm2020/angular-three-soba-performance.mjs +5 -2
  53. package/fesm2020/angular-three-soba-performance.mjs.map +1 -1
  54. package/fesm2020/angular-three-soba-shaders.mjs +491 -34
  55. package/fesm2020/angular-three-soba-shaders.mjs.map +1 -1
  56. package/fesm2020/angular-three-soba-staging.mjs +375 -53
  57. package/fesm2020/angular-three-soba-staging.mjs.map +1 -1
  58. package/materials/index.d.ts +2 -0
  59. package/materials/lib/mesh-refraction-material/mesh-refraction-material.d.ts +28 -0
  60. package/materials/lib/mesh-transmission-material/mesh-transmission-material.d.ts +46 -0
  61. package/misc/lib/fbo/fbo.d.ts +8 -6
  62. package/package.json +3 -4
  63. package/performance/lib/detailed/detailed.d.ts +2 -1
  64. package/plugin/package.json +1 -1
  65. package/shaders/index.d.ts +5 -0
  66. package/shaders/lib/caustics-material/caustics-material.d.ts +4 -0
  67. package/shaders/lib/caustics-projection-material/caustics-projection-material.d.ts +4 -0
  68. package/shaders/lib/discard-material/discard-material.d.ts +3 -0
  69. package/shaders/lib/mesh-transmission-material/mesh-transmission-material.d.ts +25 -0
  70. package/shaders/lib/soft-shadow-material/soft-shadow-material.d.ts +10 -0
  71. package/staging/index.d.ts +1 -0
  72. package/staging/lib/accumulative-shadows/accumulative-shadows.d.ts +2 -8
  73. package/staging/lib/accumulative-shadows/randomized-lights.d.ts +1 -1
  74. package/staging/lib/caustics/caustics.d.ts +47 -0
  75. package/staging/lib/environment/environment-cube.d.ts +1 -1
  76. package/staging/lib/environment/environment-ground.d.ts +1 -1
  77. package/staging/lib/environment/utils.d.ts +1 -1
@@ -2,11 +2,10 @@ import * as i0 from '@angular/core';
2
2
  import { Component, CUSTOM_ELEMENTS_SCHEMA, Input, Directive, inject, InjectionToken, EventEmitter, TemplateRef, Output, ContentChild } from '@angular/core';
3
3
  import { extend, NgtRxStore, injectNgtRef, NgtStore, startWithUndefined, NgtArgs, NgtPortal, NgtPortalContent, NgtRepeat, NgtPush } from 'angular-three';
4
4
  import * as THREE from 'three';
5
- import { Group, CatmullRomCurve3, Vector3, Quaternion, Object3D, Matrix4, Mesh, BoxGeometry, MeshBasicMaterial, MeshLambertMaterial, CanvasTexture, AmbientLight, PointLight, Sprite, SpriteMaterial } from 'three';
5
+ import { Group, CatmullRomCurve3, LineSegments, LineBasicMaterial, Vector3, Quaternion, Object3D, Matrix4, Mesh, BoxGeometry, MeshBasicMaterial, MeshLambertMaterial, CanvasTexture, AmbientLight, PointLight, Sprite, SpriteMaterial } from 'three';
6
6
  import { combineLatest, map, switchMap, of } from 'rxjs';
7
7
  import { LineMaterial, LineSegmentsGeometry, LineGeometry, LineSegments2, Line2, TextGeometry, FontLoader } from 'three-stdlib';
8
8
  import { NgIf, NgTemplateOutlet, DOCUMENT, NgFor } from '@angular/common';
9
- import { selectSlice } from '@rx-angular/state';
10
9
  import { NgtsOrthographicCamera } from 'angular-three-soba/cameras';
11
10
  import { RxActionFactory } from '@rx-angular/state/actions';
12
11
  import { Text, preloadFont } from 'troika-three-text';
@@ -479,6 +478,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
479
478
  type: Input
480
479
  }] } });
481
480
 
481
+ extend({ LineSegments, LineBasicMaterial });
482
+ class NgtsEdges extends NgtRxStore {
483
+ constructor() {
484
+ super(...arguments);
485
+ this.edgesRef = injectNgtRef();
486
+ this.withChildren = false;
487
+ this.noop = () => null;
488
+ }
489
+ set threshold(threshold) {
490
+ this.set({ threshold });
491
+ }
492
+ set color(color) {
493
+ this.set({ color });
494
+ }
495
+ set geometry(geometry) {
496
+ this.set({ geometry });
497
+ }
498
+ set userData(userData) {
499
+ this.set({ userData });
500
+ }
501
+ initialize() {
502
+ super.initialize();
503
+ this.set({
504
+ threshold: 15,
505
+ color: 'black',
506
+ userData: {},
507
+ });
508
+ }
509
+ ngOnInit() {
510
+ this.setupGeometry();
511
+ }
512
+ setupGeometry() {
513
+ this.hold(this.edgesRef.$, (segments) => {
514
+ const parent = segments.parent;
515
+ if (parent) {
516
+ const geom = this.get('geometry') || parent.geometry;
517
+ const threshold = this.get('threshold');
518
+ if (geom !== segments.userData['currentGeom'] || threshold !== segments.userData['currentThreshold']) {
519
+ segments.userData['currentGeom'] = geom;
520
+ segments.userData['currentThreshold'] = threshold;
521
+ segments.geometry = new THREE.EdgesGeometry(geom, threshold);
522
+ }
523
+ }
524
+ });
525
+ }
526
+ }
527
+ NgtsEdges.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: NgtsEdges, deps: null, target: i0.ɵɵFactoryTarget.Component });
528
+ NgtsEdges.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.0", type: NgtsEdges, isStandalone: true, selector: "ngts-edges", inputs: { edgesRef: "edgesRef", threshold: "threshold", color: "color", geometry: "geometry", userData: "userData", withChildren: "withChildren" }, usesInheritance: true, ngImport: i0, template: `
529
+ <ngt-line-segments [ref]="edgesRef" [raycast]="noop" ngtCompound>
530
+ <ng-container *ngIf="withChildren; else noChildren">
531
+ <ng-content />
532
+ </ng-container>
533
+ <ng-template #noChildren>
534
+ <ngt-line-basic-material [color]="color" />
535
+ </ng-template>
536
+ </ngt-line-segments>
537
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: NgtsEdges, decorators: [{
539
+ type: Component,
540
+ args: [{
541
+ selector: 'ngts-edges',
542
+ standalone: true,
543
+ template: `
544
+ <ngt-line-segments [ref]="edgesRef" [raycast]="noop" ngtCompound>
545
+ <ng-container *ngIf="withChildren; else noChildren">
546
+ <ng-content />
547
+ </ng-container>
548
+ <ng-template #noChildren>
549
+ <ngt-line-basic-material [color]="color" />
550
+ </ng-template>
551
+ </ngt-line-segments>
552
+ `,
553
+ imports: [NgIf],
554
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
555
+ }]
556
+ }], propDecorators: { edgesRef: [{
557
+ type: Input
558
+ }], threshold: [{
559
+ type: Input
560
+ }], color: [{
561
+ type: Input
562
+ }], geometry: [{
563
+ type: Input
564
+ }], userData: [{
565
+ type: Input
566
+ }], withChildren: [{
567
+ type: Input
568
+ }] } });
569
+
482
570
  const isOrbitControls = (controls) => {
483
571
  return 'minPolarAngle' in controls;
484
572
  };
@@ -595,7 +683,13 @@ class NgtsGizmoHelper extends NgtRxStore {
595
683
  }
596
684
  }
597
685
  setGizmoPosition() {
598
- this.connect('gizmoPosition', combineLatest([this.store.select('size'), this.select(selectSlice(['alignment', 'margin']))]).pipe(map(([size, { alignment, margin }]) => {
686
+ this.connect('gizmoPosition', combineLatest([
687
+ this.store.select('size'),
688
+ combineLatest({
689
+ alignment: this.select('alignment'),
690
+ margin: this.select('margin'),
691
+ }),
692
+ ]).pipe(map(([size, { alignment, margin }]) => {
599
693
  const [marginX, marginY] = margin;
600
694
  const x = alignment.endsWith('-center')
601
695
  ? 0
@@ -1947,5 +2041,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
1947
2041
  * Generated bundle index. Do not edit.
1948
2042
  */
1949
2043
 
1950
- export { NGTS_GIZMO_HELPER_API, NgtsBillboard, NgtsCatmullRomLine, NgtsCubicBezierLine, NgtsGizmoHelper, NgtsGizmoHelperContent, NgtsGizmoViewcube, NgtsGizmoViewport, NgtsLine, NgtsQuadraticBezierLine, NgtsText, NgtsText3D };
2044
+ export { NGTS_GIZMO_HELPER_API, NgtsBillboard, NgtsCatmullRomLine, NgtsCubicBezierLine, NgtsEdges, NgtsGizmoHelper, NgtsGizmoHelperContent, NgtsGizmoViewcube, NgtsGizmoViewport, NgtsLine, NgtsQuadraticBezierLine, NgtsText, NgtsText3D };
1951
2045
  //# sourceMappingURL=angular-three-soba-abstractions.mjs.map