Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6b61706

Browse files
committedJan 2, 2025
feat(soba): adjust cameras
1 parent 5aa1b0c commit 6b61706

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎libs/soba/cameras/src/lib/orthographic-camera.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Component,
66
ElementRef,
77
TemplateRef,
8-
afterNextRender,
98
computed,
109
contentChild,
1110
effect,
@@ -102,7 +101,7 @@ export class NgtsOrthographicCamera {
102101
constructor() {
103102
extend({ OrthographicCamera, Group });
104103

105-
afterNextRender(() => {
104+
effect(() => {
106105
this.cameraRef().nativeElement.updateProjectionMatrix();
107106
});
108107

‎libs/soba/cameras/src/lib/perspective-camera.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Component,
66
ElementRef,
77
TemplateRef,
8-
afterNextRender,
98
contentChild,
109
effect,
1110
input,
@@ -78,7 +77,7 @@ export class NgtsPerspectiveCamera {
7877
constructor() {
7978
extend({ PerspectiveCamera, Group });
8079

81-
afterNextRender(() => {
80+
effect(() => {
8281
this.cameraRef().nativeElement.updateProjectionMatrix();
8382
});
8483

@@ -98,7 +97,7 @@ export class NgtsPerspectiveCamera {
9897
this.store.update({ camera: this.cameraRef().nativeElement });
9998
onCleanup(() => this.store.update(() => ({ camera: oldCam })));
10099
});
101-
100+
/**/
102101
let count = 0;
103102
let oldEnvMap: Color | Texture | null = null;
104103
injectBeforeRender(({ gl, scene }) => {

0 commit comments

Comments
 (0)
Please sign in to comment.