Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
HoyosJuan committed Jul 27, 2024
2 parents 0b8e98f + 939fa66 commit 8d643c2
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/assets/ifcStreamer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components",
"description": "Collection of core functionalities to author BIM apps.",
"version": "2.1.13",
"version": "2.1.14",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/core/Components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class Components implements Disposable {
/**
* The version of the @thatopen/components library.
*/
static readonly release = "2.1.13";
static readonly release = "2.1.14";

/** {@link Disposable.onDisposed} */
readonly onDisposed = new Event<void>();
Expand Down
14 changes: 14 additions & 0 deletions packages/core/src/core/Cullers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as THREE from "three";
import { Components } from "../Components";
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
import { Component, Event, Disposable, World } from "../Types";
Expand Down Expand Up @@ -91,4 +92,17 @@ export class Cullers extends Component implements Disposable {
}
this.list.clear();
}

/**
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
*
* @param meshes - The meshes to update.
*
* @returns {void}
*/
updateInstanced(meshes: Iterable<THREE.InstancedMesh>) {
for (const [, culler] of this.list) {
culler.updateInstanced(meshes);
}
}
}
17 changes: 17 additions & 0 deletions packages/core/src/core/Cullers/src/mesh-culler-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,23 @@ export class MeshCullerRenderer extends CullerRenderer implements Disposable {
this.isProcessing = false;
}

/**
* Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
*
* @param meshes - The meshes to update.
*
* @returns {void}
*/
updateInstanced(meshes: Iterable<THREE.InstancedMesh>) {
for (const mesh of meshes) {
const colorMesh = this.colorMeshes.get(mesh.uuid);
if (!colorMesh) {
continue;
}
colorMesh.count = mesh.count;
}
}

private handleWorkerMessage = async (event: MessageEvent) => {
if (this.isProcessing) {
return;
Expand Down
2 changes: 1 addition & 1 deletion packages/front/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components-front",
"description": "Collection of frontend tools to author BIM apps.",
"version": "2.1.8",
"version": "2.1.9",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
4 changes: 3 additions & 1 deletion packages/front/src/core/PostproductionRenderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export class PostproductionRenderer extends RendererWith2D {
}

private setPostproductionSize(size?: THREE.Vector2) {
if (!this.container) return;
if (!this.container) {
return;
}
const width = size ? size.x : this.container.clientWidth;
const height = size ? size.y : this.container.clientHeight;
this.postproduction.setSize(width, height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ export class Postproduction {
* @returns {void}
*/
setSize(width: number, height: number) {
if (width === 0 || height === 0) {
return;
}
if (this._initialized) {
const customEnabled = this._settings.custom;
if (customEnabled) {
Expand Down

0 comments on commit 8d643c2

Please sign in to comment.