Skip to content

Commit

Permalink
evaluator improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jun 22, 2022
1 parent f8ef50c commit 42a9e22
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/Evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ function applyToGeometry( geometry, referenceGeometry, groups, attributeInfo ) {

// set the data
const attributes = geometry.attributes;
for ( const key in attributeInfo.groupAttributes[ 0 ] ) {
const rootAttrSet = attributeInfo.groupAttributes[ 0 ];
for ( const key in rootAttrSet ) {

const requiredLength = attributeInfo.getTotalLength( key, groupCount );
const type = attributeInfo.getGroupArray( key, 0 ).type;
const type = rootAttrSet[ key ].type;
let attr = attributes[ key ];
if ( ! attr || attr.array.length < requiredLength ) {

Expand All @@ -35,7 +36,7 @@ function applyToGeometry( geometry, referenceGeometry, groups, attributeInfo ) {
let offset = 0;
for ( let i = 0; i < groupCount; i ++ ) {

const { array, type, length } = attributeInfo.getGroupArray( key, i );
const { array, type, length } = attributeInfo.groupAttributes[ i ][ key ];
const trimmedArray = new type( array.buffer, 0, length );
attr.array.set( trimmedArray, offset );
offset += trimmedArray.length;
Expand Down

0 comments on commit 42a9e22

Please sign in to comment.