Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 089da91

Browse files
committed
docs(soba): update storybook
1 parent 966bdc7 commit 089da91

File tree

3 files changed

+7
-31
lines changed

3 files changed

+7
-31
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SpinningThing {
3535
3636
<ngt-mesh>
3737
<ngt-box-geometry *args="[3, 3, 3]" />
38-
<ngt-mesh-standard-material [map]="target.nativeElement?.texture" />
38+
<ngt-mesh-standard-material [map]="texture()" />
3939
</ngt-mesh>
4040
`,
4141
imports: [SpinningThing, NgtsPerspectiveCamera, NgtPortal, NgtPortalContent, NgtArgs],
@@ -63,11 +63,12 @@ class DefaultFBOStory {
6363
return scene;
6464
});
6565

66-
target = injectNgtsFBO(() => ({ width: this.inputs.select('fboParams')() }));
66+
private target = injectNgtsFBO(() => ({ width: this.inputs.select('fboParams')() }));
67+
texture = computed(() => this.target()?.texture);
6768

6869
constructor() {
6970
injectBeforeRender((state) => {
70-
const [camera, target, scene] = [this.cameraRef.nativeElement, this.target.nativeElement, this.scene()];
71+
const [camera, target, scene] = [this.cameraRef.nativeElement, this.target(), this.scene()];
7172
if (!target) return;
7273
camera.position.z = 5 + Math.sin(state.clock.getElapsedTime() * 1.5) * 2;
7374
state.gl.setRenderTarget(target);

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

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class InjectNgtsTrailInstanceStory {
6262
});
6363

6464
injectBeforeRender(() => {
65-
const [instanced, positions] = [this.instancedRef.nativeElement, this.positions.nativeElement];
66-
if (!instanced || !positions) return;
65+
const [instanced, positions] = [this.instancedRef.nativeElement, this.positions()];
66+
if (!instanced) return;
6767

6868
for (let i = 0; i < 1000; i += 1) {
6969
const x = positions.slice(i * 3, i * 3 + 3);
@@ -130,28 +130,3 @@ const canvasOptions = makeCanvasOptions({ camera: { position: [0, 0, 5] } });
130130
export const Default = makeStoryFunction(DefaultTrailStory, canvasOptions);
131131
export const TrailsWithInstance = makeStoryFunction(InjectNgtsTrailInstanceStory, canvasOptions);
132132
export const TrailWithFloat = makeStoryFunction(TrailFloatStory, canvasOptions);
133-
134-
// function UseTrailFloat() {
135-
// const ref = React.useRef(null!)
136-
// return (
137-
// <>
138-
// <Trail
139-
// width={1}
140-
// length={4}
141-
// color={'#F8D628'}
142-
// attenuation={(t: number) => {
143-
// return t * t
144-
// }}
145-
// target={ref}
146-
// />
147-
// <Float speed={5} floatIntensity={10} ref={ref}>
148-
// <Sphere args={[0.1, 32, 32]} position-x={0}>
149-
// <meshNormalMaterial />
150-
// </Sphere>
151-
// </Float>
152-
// </>
153-
// )
154-
// }
155-
//
156-
// export const TrailFloat = () => <UseTrailFloat />
157-
// TrailFloat.storyName = 'Trail with Ref target'

libs/soba/src/staging/spot-light.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ShadowsSpotLightStory {
115115
@Component({
116116
standalone: true,
117117
template: `
118-
<ng-container *ngIf="depthBuffer.nativeElement as depthBuffer">
118+
<ng-container *ngIf="depthBuffer() as depthBuffer">
119119
<ngts-spot-light
120120
[penumbra]="0.5"
121121
[depthBuffer]="depthBuffer"

0 commit comments

Comments
 (0)