Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchedMesh: Clean up unused internals #27176

Merged
merged 2 commits into from
Nov 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions examples/jsm/objects/BatchedMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ import {
const ID_ATTR_NAME = 'batchId';
const _matrix = new Matrix4();
const _identityMatrix = new Matrix4();
const _zeroScaleMatrix = new Matrix4().set(
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 1,
);
const _projScreenMatrix = new Matrix4();
const _frustum = new Frustum();
const _box = new Box3();
Expand All @@ -38,6 +32,7 @@ const _batchIntersects = [];
// @TODO: geometry.drawRange support?
// @TODO: geometry.morphAttributes support?
// @TODO: Support uniform parameter per geometry
// @TODO: Add an "optimize" function to pack geometry and remove data gaps

// copies data from attribute "src" into "target" starting at "targetOffset"
function copyAttributeData( src, target, targetOffset = 0 ) {
Expand Down Expand Up @@ -555,17 +550,13 @@ class BatchedMesh extends Mesh {
// Note: User needs to call optimize() afterward to pack the data.

const active = this._active;
const matricesArray = this._matricesTexture.image.data;
const matricesTexture = this._matricesTexture;
if ( geometryId >= active.length || active[ geometryId ] === false ) {

return this;

}

active[ geometryId ] = false;
_zeroScaleMatrix.toArray( matricesArray, geometryId * 16 );
matricesTexture.needsUpdate = true;

return this;

Expand Down Expand Up @@ -664,12 +655,6 @@ class BatchedMesh extends Mesh {

}

optimize() {

throw new Error( 'BatchedMesh: Optimize function not implemented.' );

}

setMatrixAt( geometryId, matrix ) {

// @TODO: Map geometryId to index of the arrays because
Expand Down