Skip to content

Commit

Permalink
BatchedMesh: geometry methods, error signatures (#660)
Browse files Browse the repository at this point in the history
* BatchedMesh: geometry methods, error signatures

* Update examples

---------

Co-authored-by: Nathan Bierema <nbierema@gmail.com>
  • Loading branch information
CodyJasonBennett and Methuselah96 authored Nov 4, 2023
1 parent 29bdb05 commit 7f83ce3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples-testing/changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9207,7 +9207,7 @@ index dfca0ac..bfa38b8 100644
const spherical = new THREE.Spherical();
const rotationMatrix = new THREE.Matrix4();
diff --git a/examples-testing/examples/webgl_mesh_batch.ts b/examples-testing/examples/webgl_mesh_batch.ts
index 411556f..a92abcb 100644
index c8e8597..cc3affd 100644
--- a/examples-testing/examples/webgl_mesh_batch.ts
+++ b/examples-testing/examples/webgl_mesh_batch.ts
@@ -6,10 +6,10 @@ import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
Expand Down
2 changes: 1 addition & 1 deletion three.js
Submodule three.js updated 45 files
+5 −5 .github/workflows/ci.yml
+3 −3 .github/workflows/codeql-code-scanning.yml
+1 −1 .github/workflows/read-size.yml
+2 −2 .github/workflows/report-size.yml
+16 −1 build/three.cjs
+16 −1 build/three.js
+1 −1 build/three.min.js
+16 −1 build/three.module.js
+1 −1 build/three.module.min.js
+63 −59 docs/api/ar/math/Matrix3.html
+39 −35 docs/api/ar/math/Matrix4.html
+170 −166 docs/api/en/math/Matrix3.html
+536 −532 docs/api/en/math/Matrix4.html
+67 −63 docs/api/it/math/Matrix3.html
+369 −365 docs/api/it/math/Matrix4.html
+43 −39 docs/api/zh/math/Matrix3.html
+191 −189 docs/api/zh/math/Matrix4.html
+4 −14 docs/examples/en/loaders/GLTFLoader.html
+9 −2 examples/jsm/interactive/HTMLMesh.js
+144 −61 examples/jsm/loaders/FBXLoader.js
+11 −2 examples/jsm/nodes/accessors/TextureNode.js
+3 −5 examples/jsm/nodes/core/NodeBuilder.js
+3 −3 examples/jsm/nodes/core/OutputStructNode.js
+4 −4 examples/jsm/nodes/core/StructTypeNode.js
+2 −2 examples/jsm/nodes/display/ViewportDepthTextureNode.js
+5 −8 examples/jsm/nodes/display/ViewportNode.js
+25 −14 examples/jsm/nodes/lighting/AnalyticLightNode.js
+232 −87 examples/jsm/objects/BatchedMesh.js
+25 −6 examples/jsm/renderers/common/Renderer.js
+3 −13 examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js
+32 −8 examples/jsm/renderers/webgl/WebGLBackend.js
+1 −1 examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js
+1 −1 examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js
+3 −3 examples/jsm/transpiler/TSLEncoder.js
+ examples/screenshots/webgpu_backdrop.jpg
+ examples/screenshots/webgpu_backdrop_area.jpg
+ examples/screenshots/webgpu_depth_texture.jpg
+1 −1 examples/webgl_mesh_batch.html
+4 −2 examples/webgpu_backdrop.html
+4 −2 examples/webgpu_backdrop_area.html
+0 −5 examples/webgpu_compute_particles_rain.html
+301 −146 package-lock.json
+1 −1 src/constants.js
+16 −0 src/renderers/webxr/WebXRManager.js
+0 −2 test/e2e/puppeteer.js
30 changes: 15 additions & 15 deletions types/three/examples/jsm/objects/BatchedMesh.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
_indexStarts: number[];
_indexCounts: number[];

_reservedRanges: {
vertexStart: number;
vertexCount: number;
indexStart: number;
indexCount: number;
}[];
_visible: boolean[];
_active: boolean[];

Expand All @@ -15,9 +21,6 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {

_geometryInitialized: boolean;
_geometryCount: number;
_vertexCount: number;
_indexCount: number;

_matrices: Matrix4[];
_matricesTexture: DataTexture | null;

Expand All @@ -26,31 +29,28 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
constructor(maxGeometryCount: number, maxVertexCount: number, maxIndexCount?: number, material?: Material);

_initMatricesTexture(): void;

_initShader(): void;

_initializeGeometry(reference: BufferGeometry): void;
_validateGeometry(geometry: BufferGeometry): void;

getGeometryCount(): number;

getVertexCount(): number;

getIndexCount(): number;

applyGeometry(geometry: BufferGeometry): number;

addGeometry(geometry: BufferGeometry, vertexCount?: number, indexCount?: number): number;
setGeometryAt(id: number, geometry: BufferGeometry): number;
deleteGeometry(geometryId: number): this;

optimize(): never;

setMatrixAt(geometryId: number, matrix: Matrix4): this;

getMatrixAt(geometryId: number, matrix: Matrix4): Matrix4;

setVisibleAt(geometryId: number, value: boolean): this;

getVisibleAt(geometryId: number): boolean;

// Not implemented
optimize(): never;
raycast(): void; // no-op
copy(): never;
toJSON(): never;

dispose(): this;
}

Expand Down

0 comments on commit 7f83ce3

Please sign in to comment.