angular-three-soba 2.0.0-beta.7 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstractions/billboard/billboard.d.ts +11 -7
- package/abstractions/detailed/detailed.d.ts +26 -0
- package/abstractions/edges/edges.d.ts +23 -11
- package/abstractions/grid/grid.d.ts +41 -50
- package/abstractions/index.d.ts +1 -7
- package/abstractions/text/text.d.ts +10 -4
- package/abstractions/text-3d/text-3d.d.ts +47 -40
- package/cameras/camera/camera-content.d.ts +1 -1
- package/cameras/camera/camera.d.ts +16 -13
- package/cameras/cube-camera/cube-camera.d.ts +50 -23
- package/cameras/index.d.ts +0 -1
- package/cameras/orthographic-camera/orthographic-camera.d.ts +29 -18
- package/cameras/perspective-camera/perspective-camera.d.ts +10 -1
- package/controls/orbit-controls/orbit-controls.d.ts +30 -13
- package/esm2022/abstractions/billboard/billboard.mjs +36 -33
- package/esm2022/abstractions/detailed/detailed.mjs +64 -0
- package/esm2022/abstractions/edges/edges.mjs +58 -63
- package/esm2022/abstractions/grid/grid.mjs +140 -110
- package/esm2022/abstractions/index.mjs +2 -8
- package/esm2022/abstractions/text/text.mjs +123 -122
- package/esm2022/abstractions/text-3d/text-3d.mjs +119 -121
- package/esm2022/cameras/camera/camera-content.mjs +5 -6
- package/esm2022/cameras/camera/camera.mjs +48 -42
- package/esm2022/cameras/cube-camera/cube-camera.mjs +129 -99
- package/esm2022/cameras/index.mjs +1 -2
- package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +78 -75
- package/esm2022/cameras/perspective-camera/perspective-camera.mjs +25 -26
- package/esm2022/controls/orbit-controls/orbit-controls.mjs +94 -90
- package/esm2022/loaders/gltf-loader/gltf-loader.mjs +3 -6
- package/esm2022/loaders/loader/loader.mjs +92 -87
- package/esm2022/loaders/progress/progress.mjs +1 -1
- package/esm2022/loaders/texture-loader/texture-loader.mjs +4 -4
- package/esm2022/materials/index.mjs +2 -1
- package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +60 -51
- package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +239 -255
- package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +99 -97
- package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +167 -146
- package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +44 -42
- package/esm2022/materials/point-material/point-material.mjs +46 -0
- package/esm2022/misc/animations/animations.mjs +20 -16
- package/esm2022/misc/bake-shadows/bake-shadows.mjs +13 -13
- package/esm2022/misc/caustics/caustics.mjs +387 -0
- package/esm2022/misc/decal/decal.mjs +187 -0
- package/esm2022/misc/depth-buffer/depth-buffer.mjs +33 -35
- package/esm2022/misc/example/example.mjs +160 -0
- package/esm2022/misc/fbo/fbo.mjs +35 -35
- package/esm2022/misc/html/html-wrapper.mjs +478 -0
- package/esm2022/misc/html/html.mjs +304 -0
- package/esm2022/misc/index.mjs +10 -1
- package/esm2022/misc/sampler/sampler.mjs +142 -0
- package/esm2022/misc/shadow/shadow.mjs +111 -0
- package/esm2022/misc/stats-gl/stats-gl.mjs +61 -0
- package/esm2022/misc/trail/trail.mjs +209 -0
- package/esm2022/misc/trail-texture/inject-trail-texture.mjs +17 -0
- package/esm2022/misc/trail-texture/trail-texture.mjs +106 -0
- package/esm2022/modifiers/angular-three-soba-modifiers.mjs +5 -0
- package/esm2022/modifiers/curve-modifier/curve-modifier.mjs +64 -0
- package/esm2022/modifiers/index.mjs +2 -0
- package/esm2022/performances/adaptive-dpr/adaptive-dpr.mjs +44 -0
- package/esm2022/performances/adaptive-events/adaptive-events.mjs +27 -0
- package/esm2022/performances/angular-three-soba-performances.mjs +5 -0
- package/esm2022/performances/index.mjs +6 -0
- package/esm2022/performances/points/points-input.mjs +64 -0
- package/esm2022/performances/points/points.mjs +329 -0
- package/esm2022/performances/points/position-point.mjs +54 -0
- package/esm2022/performances/segments/segment-object.mjs +9 -0
- package/esm2022/performances/segments/segments.mjs +182 -0
- package/esm2022/shaders/blur-pass/blur-pass.mjs +1 -1
- package/esm2022/shaders/caustics/caustics-material.mjs +130 -0
- package/esm2022/shaders/caustics/caustics-projection-material.mjs +31 -0
- package/esm2022/shaders/convolution-material/convolution-material.mjs +1 -1
- package/esm2022/shaders/discard-material/discard-material.mjs +1 -1
- package/esm2022/shaders/grid-material/grid-material.mjs +29 -14
- package/esm2022/shaders/index.mjs +5 -3
- package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +42 -41
- package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +1 -1
- package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +2 -2
- package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +4 -4
- package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +1 -1
- package/esm2022/shaders/shader-material/shader-material.mjs +1 -1
- package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +17 -25
- package/esm2022/shaders/sparkles-material/sparkles-material.mjs +32 -46
- package/esm2022/shaders/spot-light-material/spot-light-material.mjs +7 -7
- package/esm2022/shaders/star-field-material/star-field-material.mjs +3 -2
- package/esm2022/shaders/wireframe-material/wireframe-material.mjs +247 -0
- package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +160 -176
- package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +1 -1
- package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +126 -128
- package/esm2022/staging/backdrop/backdrop.mjs +77 -0
- package/esm2022/staging/bb-anchor/bb-anchor.mjs +70 -0
- package/esm2022/staging/bounds/bounds.mjs +144 -143
- package/esm2022/staging/camera-shake/camera-shake.mjs +86 -80
- package/esm2022/staging/center/center.mjs +106 -91
- package/esm2022/staging/cloud/cloud.mjs +118 -124
- package/esm2022/staging/contact-shadows/contact-shadows.mjs +131 -134
- package/esm2022/staging/environment/assets.mjs +12 -12
- package/esm2022/staging/environment/environment-cube.mjs +28 -30
- package/esm2022/staging/environment/environment-ground.mjs +18 -20
- package/esm2022/staging/environment/environment-input.mjs +97 -84
- package/esm2022/staging/environment/environment-map.mjs +33 -33
- package/esm2022/staging/environment/environment-portal.mjs +75 -97
- package/esm2022/staging/environment/environment.mjs +34 -51
- package/esm2022/staging/environment/utils.mjs +35 -14
- package/esm2022/staging/float/float.mjs +70 -58
- package/esm2022/staging/index.mjs +7 -3
- package/esm2022/staging/matcap-texture/matcap-texture.mjs +64 -0
- package/esm2022/staging/normal-texture/normal-texture.mjs +53 -0
- package/esm2022/staging/sky/sky.mjs +85 -80
- package/esm2022/staging/sparkles/sparkles.mjs +108 -105
- package/esm2022/staging/spot-light/shadow-mesh-input.mjs +63 -0
- package/esm2022/staging/spot-light/shadow-mesh.mjs +266 -0
- package/esm2022/staging/spot-light/spot-light-input.mjs +67 -58
- package/esm2022/staging/spot-light/spot-light.mjs +51 -64
- package/esm2022/staging/spot-light/volumetric-mesh.mjs +61 -78
- package/esm2022/staging/stage/stage.mjs +304 -290
- package/esm2022/staging/stars/stars.mjs +101 -102
- package/esm2022/staging/wireframe/wireframe-input.mjs +191 -0
- package/esm2022/staging/wireframe/wireframe.mjs +224 -0
- package/esm2022/utils/angular-three-soba-utils.mjs +5 -0
- package/esm2022/utils/content/content.mjs +15 -0
- package/esm2022/utils/index.mjs +2 -0
- package/fesm2022/angular-three-soba-abstractions.mjs +505 -2087
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +302 -259
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-controls.mjs +93 -88
- package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
- package/fesm2022/angular-three-soba-loaders.mjs +94 -90
- package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-materials.mjs +655 -590
- package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +2198 -89
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-modifiers.mjs +71 -0
- package/fesm2022/angular-three-soba-modifiers.mjs.map +1 -0
- package/fesm2022/angular-three-soba-performances.mjs +697 -0
- package/fesm2022/angular-three-soba-performances.mjs.map +1 -0
- package/fesm2022/angular-three-soba-shaders.mjs +501 -264
- package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +2870 -2555
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/fesm2022/angular-three-soba-utils.mjs +22 -0
- package/fesm2022/angular-three-soba-utils.mjs.map +1 -0
- package/loaders/gltf-loader/gltf-loader.d.ts +4 -3
- package/loaders/loader/loader.d.ts +19 -17
- package/loaders/progress/progress.d.ts +1 -1
- package/loaders/texture-loader/texture-loader.d.ts +2 -2
- package/materials/index.d.ts +1 -0
- package/materials/mesh-distort-material/mesh-distort-material.d.ts +25 -15
- package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +74 -56
- package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +33 -21
- package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +55 -39
- package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +19 -10
- package/materials/point-material/point-material.d.ts +24 -0
- package/metadata.json +1 -0
- package/misc/animations/animations.d.ts +6 -4
- package/misc/caustics/caustics.d.ts +87 -0
- package/misc/decal/decal.d.ts +49 -0
- package/misc/depth-buffer/depth-buffer.d.ts +2 -2
- package/misc/example/example.d.ts +81 -0
- package/misc/fbo/fbo.d.ts +2 -2
- package/misc/html/html-wrapper.d.ts +559 -0
- package/misc/html/html.d.ts +214 -0
- package/misc/index.d.ts +9 -0
- package/misc/sampler/sampler.d.ts +67 -0
- package/misc/shadow/shadow.d.ts +37 -0
- package/misc/stats-gl/stats-gl.d.ts +24 -0
- package/misc/trail/trail.d.ts +57 -0
- package/misc/trail-texture/inject-trail-texture.d.ts +9 -0
- package/misc/trail-texture/trail-texture.d.ts +50 -0
- package/modifiers/README.md +3 -0
- package/modifiers/curve-modifier/curve-modifier.d.ts +23 -0
- package/modifiers/index.d.ts +1 -0
- package/package.json +30 -22
- package/performances/README.md +3 -0
- package/performances/adaptive-dpr/adaptive-dpr.d.ts +14 -0
- package/{performance/adaptive → performances/adaptive-events}/adaptive-events.d.ts +3 -0
- package/performances/index.d.ts +5 -0
- package/performances/points/points-input.d.ts +32 -0
- package/performances/points/points.d.ts +92 -0
- package/{performance/instances/position-mesh.d.ts → performances/points/position-point.d.ts} +4 -3
- package/performances/segments/segment-object.d.ts +7 -0
- package/performances/segments/segments.d.ts +124 -0
- package/shaders/grid-material/grid-material.d.ts +33 -0
- package/shaders/index.d.ts +4 -2
- package/shaders/mesh-distort-material/mesh-distort-material.d.ts +146 -1
- package/shaders/mesh-transmission-material/mesh-transmission-material.d.ts +1 -1
- package/shaders/shader-material/shader-material.d.ts +2 -2
- package/shaders/soft-shadow-material/soft-shadow-material.d.ts +10 -1
- package/shaders/sparkles-material/sparkles-material.d.ts +15 -1
- package/shaders/spot-light-material/spot-light-material.d.ts +11 -2
- package/shaders/star-field-material/star-field-material.d.ts +11 -1
- package/shaders/wireframe-material/wireframe-material.d.ts +58 -0
- package/staging/accumulative-shadows/accumulative-shadows.d.ts +89 -39
- package/staging/accumulative-shadows/randomized-lights.d.ts +40 -27
- package/staging/backdrop/backdrop.d.ts +30 -0
- package/staging/bb-anchor/bb-anchor.d.ts +27 -0
- package/staging/bounds/bounds.d.ts +100 -24
- package/staging/camera-shake/camera-shake.d.ts +30 -19
- package/staging/center/center.d.ts +43 -35
- package/staging/cloud/cloud.d.ts +26 -23
- package/staging/contact-shadows/contact-shadows.d.ts +41 -28
- package/staging/environment/assets.d.ts +9 -9
- package/staging/environment/environment-cube.d.ts +9 -5
- package/staging/environment/environment-ground.d.ts +7 -7
- package/staging/environment/environment-input.d.ts +36 -36
- package/staging/environment/environment-map.d.ts +10 -5
- package/staging/environment/environment-portal.d.ts +10 -5
- package/staging/environment/environment.d.ts +0 -4
- package/staging/environment/utils.d.ts +2 -2
- package/staging/float/float.d.ts +14 -10
- package/staging/index.d.ts +6 -2
- package/staging/matcap-texture/matcap-texture.d.ts +13 -0
- package/staging/normal-texture/normal-texture.d.ts +16 -0
- package/staging/sky/sky.d.ts +28 -21
- package/staging/sparkles/sparkles.d.ts +35 -21
- package/staging/spot-light/shadow-mesh-input.d.ts +29 -0
- package/staging/spot-light/shadow-mesh.d.ts +37 -0
- package/staging/spot-light/spot-light-input.d.ts +25 -25
- package/staging/spot-light/spot-light.d.ts +31 -15
- package/staging/spot-light/volumetric-mesh.d.ts +15 -9
- package/staging/stage/stage.d.ts +88 -63
- package/staging/stars/stars.d.ts +27 -16
- package/staging/wireframe/wireframe-input.d.ts +65 -0
- package/staging/wireframe/wireframe.d.ts +28 -0
- package/utils/README.md +3 -0
- package/utils/content/content.d.ts +8 -0
- package/utils/index.d.ts +1 -0
- package/web-types.json +1 -0
- package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +0 -25
- package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +0 -25
- package/abstractions/gizmo-helper/gizmo-helper.d.ts +0 -34
- package/abstractions/gizmo-helper/gizmo-viewcube/constants.d.ts +0 -12
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -22
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -30
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -32
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +0 -14
- package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -47
- package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -40
- package/abstractions/line/line-input.d.ts +0 -42
- package/abstractions/line/line.d.ts +0 -35
- package/abstractions/quadratic-bezier-line/quadratic-bezier-line.d.ts +0 -23
- package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +0 -131
- package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +0 -113
- package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +0 -210
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -95
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -155
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -62
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -80
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -206
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -273
- package/esm2022/abstractions/line/line-input.mjs +0 -113
- package/esm2022/abstractions/line/line.mjs +0 -165
- package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
- package/esm2022/performance/adaptive/adaptive-dpr.mjs +0 -46
- package/esm2022/performance/adaptive/adaptive-events.mjs +0 -31
- package/esm2022/performance/angular-three-soba-performance.mjs +0 -5
- package/esm2022/performance/detailed/detailed.mjs +0 -61
- package/esm2022/performance/index.mjs +0 -7
- package/esm2022/performance/instances/instance.mjs +0 -48
- package/esm2022/performance/instances/instances.mjs +0 -189
- package/esm2022/performance/instances/position-mesh.mjs +0 -52
- package/esm2022/performance/stats/stats.mjs +0 -79
- package/esm2022/shaders/caustics-material/caustics-material.mjs +0 -128
- package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +0 -33
- package/esm2022/staging/caustics/caustisc.mjs +0 -384
- package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +0 -57
- package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +0 -258
- package/fesm2022/angular-three-soba-performance.mjs +0 -487
- package/fesm2022/angular-three-soba-performance.mjs.map +0 -1
- package/performance/README.md +0 -3
- package/performance/adaptive/adaptive-dpr.d.ts +0 -8
- package/performance/detailed/detailed.d.ts +0 -20
- package/performance/index.d.ts +0 -6
- package/performance/instances/instance.d.ts +0 -9
- package/performance/instances/instances.d.ts +0 -35
- package/performance/stats/stats.d.ts +0 -18
- package/plugin/generators.json +0 -19
- package/plugin/libs/plugin/README.md +0 -11
- package/plugin/package.json +0 -9
- package/plugin/src/generators/init/compat.d.ts +0 -2
- package/plugin/src/generators/init/compat.js +0 -6
- package/plugin/src/generators/init/compat.js.map +0 -1
- package/plugin/src/generators/init/init.d.ts +0 -7
- package/plugin/src/generators/init/init.js +0 -28
- package/plugin/src/generators/init/init.js.map +0 -1
- package/plugin/src/generators/init/schema.json +0 -6
- package/plugin/src/index.d.ts +0 -1
- package/plugin/src/index.js +0 -6
- package/plugin/src/index.js.map +0 -1
- package/staging/caustics/caustisc.d.ts +0 -70
- package/staging/spot-light/spot-light-shadow-mesh-input.d.ts +0 -29
- package/staging/spot-light/spot-light-shadow-mesh.d.ts +0 -38
- /package/shaders/{caustics-material → caustics}/caustics-material.d.ts +0 -0
- /package/shaders/{caustics-material → caustics}/caustics-projection-material.d.ts +0 -0
|
@@ -1,76 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { NgIf, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { inject, TemplateRef, Directive, Input, runInInjectionContext, computed, effect, untracked, DestroyRef, ViewContainerRef, Component, CUSTOM_ELEMENTS_SCHEMA, ContentChild, ViewChild } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet, NgIf } from '@angular/common';
|
|
4
|
+
import { assertInjectionContext, injectNgtStore, extend, signalStore, injectNgtRef, injectBeforeRender, NgtArgs } from 'angular-three';
|
|
6
5
|
import * as THREE from 'three';
|
|
7
|
-
import { Group,
|
|
8
|
-
|
|
9
|
-
class NgtsCamera extends NgtSignalStore {
|
|
10
|
-
set makeDefault(makeDefault) {
|
|
11
|
-
this.set({ makeDefault });
|
|
12
|
-
}
|
|
13
|
-
set manual(manual) {
|
|
14
|
-
this.set({ manual });
|
|
15
|
-
}
|
|
16
|
-
set frames(frames) {
|
|
17
|
-
this.set({ frames });
|
|
18
|
-
}
|
|
19
|
-
set resolution(resolution) {
|
|
20
|
-
this.set({ resolution });
|
|
21
|
-
}
|
|
22
|
-
set envMap(envMap) {
|
|
23
|
-
this.set({ envMap });
|
|
24
|
-
}
|
|
25
|
-
#resolution;
|
|
26
|
-
constructor() {
|
|
27
|
-
super({ resolution: 256, frames: Infinity, makeDefault: false, manual: false });
|
|
28
|
-
this.cameraRef = injectNgtRef();
|
|
29
|
-
this.store = inject(NgtStore);
|
|
30
|
-
this.#resolution = this.select('resolution');
|
|
31
|
-
this.fboRef = injectNgtsFBO(() => ({ width: this.#resolution() }));
|
|
32
|
-
requestAnimationFrameInInjectionContext(() => {
|
|
33
|
-
this.#setDefaultCamera();
|
|
34
|
-
this.#updateProjectionMatrix();
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
#setDefaultCamera() {
|
|
38
|
-
const makeDefault = this.select('makeDefault');
|
|
39
|
-
effect((onCleanup) => {
|
|
40
|
-
const camera = this.cameraRef.nativeElement;
|
|
41
|
-
if (camera && makeDefault()) {
|
|
42
|
-
const { camera: oldCamera } = this.store.get();
|
|
43
|
-
this.store.set({ camera });
|
|
44
|
-
onCleanup(() => this.store.set({ camera: oldCamera }));
|
|
45
|
-
}
|
|
46
|
-
}, { allowSignalWrites: true });
|
|
47
|
-
}
|
|
48
|
-
#updateProjectionMatrix() {
|
|
49
|
-
const manual = this.select('manual');
|
|
50
|
-
effect(() => {
|
|
51
|
-
const camera = this.cameraRef.nativeElement;
|
|
52
|
-
if (!manual() && camera)
|
|
53
|
-
camera.updateProjectionMatrix();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsCamera, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
57
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.3", type: NgtsCamera, inputs: { makeDefault: "makeDefault", manual: "manual", frames: "frames", resolution: "resolution", envMap: "envMap", cameraRef: "cameraRef" }, usesInheritance: true, ngImport: i0 }); }
|
|
58
|
-
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsCamera, decorators: [{
|
|
60
|
-
type: Directive
|
|
61
|
-
}], ctorParameters: function () { return []; }, propDecorators: { makeDefault: [{
|
|
62
|
-
type: Input
|
|
63
|
-
}], manual: [{
|
|
64
|
-
type: Input
|
|
65
|
-
}], frames: [{
|
|
66
|
-
type: Input
|
|
67
|
-
}], resolution: [{
|
|
68
|
-
type: Input
|
|
69
|
-
}], envMap: [{
|
|
70
|
-
type: Input
|
|
71
|
-
}], cameraRef: [{
|
|
72
|
-
type: Input
|
|
73
|
-
}] } });
|
|
6
|
+
import { Group, OrthographicCamera, PerspectiveCamera } from 'three';
|
|
7
|
+
import { injectNgtsFBO } from 'angular-three-soba/misc';
|
|
74
8
|
|
|
75
9
|
class NgtsCameraContent {
|
|
76
10
|
constructor() {
|
|
@@ -80,261 +14,370 @@ class NgtsCameraContent {
|
|
|
80
14
|
static ngTemplateContextGuard(_, ctx) {
|
|
81
15
|
return true;
|
|
82
16
|
}
|
|
83
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
84
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCameraContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
18
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.7", type: NgtsCameraContent, isStandalone: true, selector: "ng-template[ngtsCameraContent]", inputs: { ngtsCameraContent: "ngtsCameraContent" }, ngImport: i0 }); }
|
|
85
19
|
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCameraContent, decorators: [{
|
|
87
21
|
type: Directive,
|
|
88
22
|
args: [{ selector: 'ng-template[ngtsCameraContent]', standalone: true }]
|
|
89
23
|
}], propDecorators: { ngtsCameraContent: [{
|
|
90
24
|
type: Input
|
|
91
25
|
}] } });
|
|
92
26
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
27
|
+
const defaultCubeCameraState = {
|
|
28
|
+
resolution: 256,
|
|
29
|
+
near: 0.1,
|
|
30
|
+
far: 1000,
|
|
31
|
+
};
|
|
32
|
+
function injectNgtsCubeCamera(cubeCameraState, { injector } = {}) {
|
|
33
|
+
injector = assertInjectionContext(injectNgtsCubeCamera, injector);
|
|
34
|
+
return runInInjectionContext(injector, () => {
|
|
35
|
+
const state = computed(() => ({ ...defaultCubeCameraState, ...cubeCameraState() }));
|
|
36
|
+
const resolution = computed(() => state().resolution);
|
|
37
|
+
const near = computed(() => state().near);
|
|
38
|
+
const far = computed(() => state().far);
|
|
39
|
+
const store = injectNgtStore();
|
|
40
|
+
const _gl = store.select('gl');
|
|
41
|
+
const _scene = store.select('scene');
|
|
42
|
+
const _fbo = computed(() => {
|
|
43
|
+
const renderTarget = new THREE.WebGLCubeRenderTarget(resolution());
|
|
44
|
+
renderTarget.texture.type = THREE.HalfFloatType;
|
|
45
|
+
return renderTarget;
|
|
46
|
+
});
|
|
47
|
+
effect((onCleanup) => {
|
|
48
|
+
const fbo = _fbo();
|
|
49
|
+
onCleanup(() => fbo.dispose());
|
|
50
|
+
});
|
|
51
|
+
const _camera = computed(() => new THREE.CubeCamera(near(), far(), _fbo()));
|
|
52
|
+
let originalFog;
|
|
53
|
+
let originalBackground;
|
|
54
|
+
const update = computed(() => {
|
|
55
|
+
const [scene, gl, camera, { envMap, fog }] = [_scene(), _gl(), _camera(), untracked(state)];
|
|
56
|
+
return () => {
|
|
57
|
+
originalFog = scene.fog;
|
|
58
|
+
originalBackground = scene.background;
|
|
59
|
+
scene.background = envMap || originalBackground;
|
|
60
|
+
scene.fog = fog || originalFog;
|
|
61
|
+
camera.update(gl, scene);
|
|
62
|
+
scene.fog = originalFog;
|
|
63
|
+
scene.background = originalBackground;
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
return { fbo: _fbo, camera: _camera, update };
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
extend({ Group });
|
|
70
|
+
class NgtsCubeCameraContent {
|
|
71
|
+
static ngTemplateContextGuard(_, ctx) {
|
|
72
|
+
return true;
|
|
98
73
|
}
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCubeCameraContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
75
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.7", type: NgtsCubeCameraContent, isStandalone: true, selector: "ng-template[ngtsCubeCameraContent]", ngImport: i0 }); }
|
|
76
|
+
}
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCubeCameraContent, decorators: [{
|
|
78
|
+
type: Directive,
|
|
79
|
+
args: [{ selector: 'ng-template[ngtsCubeCameraContent]', standalone: true }]
|
|
80
|
+
}] });
|
|
81
|
+
class NgtsCubeCamera {
|
|
99
82
|
/** Resolution of the FBO, 256 */
|
|
100
|
-
set
|
|
101
|
-
this.set({ resolution });
|
|
83
|
+
set _resolution(resolution) {
|
|
84
|
+
this.inputs.set({ resolution });
|
|
102
85
|
}
|
|
103
86
|
/** Camera near, 0.1 */
|
|
104
|
-
set
|
|
105
|
-
this.set({ near });
|
|
87
|
+
set _near(near) {
|
|
88
|
+
this.inputs.set({ near });
|
|
106
89
|
}
|
|
107
90
|
/** Camera far, 1000 */
|
|
108
|
-
set
|
|
109
|
-
this.set({ far });
|
|
91
|
+
set _far(far) {
|
|
92
|
+
this.inputs.set({ far });
|
|
110
93
|
}
|
|
111
94
|
/** Custom environment map that is temporarily set as the scenes background */
|
|
112
|
-
set
|
|
113
|
-
this.set({ envMap });
|
|
95
|
+
set _envMap(envMap) {
|
|
96
|
+
this.inputs.set({ envMap });
|
|
114
97
|
}
|
|
115
98
|
/** Custom fog that is temporarily set as the scenes fog */
|
|
116
|
-
set
|
|
117
|
-
this.set({ fog });
|
|
99
|
+
set _fog(fog) {
|
|
100
|
+
this.inputs.set({ fog });
|
|
118
101
|
}
|
|
119
|
-
#store;
|
|
120
|
-
#resolution;
|
|
121
|
-
#near;
|
|
122
|
-
#far;
|
|
123
102
|
constructor() {
|
|
124
|
-
|
|
103
|
+
this.inputs = signalStore({ frames: Infinity });
|
|
125
104
|
this.cameraRef = injectNgtRef();
|
|
126
|
-
this
|
|
127
|
-
this
|
|
128
|
-
this
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const resolution = this.#resolution();
|
|
132
|
-
const fbo = new THREE.WebGLCubeRenderTarget(resolution);
|
|
133
|
-
fbo.texture.encoding = this.#store.get('gl').outputEncoding;
|
|
134
|
-
fbo.texture.type = THREE.HalfFloatType;
|
|
135
|
-
return fbo;
|
|
105
|
+
this.cubeCamera = injectNgtsCubeCamera(this.inputs.state);
|
|
106
|
+
this.texture = computed(() => this.cubeCamera.fbo().texture);
|
|
107
|
+
this.beforeRender();
|
|
108
|
+
inject(DestroyRef).onDestroy(() => {
|
|
109
|
+
this.contentRef?.destroy();
|
|
136
110
|
});
|
|
137
|
-
|
|
111
|
+
}
|
|
112
|
+
ngOnInit() {
|
|
113
|
+
this.contentRef = this.anchor.createEmbeddedView(this.cameraContent, { texture: this.texture });
|
|
114
|
+
}
|
|
115
|
+
beforeRender() {
|
|
138
116
|
let count = 0;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
originalBackground = scene.background;
|
|
150
|
-
scene.background = envMap || originalBackground;
|
|
151
|
-
scene.fog = fog || originalFog;
|
|
152
|
-
this.cameraRef.nativeElement.update(gl, scene);
|
|
153
|
-
scene.fog = originalFog;
|
|
154
|
-
scene.background = originalBackground;
|
|
155
|
-
this.groupRef.nativeElement.visible = true;
|
|
117
|
+
injectBeforeRender(() => {
|
|
118
|
+
const camera = this.cameraRef.nativeElement;
|
|
119
|
+
if (!camera)
|
|
120
|
+
return;
|
|
121
|
+
const update = this.cubeCamera.update();
|
|
122
|
+
const frames = this.inputs.get('frames');
|
|
123
|
+
if (frames === Infinity || count < frames) {
|
|
124
|
+
camera.visible = false;
|
|
125
|
+
update();
|
|
126
|
+
camera.visible = true;
|
|
156
127
|
count++;
|
|
157
128
|
}
|
|
158
129
|
});
|
|
159
130
|
}
|
|
160
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
161
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
/>
|
|
170
|
-
</ngt-group>
|
|
171
|
-
</ngt-group>
|
|
172
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
|
|
131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCubeCamera, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: NgtsCubeCamera, isStandalone: true, selector: "ngts-cube-camera", inputs: { cameraRef: "cameraRef", _resolution: ["resolution", "_resolution"], _near: ["near", "_near"], _far: ["far", "_far"], _envMap: ["envMap", "_envMap"], _fog: ["fog", "_fog"] }, queries: [{ propertyName: "cameraContent", first: true, predicate: NgtsCubeCameraContent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
|
|
133
|
+
<ngt-group ngtCompound>
|
|
134
|
+
<ngt-primitive *args="[cubeCamera.camera()]" />
|
|
135
|
+
<ngt-group [ref]="cameraRef">
|
|
136
|
+
<ng-container #anchor />
|
|
137
|
+
</ngt-group>
|
|
138
|
+
</ngt-group>
|
|
139
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
|
|
173
140
|
}
|
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCubeCamera, decorators: [{
|
|
175
142
|
type: Component,
|
|
176
143
|
args: [{
|
|
177
144
|
selector: 'ngts-cube-camera',
|
|
178
145
|
standalone: true,
|
|
179
146
|
template: `
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
</ngt-group>
|
|
189
|
-
</ngt-group>
|
|
190
|
-
`,
|
|
191
|
-
imports: [NgIf, NgTemplateOutlet, NgtArgs],
|
|
147
|
+
<ngt-group ngtCompound>
|
|
148
|
+
<ngt-primitive *args="[cubeCamera.camera()]" />
|
|
149
|
+
<ngt-group [ref]="cameraRef">
|
|
150
|
+
<ng-container #anchor />
|
|
151
|
+
</ngt-group>
|
|
152
|
+
</ngt-group>
|
|
153
|
+
`,
|
|
154
|
+
imports: [NgtArgs, NgTemplateOutlet],
|
|
192
155
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
193
156
|
}]
|
|
194
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
195
|
-
type:
|
|
196
|
-
args: ['group', { static: true }]
|
|
157
|
+
}], ctorParameters: function () { return []; }, propDecorators: { cameraRef: [{
|
|
158
|
+
type: Input
|
|
197
159
|
}], cameraContent: [{
|
|
198
160
|
type: ContentChild,
|
|
199
|
-
args: [
|
|
161
|
+
args: [NgtsCubeCameraContent, { static: true, read: TemplateRef }]
|
|
162
|
+
}], anchor: [{
|
|
163
|
+
type: ViewChild,
|
|
164
|
+
args: ['anchor', { static: true, read: ViewContainerRef }]
|
|
165
|
+
}], _resolution: [{
|
|
166
|
+
type: Input,
|
|
167
|
+
args: [{ alias: 'resolution' }]
|
|
168
|
+
}], _near: [{
|
|
169
|
+
type: Input,
|
|
170
|
+
args: [{ alias: 'near' }]
|
|
171
|
+
}], _far: [{
|
|
172
|
+
type: Input,
|
|
173
|
+
args: [{ alias: 'far' }]
|
|
174
|
+
}], _envMap: [{
|
|
175
|
+
type: Input,
|
|
176
|
+
args: [{ alias: 'envMap' }]
|
|
177
|
+
}], _fog: [{
|
|
178
|
+
type: Input,
|
|
179
|
+
args: [{ alias: 'fog' }]
|
|
180
|
+
}] } });
|
|
181
|
+
|
|
182
|
+
class NgtsCamera {
|
|
183
|
+
set _makeDefault(makeDefault) {
|
|
184
|
+
this.inputs.set({ makeDefault });
|
|
185
|
+
}
|
|
186
|
+
set _manual(manual) {
|
|
187
|
+
this.inputs.set({ manual });
|
|
188
|
+
}
|
|
189
|
+
set _frames(frames) {
|
|
190
|
+
this.inputs.set({ frames });
|
|
191
|
+
}
|
|
192
|
+
set _resolution(resolution) {
|
|
193
|
+
this.inputs.set({ resolution });
|
|
194
|
+
}
|
|
195
|
+
set _envMap(envMap) {
|
|
196
|
+
this.inputs.set({ envMap });
|
|
197
|
+
}
|
|
198
|
+
constructor() {
|
|
199
|
+
this.inputs = signalStore({
|
|
200
|
+
resolution: 256,
|
|
201
|
+
frames: Infinity,
|
|
202
|
+
makeDefault: false,
|
|
203
|
+
manual: false,
|
|
204
|
+
});
|
|
205
|
+
this.cameraRef = injectNgtRef();
|
|
206
|
+
this.cameraResolution = this.inputs.select('resolution');
|
|
207
|
+
this.store = injectNgtStore();
|
|
208
|
+
this.fboRef = injectNgtsFBO(() => ({ width: this.cameraResolution() }));
|
|
209
|
+
this.setDefaultCamera();
|
|
210
|
+
this.updateProjectionMatrix();
|
|
211
|
+
}
|
|
212
|
+
setDefaultCamera() {
|
|
213
|
+
const makeDefault = this.inputs.select('makeDefault');
|
|
214
|
+
effect((onCleanup) => {
|
|
215
|
+
const camera = this.cameraRef.nativeElement;
|
|
216
|
+
if (camera && makeDefault()) {
|
|
217
|
+
const { camera: oldCamera } = this.store.get();
|
|
218
|
+
this.store.set({ camera });
|
|
219
|
+
onCleanup(() => this.store.set({ camera: oldCamera }));
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
updateProjectionMatrix() {
|
|
224
|
+
const manual = this.inputs.select('manual');
|
|
225
|
+
effect(() => {
|
|
226
|
+
const camera = this.cameraRef.nativeElement;
|
|
227
|
+
if (!manual() && camera)
|
|
228
|
+
camera.updateProjectionMatrix();
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCamera, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
232
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.7", type: NgtsCamera, inputs: { _makeDefault: ["makeDefault", "_makeDefault"], _manual: ["manual", "_manual"], _frames: ["frames", "_frames"], _resolution: ["resolution", "_resolution"], _envMap: ["envMap", "_envMap"], cameraRef: "cameraRef" }, ngImport: i0 }); }
|
|
233
|
+
}
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsCamera, decorators: [{
|
|
235
|
+
type: Directive
|
|
236
|
+
}], ctorParameters: function () { return []; }, propDecorators: { _makeDefault: [{
|
|
237
|
+
type: Input,
|
|
238
|
+
args: [{ alias: 'makeDefault' }]
|
|
239
|
+
}], _manual: [{
|
|
240
|
+
type: Input,
|
|
241
|
+
args: [{ alias: 'manual' }]
|
|
242
|
+
}], _frames: [{
|
|
243
|
+
type: Input,
|
|
244
|
+
args: [{ alias: 'frames' }]
|
|
245
|
+
}], _resolution: [{
|
|
246
|
+
type: Input,
|
|
247
|
+
args: [{ alias: 'resolution' }]
|
|
248
|
+
}], _envMap: [{
|
|
249
|
+
type: Input,
|
|
250
|
+
args: [{ alias: 'envMap' }]
|
|
200
251
|
}], cameraRef: [{
|
|
201
252
|
type: Input
|
|
202
|
-
}], frames: [{
|
|
203
|
-
type: Input
|
|
204
|
-
}], resolution: [{
|
|
205
|
-
type: Input
|
|
206
|
-
}], near: [{
|
|
207
|
-
type: Input
|
|
208
|
-
}], far: [{
|
|
209
|
-
type: Input
|
|
210
|
-
}], envMap: [{
|
|
211
|
-
type: Input
|
|
212
|
-
}], fog: [{
|
|
213
|
-
type: Input
|
|
214
253
|
}] } });
|
|
215
254
|
|
|
216
255
|
extend({ OrthographicCamera, Group });
|
|
217
256
|
class NgtsOrthographicCamera extends NgtsCamera {
|
|
218
|
-
|
|
219
|
-
|
|
257
|
+
constructor() {
|
|
258
|
+
super(...arguments);
|
|
259
|
+
this.orthographicInputs = signalStore({
|
|
260
|
+
left: 0,
|
|
261
|
+
right: 0,
|
|
262
|
+
top: 0,
|
|
263
|
+
bottom: 0,
|
|
264
|
+
});
|
|
265
|
+
this.left = this.orthographicInputs.select('left');
|
|
266
|
+
this.right = this.orthographicInputs.select('right');
|
|
267
|
+
this.top = this.orthographicInputs.select('top');
|
|
268
|
+
this.bottom = this.orthographicInputs.select('bottom');
|
|
269
|
+
this.size = this.store.select('size');
|
|
270
|
+
this.cameraLeft = computed(() => this.left() || this.size().width / -2);
|
|
271
|
+
this.cameraRight = computed(() => this.right() || this.size().width / 2);
|
|
272
|
+
this.cameraTop = computed(() => this.top() || this.size().height / 2);
|
|
273
|
+
this.cameraBottom = computed(() => this.bottom() || this.size().height / -2);
|
|
220
274
|
}
|
|
221
|
-
set
|
|
222
|
-
this.set({
|
|
275
|
+
set _left(left) {
|
|
276
|
+
this.orthographicInputs.set({ left });
|
|
223
277
|
}
|
|
224
|
-
set
|
|
225
|
-
this.set({
|
|
278
|
+
set _right(right) {
|
|
279
|
+
this.orthographicInputs.set({ right });
|
|
226
280
|
}
|
|
227
|
-
set
|
|
228
|
-
this.set({
|
|
281
|
+
set _top(top) {
|
|
282
|
+
this.orthographicInputs.set({ top });
|
|
229
283
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
#top;
|
|
233
|
-
#bottom;
|
|
234
|
-
#size;
|
|
235
|
-
constructor() {
|
|
236
|
-
super();
|
|
237
|
-
this.#left = this.select('left');
|
|
238
|
-
this.#right = this.select('right');
|
|
239
|
-
this.#top = this.select('top');
|
|
240
|
-
this.#bottom = this.select('bottom');
|
|
241
|
-
this.#size = this.store.select('size');
|
|
242
|
-
this.cameraLeft = computed(() => this.#left() || this.#size().width / -2);
|
|
243
|
-
this.cameraRight = computed(() => this.#right() || this.#size().width / 2);
|
|
244
|
-
this.cameraTop = computed(() => this.#top() || this.#size().height / 2);
|
|
245
|
-
this.cameraBottom = computed(() => this.#bottom() || this.#size().height / -2);
|
|
246
|
-
this.set({ left: 0, right: 0, top: 0, bottom: 0 });
|
|
284
|
+
set _bottom(bottom) {
|
|
285
|
+
this.orthographicInputs.set({ bottom });
|
|
247
286
|
}
|
|
248
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
249
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
287
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsOrthographicCamera, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
288
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: NgtsOrthographicCamera, isStandalone: true, selector: "ngts-orthographic-camera", inputs: { _left: ["left", "_left"], _right: ["right", "_right"], _top: ["top", "_top"], _bottom: ["bottom", "_bottom"] }, queries: [{ propertyName: "cameraContent", first: true, predicate: NgtsCameraContent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
289
|
+
<ngt-orthographic-camera
|
|
290
|
+
ngtCompound
|
|
291
|
+
[ref]="cameraRef"
|
|
292
|
+
[left]="cameraLeft()"
|
|
293
|
+
[right]="cameraRight()"
|
|
294
|
+
[top]="cameraTop()"
|
|
295
|
+
[bottom]="cameraBottom()"
|
|
296
|
+
>
|
|
297
|
+
<ng-container
|
|
298
|
+
*ngIf="cameraContent && !cameraContent.ngtsCameraContent"
|
|
299
|
+
[ngTemplateOutlet]="cameraContent.template"
|
|
300
|
+
/>
|
|
301
|
+
</ngt-orthographic-camera>
|
|
302
|
+
<ngt-group #group *ngIf="cameraContent && cameraContent.ngtsCameraContent">
|
|
303
|
+
<ng-container *ngTemplateOutlet="cameraContent.template; context: { fbo: fboRef.nativeElement, group }" />
|
|
304
|
+
</ngt-group>
|
|
305
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
267
306
|
}
|
|
268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsOrthographicCamera, decorators: [{
|
|
269
308
|
type: Component,
|
|
270
309
|
args: [{
|
|
271
310
|
selector: 'ngts-orthographic-camera',
|
|
272
311
|
standalone: true,
|
|
273
312
|
template: `
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
313
|
+
<ngt-orthographic-camera
|
|
314
|
+
ngtCompound
|
|
315
|
+
[ref]="cameraRef"
|
|
316
|
+
[left]="cameraLeft()"
|
|
317
|
+
[right]="cameraRight()"
|
|
318
|
+
[top]="cameraTop()"
|
|
319
|
+
[bottom]="cameraBottom()"
|
|
320
|
+
>
|
|
321
|
+
<ng-container
|
|
322
|
+
*ngIf="cameraContent && !cameraContent.ngtsCameraContent"
|
|
323
|
+
[ngTemplateOutlet]="cameraContent.template"
|
|
324
|
+
/>
|
|
325
|
+
</ngt-orthographic-camera>
|
|
326
|
+
<ngt-group #group *ngIf="cameraContent && cameraContent.ngtsCameraContent">
|
|
327
|
+
<ng-container *ngTemplateOutlet="cameraContent.template; context: { fbo: fboRef.nativeElement, group }" />
|
|
328
|
+
</ngt-group>
|
|
329
|
+
`,
|
|
291
330
|
imports: [NgIf, NgTemplateOutlet],
|
|
292
331
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
293
332
|
}]
|
|
294
|
-
}],
|
|
333
|
+
}], propDecorators: { cameraContent: [{
|
|
295
334
|
type: ContentChild,
|
|
296
335
|
args: [NgtsCameraContent]
|
|
297
|
-
}],
|
|
298
|
-
type: Input
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}],
|
|
304
|
-
type: Input
|
|
336
|
+
}], _left: [{
|
|
337
|
+
type: Input,
|
|
338
|
+
args: [{ alias: 'left' }]
|
|
339
|
+
}], _right: [{
|
|
340
|
+
type: Input,
|
|
341
|
+
args: [{ alias: 'right' }]
|
|
342
|
+
}], _top: [{
|
|
343
|
+
type: Input,
|
|
344
|
+
args: [{ alias: 'top' }]
|
|
345
|
+
}], _bottom: [{
|
|
346
|
+
type: Input,
|
|
347
|
+
args: [{ alias: 'bottom' }]
|
|
305
348
|
}] } });
|
|
306
349
|
|
|
307
350
|
extend({ PerspectiveCamera, Group });
|
|
308
351
|
class NgtsPerspectiveCamera extends NgtsCamera {
|
|
309
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
310
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
352
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsPerspectiveCamera, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
353
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: NgtsPerspectiveCamera, isStandalone: true, selector: "ngts-perspective-camera", queries: [{ propertyName: "cameraContent", first: true, predicate: NgtsCameraContent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
354
|
+
<ngt-perspective-camera [ref]="cameraRef" ngtCompound>
|
|
355
|
+
<ng-container
|
|
356
|
+
*ngIf="cameraContent && !cameraContent.ngtsCameraContent"
|
|
357
|
+
[ngTemplateOutlet]="cameraContent.template"
|
|
358
|
+
/>
|
|
359
|
+
</ngt-perspective-camera>
|
|
360
|
+
<ngt-group #group *ngIf="cameraContent && cameraContent.ngtsCameraContent">
|
|
361
|
+
<ng-container *ngTemplateOutlet="cameraContent.template; context: { fbo: fboRef.nativeElement, group }" />
|
|
362
|
+
</ngt-group>
|
|
363
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
321
364
|
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsPerspectiveCamera, decorators: [{
|
|
323
366
|
type: Component,
|
|
324
367
|
args: [{
|
|
325
368
|
selector: 'ngts-perspective-camera',
|
|
326
369
|
standalone: true,
|
|
327
370
|
template: `
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
371
|
+
<ngt-perspective-camera [ref]="cameraRef" ngtCompound>
|
|
372
|
+
<ng-container
|
|
373
|
+
*ngIf="cameraContent && !cameraContent.ngtsCameraContent"
|
|
374
|
+
[ngTemplateOutlet]="cameraContent.template"
|
|
375
|
+
/>
|
|
376
|
+
</ngt-perspective-camera>
|
|
377
|
+
<ngt-group #group *ngIf="cameraContent && cameraContent.ngtsCameraContent">
|
|
378
|
+
<ng-container *ngTemplateOutlet="cameraContent.template; context: { fbo: fboRef.nativeElement, group }" />
|
|
379
|
+
</ngt-group>
|
|
380
|
+
`,
|
|
338
381
|
imports: [NgIf, NgTemplateOutlet],
|
|
339
382
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
340
383
|
}]
|
|
@@ -347,5 +390,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImpor
|
|
|
347
390
|
* Generated bundle index. Do not edit.
|
|
348
391
|
*/
|
|
349
392
|
|
|
350
|
-
export {
|
|
393
|
+
export { NgtsCameraContent, NgtsCubeCamera, NgtsCubeCameraContent, NgtsOrthographicCamera, NgtsPerspectiveCamera, injectNgtsCubeCamera };
|
|
351
394
|
//# sourceMappingURL=angular-three-soba-cameras.mjs.map
|