lythreeframe 1.2.0 → 1.2.2

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.
@@ -17,7 +17,7 @@ var gsap = require('gsap');
17
17
  var three = require('three');
18
18
  var SkyMesh_js = require('three/examples/jsm/objects/SkyMesh.js');
19
19
  var CSS2DRenderer_js = require('three/examples/jsm/renderers/CSS2DRenderer.js');
20
- var PointerLockControls = require('three/examples/jsm/controls/PointerLockControls');
20
+ var PointerLockControls_js = require('three/examples/jsm/controls/PointerLockControls.js');
21
21
  var TransformControls_js = require('three/examples/jsm/controls/TransformControls.js');
22
22
 
23
23
  /*
@@ -929,7 +929,8 @@ class MaterialAssetPointer extends TAssetPointer {
929
929
  }
930
930
  try {
931
931
  this.textures.set(name, texturePtr);
932
- this.getValue()[name] = texture;
932
+ const matAny = mat;
933
+ matAny[name] = texture;
933
934
  texturePtr.addRef();
934
935
  mat.needsUpdate = true;
935
936
  }
@@ -1159,8 +1160,9 @@ class AssetManager {
1159
1160
  if (!pointer) {
1160
1161
  let textureMap = new Map();
1161
1162
  for (let k in asset) {
1162
- if (asset[k] instanceof webgpu.Texture) {
1163
- let ptr = this.addTextureAsset(asset[k], 1);
1163
+ const value = asset[k];
1164
+ if (value instanceof webgpu.Texture) {
1165
+ let ptr = this.addTextureAsset(value, 1);
1164
1166
  textureMap.set(k, ptr);
1165
1167
  }
1166
1168
  }
@@ -1740,7 +1742,6 @@ class Viewport {
1740
1742
  this.smaaPass = null;
1741
1743
  }
1742
1744
  }
1743
- console.log(this.postProcessParam, "sssssssssssssssssssss");
1744
1745
  this.postProcessing.outputNode = finalNode;
1745
1746
  this.markRenderStateDirty();
1746
1747
  }
@@ -2973,7 +2974,7 @@ class BoxActor extends Actor {
2973
2974
  super(app, uuid);
2974
2975
  }
2975
2976
  constructRootComponent() {
2976
- this.rootComponent = new BoxComponent(this.app);
2977
+ return new BoxComponent(this.app, 1, 1, 1, 1, 1, 1, new webgpu.MeshBasicMaterial(), this.uuid);
2977
2978
  }
2978
2979
  }
2979
2980
 
@@ -3000,7 +3001,6 @@ class SkyComponent extends SceneComponent {
3000
3001
  }
3001
3002
  constructor(app, skyparam, uuid) {
3002
3003
  super(app, uuid);
3003
- this.obj = null;
3004
3004
  this.skyParam = DefaultSkyParam;
3005
3005
  this.sunPosition = new webgpu.Vector3();
3006
3006
  if (skyparam) {
@@ -3025,17 +3025,17 @@ class SkyComponent extends SceneComponent {
3025
3025
  }
3026
3026
  destroyObject() {
3027
3027
  if (this.obj) {
3028
- ThreeObjectLibrary.disposeMeshResource(this.obj);
3028
+ ThreeObjectLibrary.disposeMeshResource(this.threeObject);
3029
3029
  }
3030
3030
  }
3031
3031
  }
3032
3032
 
3033
3033
  class SkyActor extends Actor {
3034
- constructor(app) {
3035
- super(app);
3034
+ constructor(app, uuid) {
3035
+ super(app, uuid);
3036
3036
  this._name = "SkyActor";
3037
3037
  this.skyComponent = null;
3038
- this.name = "DirectionalLightActor";
3038
+ this.name = "SkyActor";
3039
3039
  this.skyComponent = this.rootComponent;
3040
3040
  this.rootComponent.name = `${this.rootComponent.name}(Root)`;
3041
3041
  this.setScale(45000, 45000, 45000);
@@ -3149,7 +3149,7 @@ const DefaultSSRParam = {
3149
3149
  class FirstPerson extends Pawn {
3150
3150
  constructor(controller) {
3151
3151
  super(controller);
3152
- this._control = new PointerLockControls.PointerLockControls(controller.camera, controller.viewPort.canvas);
3152
+ this._control = new PointerLockControls_js.PointerLockControls(controller.camera, controller.viewPort.canvas);
3153
3153
  }
3154
3154
  }
3155
3155
 
@@ -1,4 +1,4 @@
1
- import { MathUtils, Object3D, Vector3, Box3, Quaternion, Euler, Matrix4, Mesh, LoadingManager, BufferGeometry, Texture, FileLoader, Material, NoToneMapping, LinearToneMapping, ReinhardToneMapping, CineonToneMapping, ACESFilmicToneMapping, AgXToneMapping, NeutralToneMapping, WebGPURenderer, PostProcessing, Color, Vector2, Raycaster, PerspectiveCamera, OrthographicCamera, Clock, DirectionalLight, MeshStandardMaterial, BoxGeometry, PlaneGeometry, MeshBasicMaterial, SphereGeometry } from 'three/webgpu';
1
+ import { MathUtils, Object3D, Vector3, Box3, Quaternion, Euler, Matrix4, Mesh, LoadingManager, BufferGeometry, Texture, FileLoader, Material, NoToneMapping, LinearToneMapping, ReinhardToneMapping, CineonToneMapping, ACESFilmicToneMapping, AgXToneMapping, NeutralToneMapping, WebGPURenderer, PostProcessing, Color, Vector2, Raycaster, PerspectiveCamera, OrthographicCamera, Clock, DirectionalLight, MeshStandardMaterial, BoxGeometry, MeshBasicMaterial, PlaneGeometry, SphereGeometry } from 'three/webgpu';
2
2
  import { GLTFLoader, DRACOLoader, CSS2DRenderer, OrbitControls } from 'three/examples/jsm/Addons.js';
3
3
  import { pass, mrt, output, uniform, velocity, metalness, transformedNormalView, blendColor, time, oscSine } from 'three/tsl';
4
4
  import { bloom } from 'three/examples/jsm/tsl/display/BloomNode.js';
@@ -15,7 +15,7 @@ import { gsap } from 'gsap';
15
15
  import { Scene } from 'three';
16
16
  import { SkyMesh } from 'three/examples/jsm/objects/SkyMesh.js';
17
17
  import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
18
- import { PointerLockControls } from 'three/examples/jsm/controls/PointerLockControls';
18
+ import { PointerLockControls } from 'three/examples/jsm/controls/PointerLockControls.js';
19
19
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
20
20
 
21
21
  /*
@@ -927,7 +927,8 @@ class MaterialAssetPointer extends TAssetPointer {
927
927
  }
928
928
  try {
929
929
  this.textures.set(name, texturePtr);
930
- this.getValue()[name] = texture;
930
+ const matAny = mat;
931
+ matAny[name] = texture;
931
932
  texturePtr.addRef();
932
933
  mat.needsUpdate = true;
933
934
  }
@@ -1157,8 +1158,9 @@ class AssetManager {
1157
1158
  if (!pointer) {
1158
1159
  let textureMap = new Map();
1159
1160
  for (let k in asset) {
1160
- if (asset[k] instanceof Texture) {
1161
- let ptr = this.addTextureAsset(asset[k], 1);
1161
+ const value = asset[k];
1162
+ if (value instanceof Texture) {
1163
+ let ptr = this.addTextureAsset(value, 1);
1162
1164
  textureMap.set(k, ptr);
1163
1165
  }
1164
1166
  }
@@ -1738,7 +1740,6 @@ class Viewport {
1738
1740
  this.smaaPass = null;
1739
1741
  }
1740
1742
  }
1741
- console.log(this.postProcessParam, "sssssssssssssssssssss");
1742
1743
  this.postProcessing.outputNode = finalNode;
1743
1744
  this.markRenderStateDirty();
1744
1745
  }
@@ -2971,7 +2972,7 @@ class BoxActor extends Actor {
2971
2972
  super(app, uuid);
2972
2973
  }
2973
2974
  constructRootComponent() {
2974
- this.rootComponent = new BoxComponent(this.app);
2975
+ return new BoxComponent(this.app, 1, 1, 1, 1, 1, 1, new MeshBasicMaterial(), this.uuid);
2975
2976
  }
2976
2977
  }
2977
2978
 
@@ -2998,7 +2999,6 @@ class SkyComponent extends SceneComponent {
2998
2999
  }
2999
3000
  constructor(app, skyparam, uuid) {
3000
3001
  super(app, uuid);
3001
- this.obj = null;
3002
3002
  this.skyParam = DefaultSkyParam;
3003
3003
  this.sunPosition = new Vector3();
3004
3004
  if (skyparam) {
@@ -3023,17 +3023,17 @@ class SkyComponent extends SceneComponent {
3023
3023
  }
3024
3024
  destroyObject() {
3025
3025
  if (this.obj) {
3026
- ThreeObjectLibrary.disposeMeshResource(this.obj);
3026
+ ThreeObjectLibrary.disposeMeshResource(this.threeObject);
3027
3027
  }
3028
3028
  }
3029
3029
  }
3030
3030
 
3031
3031
  class SkyActor extends Actor {
3032
- constructor(app) {
3033
- super(app);
3032
+ constructor(app, uuid) {
3033
+ super(app, uuid);
3034
3034
  this._name = "SkyActor";
3035
3035
  this.skyComponent = null;
3036
- this.name = "DirectionalLightActor";
3036
+ this.name = "SkyActor";
3037
3037
  this.skyComponent = this.rootComponent;
3038
3038
  this.rootComponent.name = `${this.rootComponent.name}(Root)`;
3039
3039
  this.setScale(45000, 45000, 45000);
@@ -1,4 +1,3 @@
1
- import { WebGPURendererParameters } from "three/src/renderers/webgpu/WebGPURenderer";
2
1
  import { CameraParam } from "./CameraParameter";
3
2
  import { WorldParam } from "./WorldParameter";
4
3
  import { Controller } from "../Controller";
@@ -7,6 +6,7 @@ import { Viewport } from "../Viewport";
7
6
  import { ViewportParam } from "./ViewportParameters";
8
7
  import { AssetManager } from "../../AssetManagement/AssetManager";
9
8
  import { PostProcessParam } from "../../PostProcess/PostProcessParam";
9
+ import { WebGPURendererParameters } from "three/src/renderers/webgpu/WebGPURenderer.js";
10
10
  export interface AppClass {
11
11
  assetManagerClass: typeof AssetManager;
12
12
  controllerClass: typeof Controller;
@@ -1,6 +1,7 @@
1
1
  import { Actor } from "../../Actor";
2
+ import { BoxComponent } from "../../Components/Mesh/Shape/BoxComponent";
2
3
  import { ThreeJsApp } from "../../../ThreeJsApp";
3
4
  export declare class BoxActor extends Actor {
4
5
  constructor(app: ThreeJsApp, uuid?: string);
5
- protected constructRootComponent(): void;
6
+ protected constructRootComponent(): BoxComponent;
6
7
  }
@@ -4,6 +4,6 @@ import { SkyComponent } from "../../Components/Sky/SkyComponent";
4
4
  export declare class SkyActor extends Actor {
5
5
  protected _name: string;
6
6
  protected skyComponent: SkyComponent | null;
7
- constructor(app: ThreeJsApp);
7
+ constructor(app: ThreeJsApp, uuid?: string);
8
8
  protected constructRootComponent(): SkyComponent;
9
9
  }
@@ -4,6 +4,6 @@ import { ThreeJsApp } from "../../../../ThreeJsApp";
4
4
  export declare class SpriteComponent extends SceneComponent {
5
5
  get threeObject(): Sprite;
6
6
  set threeObject(newThreeObject: Sprite);
7
- protected obj: Sprite;
8
- constructor(app: ThreeJsApp, texture: Texture);
7
+ constructor(app: ThreeJsApp, texture: Texture, uuid?: string);
8
+ protected createDefaultObject(): Sprite;
9
9
  }
@@ -12,8 +12,7 @@ export interface SkyComponentParam {
12
12
  export declare const DefaultSkyParam: SkyComponentParam;
13
13
  export declare class SkyComponent extends SceneComponent {
14
14
  get threeObject(): SkyMesh;
15
- set threeObject(newThreeObject: SkyMesh);
16
- protected obj: SkyMesh | null;
15
+ protected set threeObject(newThreeObject: SkyMesh);
17
16
  private skyParam;
18
17
  private sunPosition;
19
18
  constructor(app: ThreeJsApp, skyparam?: SkyComponentParam, uuid?: string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",