File tree Expand file tree Collapse file tree 4 files changed +9
-17
lines changed
libs/soba/cameras/src/lib Expand file tree Collapse file tree 4 files changed +9
-17
lines changed Original file line number Diff line number Diff line change 1- import { Directive , Signal } from '@angular/core' ;
1+ import { Directive } from '@angular/core' ;
22import * as THREE from 'three' ;
33
44@Directive ( { selector : 'ng-template[cameraContent]' } )
55export class NgtsCameraContent {
6- static ngTemplateContextGuard ( _ : NgtsCameraContent , ctx : unknown ) : ctx is { $implicit : Signal < THREE . Texture > } {
6+ static ngTemplateContextGuard ( _ : NgtsCameraContent , ctx : unknown ) : ctx is { $implicit : THREE . Texture } {
77 return true ;
88 }
99}
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ const defaultOptions: NgtsCubeCameraOptions = {
9898 <ngt-group #group>
9999 <ng-container
100100 [ngTemplateOutlet]="cameraContent() ?? null"
101- [ngTemplateOutletContext]="{ $implicit: texture }"
101+ [ngTemplateOutletContext]="{ $implicit: texture() }"
102102 />
103103 </ngt-group>
104104 </ngt-group>
Original file line number Diff line number Diff line change @@ -53,10 +53,7 @@ const defaultOptions: NgtsOrthographicCameraOptions = {
5353 </ngt-orthographic-camera>
5454
5555 <ngt-group #group>
56- <ng-container
57- [ngTemplateOutlet]="cameraContent() ?? null"
58- [ngTemplateOutletContext]="{ $implicit: texture }"
59- />
56+ <ng-container [ngTemplateOutlet]="cameraContent() ?? null" [ngTemplateOutletContext]="{ $implicit: fbo }" />
6057 </ngt-group>
6158 ` ,
6259 imports : [ NgTemplateOutlet ] ,
@@ -98,8 +95,7 @@ export class NgtsOrthographicCamera {
9895 private makeDefault = pick ( this . options , 'makeDefault' ) ;
9996 private resolution = pick ( this . options , 'resolution' ) ;
10097
101- private fbo = injectFBO ( ( ) => ( { width : this . resolution ( ) } ) ) ;
102- protected texture = pick ( this . fbo , 'texture' ) ;
98+ protected fbo = injectFBO ( ( ) => ( { width : this . resolution ( ) } ) ) ;
10399
104100 constructor ( ) {
105101 extend ( { OrthographicCamera, Group } ) ;
@@ -132,7 +128,7 @@ export class NgtsOrthographicCamera {
132128 this . options ( ) ,
133129 this . groupRef ( ) . nativeElement ,
134130 this . cameraRef ( ) . nativeElement ,
135- this . fbo ( ) ,
131+ this . fbo ,
136132 ] ;
137133 if ( this . cameraContent ( ) && group && camera && fbo && ( frames === Infinity || count < frames ) ) {
138134 group . visible = false ;
Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ const defaultOptions: NgtsPerspectiveCameraOptions = {
4545 </ngt-perspective-camera>
4646
4747 <ngt-group #group>
48- <ng-container
49- [ngTemplateOutlet]="cameraContent() ?? null"
50- [ngTemplateOutletContext]="{ $implicit: texture }"
51- />
48+ <ng-container [ngTemplateOutlet]="cameraContent() ?? null" [ngTemplateOutletContext]="{ $implicit: fbo }" />
5249 </ngt-group>
5350 ` ,
5451 imports : [ NgTemplateOutlet ] ,
@@ -70,8 +67,7 @@ export class NgtsPerspectiveCamera {
7067 private manual = pick ( this . options , 'manual' ) ;
7168 private makeDefault = pick ( this . options , 'makeDefault' ) ;
7269 private resolution = pick ( this . options , 'resolution' ) ;
73- private fbo = injectFBO ( ( ) => ( { width : this . resolution ( ) } ) ) ;
74- protected texture = pick ( this . fbo , 'texture' ) ;
70+ protected fbo = injectFBO ( ( ) => ( { width : this . resolution ( ) } ) ) ;
7571
7672 constructor ( ) {
7773 extend ( { PerspectiveCamera, Group } ) ;
@@ -108,7 +104,7 @@ export class NgtsPerspectiveCamera {
108104 this . options ( ) ,
109105 this . groupRef ( ) . nativeElement ,
110106 this . cameraRef ( ) . nativeElement ,
111- this . fbo ( ) ,
107+ this . fbo ,
112108 ] ;
113109 if ( this . cameraContent ( ) && group && camera && fbo && ( frames === Infinity || count < frames ) ) {
114110 group . visible = false ;
You can’t perform that action at this time.
0 commit comments