angular-three 3.5.0 → 3.6.0

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.
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { untracked, computed, signal, ElementRef, input, inject, ViewContainerRef, TemplateRef, effect, DestroyRef, Directive, InjectionToken, DebugNode, RendererFactory2, Injectable, makeEnvironmentProviders, EnvironmentInjector, InjectFlags, runInInjectionContext, createEnvironmentInjector, Component, NgZone, Injector, booleanAttribute, output, viewChild, afterNextRender, ChangeDetectionStrategy, Pipe, CUSTOM_ELEMENTS_SCHEMA, contentChild, model, Renderer2 } from '@angular/core';
3
3
  import { outputFromObservable } from '@angular/core/rxjs-interop';
4
4
  import { provideResizeOptions, NgxResize } from 'ngxtension/resize';
5
- import { MathUtils, WebGLRenderer, OrthographicCamera, PerspectiveCamera, Vector3, Vector2, Clock, Layers, Color, ColorManagement, Texture, RGBAFormat, UnsignedByteType, EventDispatcher, Raycaster, Scene, PCFSoftShadowMap, BasicShadowMap, PCFShadowMap, VSMShadowMap, NoToneMapping, ACESFilmicToneMapping, Vector4 } from 'three';
5
+ import { MathUtils, WebGLRenderer, OrthographicCamera, PerspectiveCamera, Vector3, Vector2, Clock, Layers, ColorManagement, RGBAFormat, UnsignedByteType, EventDispatcher, Raycaster, Scene, PCFSoftShadowMap, BasicShadowMap, PCFShadowMap, VSMShadowMap, NoToneMapping, ACESFilmicToneMapping, Vector4 } from 'three';
6
6
  import { DOCUMENT } from '@angular/common';
7
7
  import { Subject, filter } from 'rxjs';
8
8
  import { createInjectionToken } from 'ngxtension/create-injection-token';
@@ -977,7 +977,7 @@ function storeFactory(previousStore) {
977
977
  function getCurrentViewport(camera = get('camera'), target = defaultTarget, size = get('size')) {
978
978
  const { width, height, top, left } = size;
979
979
  const aspect = width / height;
980
- if (target instanceof Vector3)
980
+ if (target.isVector3)
981
981
  tempTarget.copy(target);
982
982
  else
983
983
  tempTarget.set(...target);
@@ -1254,7 +1254,7 @@ function applyProps(instance, props) {
1254
1254
  const targetProp = currentInstance[key];
1255
1255
  // special treatmen for objects with support for set/copy, and layers
1256
1256
  if (targetProp && targetProp['set'] && (targetProp['copy'] || targetProp instanceof Layers)) {
1257
- const isColor = targetProp instanceof Color;
1257
+ const isColor = targetProp.isColor;
1258
1258
  // if value is an array
1259
1259
  if (Array.isArray(value)) {
1260
1260
  if (targetProp['fromArray'])
@@ -1271,7 +1271,7 @@ function applyProps(instance, props) {
1271
1271
  targetProp['convertSRGBToLinear']();
1272
1272
  } // if nothing else fits, just set the single value, ignore undefined
1273
1273
  else if (value !== undefined) {
1274
- const isColor = targetProp instanceof Color;
1274
+ const isColor = targetProp.isColor;
1275
1275
  // allow setting array scalars
1276
1276
  if (!isColor && targetProp['setScalar'])
1277
1277
  targetProp['setScalar'](value);
@@ -1289,7 +1289,7 @@ function applyProps(instance, props) {
1289
1289
  else {
1290
1290
  currentInstance[key] = value;
1291
1291
  // auto-convert srgb textures
1292
- if (currentInstance[key] instanceof Texture &&
1292
+ if (currentInstance[key]?.isTexture &&
1293
1293
  currentInstance[key].format === RGBAFormat &&
1294
1294
  currentInstance[key].type === UnsignedByteType) {
1295
1295
  const texture = currentInstance[key];
@@ -2291,7 +2291,7 @@ function injectCanvasRootInitializer(injector) {
2291
2291
  if (!state.camera && !cameraOptions?.rotation && !cameraOptions?.quaternion) {
2292
2292
  if (Array.isArray(lookAt))
2293
2293
  camera.lookAt(lookAt[0], lookAt[1], lookAt[2]);
2294
- else if (lookAt instanceof Vector3)
2294
+ else if (lookAt?.isVector3)
2295
2295
  camera.lookAt(lookAt);
2296
2296
  else
2297
2297
  camera.lookAt(0, 0, 0);
@@ -2309,7 +2309,7 @@ function injectCanvasRootInitializer(injector) {
2309
2309
  // Set up scene (one time only!)
2310
2310
  if (!state.scene) {
2311
2311
  let scene;
2312
- if (sceneOptions instanceof Scene) {
2312
+ if (is.scene(sceneOptions)) {
2313
2313
  scene = sceneOptions;
2314
2314
  }
2315
2315
  else {