lythreeframe 1.0.36 → 1.0.38
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/dist/bundle.cjs.js +7 -5
- package/dist/bundle.esm.js +7 -6
- package/dist/index.d.ts +1 -1
- package/dist/lythreeframe/Object/Components/Mesh/MeshComponent.d.ts +1 -1
- package/package.json +1 -1
- package/dist/lythreeframe/AssetManagement/Task/Task.d.ts +0 -7
- package/dist/lythreeframe/Object/Actors/Camera/CameraActor.d.ts +0 -4
- package/dist/lythreeframe/Object/Components/Camera/CameraComponent.d.ts +0 -26
- package/dist/lythreeframe/Object/Components/Mesh/InstanceMesh/InstanceMeshComponent.d.ts +0 -7
- package/dist/lythreeframe/Object/Components/Mesh/InstanceMesh/MultiInstanceMeshComponent.d.ts +0 -13
package/dist/bundle.cjs.js
CHANGED
|
@@ -709,7 +709,7 @@ class MeshComponent extends SceneComponent {
|
|
|
709
709
|
if (mat)
|
|
710
710
|
mats.push(mat);
|
|
711
711
|
});
|
|
712
|
-
return mats;
|
|
712
|
+
return mats.length > 1 ? mats : mats[0];
|
|
713
713
|
}
|
|
714
714
|
get materialPtr() {
|
|
715
715
|
return this.materialPtr;
|
|
@@ -740,7 +740,8 @@ class MeshComponent extends SceneComponent {
|
|
|
740
740
|
elem.addRef();
|
|
741
741
|
});
|
|
742
742
|
if (this.threeObject) {
|
|
743
|
-
|
|
743
|
+
if (mats.length > 0)
|
|
744
|
+
this.threeObject.material = Array.isArray(newMat) ? mats[0] : mats;
|
|
744
745
|
}
|
|
745
746
|
this._materialPtr = matPtrs;
|
|
746
747
|
}
|
|
@@ -752,7 +753,7 @@ class MeshComponent extends SceneComponent {
|
|
|
752
753
|
if (ptr)
|
|
753
754
|
matPtrs.push(ptr);
|
|
754
755
|
});
|
|
755
|
-
let newMesh = new webgpu.Mesh(geometry,
|
|
756
|
+
let newMesh = new webgpu.Mesh(geometry, material);
|
|
756
757
|
super(app, newMesh);
|
|
757
758
|
this.obj = null;
|
|
758
759
|
this._geometryPtr = app.assetManager.addGeometryAsset(geometry);
|
|
@@ -1751,10 +1752,10 @@ class Viewport {
|
|
|
1751
1752
|
return new Promise((resolve, reject) => {
|
|
1752
1753
|
try {
|
|
1753
1754
|
if (this.postProcessing) {
|
|
1754
|
-
this.postProcessing.
|
|
1755
|
+
this.postProcessing.renderAsync();
|
|
1755
1756
|
}
|
|
1756
1757
|
else {
|
|
1757
|
-
this.renderer.
|
|
1758
|
+
this.renderer.renderAsync(this.app.world.scene, this.app.camera);
|
|
1758
1759
|
}
|
|
1759
1760
|
const offscreenCanvas = document.createElement('canvas');
|
|
1760
1761
|
offscreenCanvas.width = width;
|
|
@@ -3109,6 +3110,7 @@ exports.BoxComponent = BoxComponent;
|
|
|
3109
3110
|
exports.Controller = Controller;
|
|
3110
3111
|
exports.DefaultAppParam = DefaultAppParam;
|
|
3111
3112
|
exports.DefaultBloomParam = DefaultBloomParam;
|
|
3113
|
+
exports.DefaultCameraParam = DefaultCameraParam;
|
|
3112
3114
|
exports.DefaultDOFParam = DefaultDOFParam;
|
|
3113
3115
|
exports.DefaultDenoiseParam = DefaultDenoiseParam;
|
|
3114
3116
|
exports.DefaultGTAOParam = DefaultGTAOParam;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -707,7 +707,7 @@ class MeshComponent extends SceneComponent {
|
|
|
707
707
|
if (mat)
|
|
708
708
|
mats.push(mat);
|
|
709
709
|
});
|
|
710
|
-
return mats;
|
|
710
|
+
return mats.length > 1 ? mats : mats[0];
|
|
711
711
|
}
|
|
712
712
|
get materialPtr() {
|
|
713
713
|
return this.materialPtr;
|
|
@@ -738,7 +738,8 @@ class MeshComponent extends SceneComponent {
|
|
|
738
738
|
elem.addRef();
|
|
739
739
|
});
|
|
740
740
|
if (this.threeObject) {
|
|
741
|
-
|
|
741
|
+
if (mats.length > 0)
|
|
742
|
+
this.threeObject.material = Array.isArray(newMat) ? mats[0] : mats;
|
|
742
743
|
}
|
|
743
744
|
this._materialPtr = matPtrs;
|
|
744
745
|
}
|
|
@@ -750,7 +751,7 @@ class MeshComponent extends SceneComponent {
|
|
|
750
751
|
if (ptr)
|
|
751
752
|
matPtrs.push(ptr);
|
|
752
753
|
});
|
|
753
|
-
let newMesh = new Mesh(geometry,
|
|
754
|
+
let newMesh = new Mesh(geometry, material);
|
|
754
755
|
super(app, newMesh);
|
|
755
756
|
this.obj = null;
|
|
756
757
|
this._geometryPtr = app.assetManager.addGeometryAsset(geometry);
|
|
@@ -1749,10 +1750,10 @@ class Viewport {
|
|
|
1749
1750
|
return new Promise((resolve, reject) => {
|
|
1750
1751
|
try {
|
|
1751
1752
|
if (this.postProcessing) {
|
|
1752
|
-
this.postProcessing.
|
|
1753
|
+
this.postProcessing.renderAsync();
|
|
1753
1754
|
}
|
|
1754
1755
|
else {
|
|
1755
|
-
this.renderer.
|
|
1756
|
+
this.renderer.renderAsync(this.app.world.scene, this.app.camera);
|
|
1756
1757
|
}
|
|
1757
1758
|
const offscreenCanvas = document.createElement('canvas');
|
|
1758
1759
|
offscreenCanvas.width = width;
|
|
@@ -3100,4 +3101,4 @@ class TransformGizmo extends Pawn {
|
|
|
3100
3101
|
}
|
|
3101
3102
|
}
|
|
3102
3103
|
|
|
3103
|
-
export { Actor, AssetManager, AttachmentRules, BoxActor, BoxComponent, Controller, DefaultAppParam, DefaultBloomParam, DefaultDOFParam, DefaultDenoiseParam, DefaultGTAOParam, DefaultOutlineParams, DefaultPostProcessParam, DefaultRenderParam, DefaultSSRParam, DefaultSkyParam, DefaultToneMappingParams, Delegate, DirectionalLightActor, DirectionalLightComponent, FirstPerson, LabelComponent, MeshComponent, Orbital, PlaneActor, PlaneComponent, SceneComponent, SkyActor, SkyComponent, SphereComponent, TAssetPointer, TSmartPointer, ThreeJsApp, ThreeObjectLibrary, ToneMappingOptions, TransformGizmo, Viewport, WebGPUPostProcessFactory, World };
|
|
3104
|
+
export { Actor, AssetManager, AttachmentRules, BoxActor, BoxComponent, Controller, DefaultAppParam, DefaultBloomParam, DefaultCameraParam, DefaultDOFParam, DefaultDenoiseParam, DefaultGTAOParam, DefaultOutlineParams, DefaultPostProcessParam, DefaultRenderParam, DefaultSSRParam, DefaultSkyParam, DefaultToneMappingParams, Delegate, DirectionalLightActor, DirectionalLightComponent, FirstPerson, LabelComponent, MeshComponent, Orbital, PlaneActor, PlaneComponent, SceneComponent, SkyActor, SkyComponent, SphereComponent, TAssetPointer, TSmartPointer, ThreeJsApp, ThreeObjectLibrary, ToneMappingOptions, TransformGizmo, Viewport, WebGPUPostProcessFactory, World };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { Controller } from "./lythreeframe/Frame/Controller";
|
|
|
8
8
|
export { Viewport } from "./lythreeframe/Frame/Viewport";
|
|
9
9
|
export { World } from "./lythreeframe/Frame/World";
|
|
10
10
|
export type { CameraParam } from './lythreeframe/Frame/Parameters/CameraParameter';
|
|
11
|
-
export
|
|
11
|
+
export { DefaultCameraParam } from './lythreeframe/Frame/Parameters/CameraParameter';
|
|
12
12
|
export type { AppParam, AppClass } from "./lythreeframe/Frame/Parameters/AppParameter";
|
|
13
13
|
export { DefaultRenderParam, DefaultAppParam } from "./lythreeframe/Frame/Parameters/AppParameter";
|
|
14
14
|
export { Actor } from "./lythreeframe/Object/Actor";
|
|
@@ -10,7 +10,7 @@ export declare class MeshComponent extends SceneComponent {
|
|
|
10
10
|
set geometry(geo: BufferGeometry);
|
|
11
11
|
get geometryPtr(): TAssetPointer<BufferGeometry>;
|
|
12
12
|
set geometryPtr(geo: TAssetPointer<BufferGeometry>);
|
|
13
|
-
get material(): Material[];
|
|
13
|
+
get material(): Material | Material[];
|
|
14
14
|
get materialPtr(): TAssetPointer<Material>[];
|
|
15
15
|
set material(newMat: Material | Material[]);
|
|
16
16
|
set materialPtr(newMat: TAssetPointer<Material> | TAssetPointer<Material>[]);
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SceneComponent } from "../SceneComponent";
|
|
2
|
-
import { OrthographicCamera, PerspectiveCamera } from "three/webgpu";
|
|
3
|
-
interface CameraParam {
|
|
4
|
-
near: number;
|
|
5
|
-
far: number;
|
|
6
|
-
param: PerspectiveCameraParam | OrthographicCameraParam;
|
|
7
|
-
}
|
|
8
|
-
interface PerspectiveCameraParam {
|
|
9
|
-
fov: number;
|
|
10
|
-
aspect: number;
|
|
11
|
-
}
|
|
12
|
-
interface OrthographicCameraParam {
|
|
13
|
-
left: number;
|
|
14
|
-
right: number;
|
|
15
|
-
top: number;
|
|
16
|
-
bottom: number;
|
|
17
|
-
}
|
|
18
|
-
export declare class CameraComponent extends SceneComponent {
|
|
19
|
-
get threeObject(): PerspectiveCamera | OrthographicCamera;
|
|
20
|
-
get camera(): PerspectiveCamera | OrthographicCamera;
|
|
21
|
-
private set threeObject(value);
|
|
22
|
-
protected obj: PerspectiveCamera | OrthographicCamera;
|
|
23
|
-
constructor(param?: CameraParam);
|
|
24
|
-
updateCamera(param: CameraParam): void;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BufferGeometry, Material, Matrix4 } from "three/webgpu";
|
|
2
|
-
import { MeshComponent } from "../MeshComponent";
|
|
3
|
-
export declare class LYInstanceMeshComponent extends MeshComponent {
|
|
4
|
-
constructor(geometry: BufferGeometry, material: Material | Material[], matrices: Matrix4[]);
|
|
5
|
-
update(matrices: Matrix4[]): void;
|
|
6
|
-
destroy(): void;
|
|
7
|
-
}
|
package/dist/lythreeframe/Object/Components/Mesh/InstanceMesh/MultiInstanceMeshComponent.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Matrix4, Object3D } from "three/webgpu";
|
|
2
|
-
import { SceneComponent } from "../../SceneComponent";
|
|
3
|
-
export declare class LYMultiInstanceMeshComponent extends SceneComponent {
|
|
4
|
-
get matrices(): Matrix4[];
|
|
5
|
-
private ins;
|
|
6
|
-
private count;
|
|
7
|
-
private object;
|
|
8
|
-
private _matrices;
|
|
9
|
-
constructor(object: Object3D, matrices: Matrix4[]);
|
|
10
|
-
private collectMeshes;
|
|
11
|
-
update(matrices: Matrix4[]): void;
|
|
12
|
-
destroy(): void;
|
|
13
|
-
}
|