Skip to content

Commit 52cf031

Browse files
committed
backdrop
1 parent 3efbeba commit 52cf031

File tree

25 files changed

+210
-34
lines changed

25 files changed

+210
-34
lines changed

libs/soba/abstractions/src/edges/edges.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NgIf, NgTemplateOutlet } from '@angular/common';
22
import { CUSTOM_ELEMENTS_SCHEMA, Component, ContentChild, Input, TemplateRef, effect } from '@angular/core';
33
import { extend, injectNgtRef, signalStore, type NgtAnyRecord, type NgtLineSegments } from 'angular-three';
4-
import { NgtsSobaContent } from 'angular-three-soba/misc';
4+
import { NgtsSobaContent } from 'angular-three-soba/utils';
55
import * as THREE from 'three';
66
import { LineBasicMaterial, LineSegments } from 'three';
77

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ declare global {
4141
/>
4242
</ngt-orthographic-camera>
4343
<ngt-group #group *ngIf="cameraContent && cameraContent.ngtsCameraContent">
44-
<ng-container *ngTemplateOutlet="cameraContent.template; context: { fbo: fboRef(), group }" />
44+
<ng-container *ngTemplateOutlet="cameraContent.template; context: { fbo: fboRef.nativeElement, group }" />
4545
</ngt-group>
4646
`,
4747
imports: [NgIf, NgTemplateOutlet],

libs/soba/misc/src/animations/animations.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function injectNgtsAnimations(
2525
const mixer = new THREE.AnimationMixer(null!);
2626
const actions = {} as Record<string, THREE.AnimationAction>;
2727
let cached = {} as Record<string, THREE.AnimationAction>;
28+
let object: THREE.Object3D | null = null;
2829

2930
const clips = [] as THREE.AnimationClip[];
3031
const names = [] as string[];
@@ -34,10 +35,12 @@ export function injectNgtsAnimations(
3435
cached = {};
3536
// uncache actions
3637
Object.values(actions).forEach((action) => {
37-
mixer.uncacheAction(action as unknown as THREE.AnimationClip, actualRef.untracked);
38+
mixer.uncacheAction(action as unknown as THREE.AnimationClip, object!);
3839
});
3940
// stop all actions
4041
mixer.stopAllAction();
42+
43+
object = null;
4144
});
4245

4346
injectBeforeRender(({ delta }) => mixer.update(delta));
@@ -47,6 +50,7 @@ export function injectNgtsAnimations(
4750
effect(() => {
4851
const actual = actualRef.nativeElement;
4952
if (!actual) return;
53+
object = actual;
5054
const animations = animationsFactory();
5155

5256
for (let i = 0; i < animations.length; i++) {

libs/soba/misc/src/caustics/caustics.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import { NgIf } from '@angular/common';
22
import { Component, computed, CUSTOM_ELEMENTS_SCHEMA, effect, ElementRef, Input } from '@angular/core';
33
import { extend, injectNgtRef, injectNgtStore, NgtGroup, signalStore } from 'angular-three';
44
import { NgtsEdges } from 'angular-three-soba/abstractions';
5-
import { injectNgtsFBO, NgtsSobaContent } from 'angular-three-soba/misc';
65
import { CausticsMaterial, CausticsProjectionMaterial } from 'angular-three-soba/shaders';
6+
import { NgtsSobaContent } from 'angular-three-soba/utils';
77
import * as THREE from 'three';
88
import { Group, LineBasicMaterial, Mesh, OrthographicCamera, PlaneGeometry, Scene } from 'three';
99
import { FullScreenQuad } from 'three-stdlib';
10+
import { injectNgtsFBO } from '../fbo/fbo';
1011

1112
extend({ Group, Scene, Mesh, PlaneGeometry, OrthographicCamera, CausticsProjectionMaterial, LineBasicMaterial });
1213

libs/soba/misc/src/html/html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import {
2020
type NgtRef,
2121
type NgtVector3,
2222
} from 'angular-three';
23+
import { NgtsSobaContent } from 'angular-three-soba/utils';
2324
import * as THREE from 'three';
2425
import { Group, Mesh, PlaneGeometry, ShaderMaterial } from 'three';
25-
import { NgtsSobaContent } from '../content/content';
2626
import { NgtsHtmlWrapper, defaultCalculatePosition } from './html-wrapper';
2727

2828
extend({ Group, PlaneGeometry, Mesh, ShaderMaterial });

libs/soba/misc/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export * from './animations/animations';
22
export * from './bake-shadows/bake-shadows';
33
export * from './caustics/caustics';
4-
export * from './content/content';
54
export * from './decal/decal';
65
export * from './depth-buffer/depth-buffer';
76
export * from './example/example';

libs/soba/performances/src/points/points-input.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Directive, Input } from '@angular/core';
1+
import { Directive, Input, computed } from '@angular/core';
22
import { injectNgtRef, signalStore } from 'angular-three';
33
import type { Points } from 'three';
44

@@ -53,6 +53,8 @@ export abstract class NgtsPointsInput {
5353
range = this.inputs.select('range');
5454
positions = this.inputs.select('positions');
5555
colors = this.inputs.select('colors');
56+
colorsLength = computed(() => this.colors()?.length || 0);
5657
sizes = this.inputs.select('sizes');
58+
sizesLength = computed(() => this.sizes()?.length || 0);
5759
stride = this.inputs.select('stride');
5860
}

libs/soba/performances/src/points/points.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
type NgtPoints,
2828
type NgtRef,
2929
} from 'angular-three';
30-
import { NgtsSobaContent } from 'angular-three-soba/misc';
30+
import { NgtsSobaContent } from 'angular-three-soba/utils';
3131
import * as THREE from 'three';
3232
import { BufferAttribute, BufferGeometry, Points } from 'three';
3333
import { NgtsPointsInput, type NgtsPointsBuffersState, type NgtsPointsInstancesState } from './points-input';
@@ -240,14 +240,14 @@ export class NgtsPoint implements OnInit {
240240
/>
241241
<ngt-buffer-attribute
242242
attach="attributes.color"
243-
[count]="pointsInput.colors().length / pointsInput.stride()"
243+
[count]="pointsInput.colorsLength() / pointsInput.stride()"
244244
[array]="pointsInput.colors()"
245245
[itemSize]="pointsInput.stride()"
246246
[usage]="DynamicDrawUsage"
247247
/>
248248
<ngt-buffer-attribute
249249
attach="attributes.size"
250-
[count]="pointsInput.sizes().length / pointsInput.stride()"
250+
[count]="pointsInput.sizesLength() / pointsInput.stride()"
251251
[array]="pointsInput.sizes()"
252252
[itemSize]="1"
253253
[usage]="DynamicDrawUsage"

libs/soba/project.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
"libs/soba/materials/**/*.ts",
7171
"libs/soba/materials/**/*.html",
7272
"libs/soba/modifiers/**/*.ts",
73-
"libs/soba/modifiers/**/*.html"
73+
"libs/soba/modifiers/**/*.html",
74+
"libs/soba/utils/**/*.ts",
75+
"libs/soba/utils/**/*.html"
7476
]
7577
}
7678
},

libs/soba/src/misc/html.stories.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { CUSTOM_ELEMENTS_SCHEMA, Component, Input } from '@angular/core';
22
import { NgtArgs, injectNgtRef } from 'angular-three';
3-
import { NgtsHtml, NgtsSobaContent } from 'angular-three-soba/misc';
3+
import { NgtsHtml } from 'angular-three-soba/misc';
4+
import { NgtsSobaContent } from 'angular-three-soba/utils';
45
import { Mesh } from 'three';
56
import { makeDecorators, makeStoryFunction, makeStoryObject, turn } from '../setup-canvas';
67

0 commit comments

Comments
 (0)