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' ;
2
2
import * as THREE from 'three' ;
3
3
4
4
@Directive ( { selector : 'ng-template[cameraContent]' } )
5
5
export 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 } {
7
7
return true ;
8
8
}
9
9
}
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ const defaultOptions: NgtsCubeCameraOptions = {
98
98
<ngt-group #group>
99
99
<ng-container
100
100
[ngTemplateOutlet]="cameraContent() ?? null"
101
- [ngTemplateOutletContext]="{ $implicit: texture }"
101
+ [ngTemplateOutletContext]="{ $implicit: texture() }"
102
102
/>
103
103
</ngt-group>
104
104
</ngt-group>
Original file line number Diff line number Diff line change @@ -53,10 +53,7 @@ const defaultOptions: NgtsOrthographicCameraOptions = {
53
53
</ngt-orthographic-camera>
54
54
55
55
<ngt-group #group>
56
- <ng-container
57
- [ngTemplateOutlet]="cameraContent() ?? null"
58
- [ngTemplateOutletContext]="{ $implicit: texture }"
59
- />
56
+ <ng-container [ngTemplateOutlet]="cameraContent() ?? null" [ngTemplateOutletContext]="{ $implicit: fbo }" />
60
57
</ngt-group>
61
58
` ,
62
59
imports : [ NgTemplateOutlet ] ,
@@ -98,8 +95,7 @@ export class NgtsOrthographicCamera {
98
95
private makeDefault = pick ( this . options , 'makeDefault' ) ;
99
96
private resolution = pick ( this . options , 'resolution' ) ;
100
97
101
- private fbo = injectFBO ( ( ) => ( { width : this . resolution ( ) } ) ) ;
102
- protected texture = pick ( this . fbo , 'texture' ) ;
98
+ protected fbo = injectFBO ( ( ) => ( { width : this . resolution ( ) } ) ) ;
103
99
104
100
constructor ( ) {
105
101
extend ( { OrthographicCamera, Group } ) ;
@@ -132,7 +128,7 @@ export class NgtsOrthographicCamera {
132
128
this . options ( ) ,
133
129
this . groupRef ( ) . nativeElement ,
134
130
this . cameraRef ( ) . nativeElement ,
135
- this . fbo ( ) ,
131
+ this . fbo ,
136
132
] ;
137
133
if ( this . cameraContent ( ) && group && camera && fbo && ( frames === Infinity || count < frames ) ) {
138
134
group . visible = false ;
Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ const defaultOptions: NgtsPerspectiveCameraOptions = {
45
45
</ngt-perspective-camera>
46
46
47
47
<ngt-group #group>
48
- <ng-container
49
- [ngTemplateOutlet]="cameraContent() ?? null"
50
- [ngTemplateOutletContext]="{ $implicit: texture }"
51
- />
48
+ <ng-container [ngTemplateOutlet]="cameraContent() ?? null" [ngTemplateOutletContext]="{ $implicit: fbo }" />
52
49
</ngt-group>
53
50
` ,
54
51
imports : [ NgTemplateOutlet ] ,
@@ -70,8 +67,7 @@ export class NgtsPerspectiveCamera {
70
67
private manual = pick ( this . options , 'manual' ) ;
71
68
private makeDefault = pick ( this . options , 'makeDefault' ) ;
72
69
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 ( ) } ) ) ;
75
71
76
72
constructor ( ) {
77
73
extend ( { PerspectiveCamera, Group } ) ;
@@ -108,7 +104,7 @@ export class NgtsPerspectiveCamera {
108
104
this . options ( ) ,
109
105
this . groupRef ( ) . nativeElement ,
110
106
this . cameraRef ( ) . nativeElement ,
111
- this . fbo ( ) ,
107
+ this . fbo ,
112
108
] ;
113
109
if ( this . cameraContent ( ) && group && camera && fbo && ( frames === Infinity || count < frames ) ) {
114
110
group . visible = false ;
You can’t perform that action at this time.
0 commit comments