Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Aug 29, 2023
1 parent 6dd0911 commit ea3a6a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/core/build/geometryUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export function getFullGeometryRange( geo ) {
const triCount = getTriCount( geo );

const offset = Math.max( 0, start / 3 );
const count = Math.min( triCount, end / 3 );
const count = Math.min( triCount, end / 3 ) - offset;
return [ {
offset: ~ ~ offset,
count: ~ ~ count,
offset: Math.floor( offset ),
count: Math.floor( count ),
} ];

}
Expand Down Expand Up @@ -102,10 +102,10 @@ export function getRootIndexRanges( geo ) {
const end = sortedBoundaries[ i + 1 ] / 3;

const offset = Math.max( start, drawRangeStart / 3 );
const count = Math.min( end - start, drawRangeEnd / 3 );
const count = Math.min( end, drawRangeEnd / 3 ) - offset;
ranges.push( {
offset: ~ ~ offset,
count: ~ ~ count,
offset: Math.floor( offset ),
count: Math.floor( count ),
} );

}
Expand Down
2 changes: 1 addition & 1 deletion test/MeshBVHUniformStruct.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe( 'MeshBVHUniformStruct', () => {
it( 'should fail if more than one group is present.', () => {

geometry.addGroup( 0, 300, 0 );
geometry.addGroup( 301, 600, 1 );
geometry.addGroup( 300, 600, 1 );

const bvh = new MeshBVH( geometry );
let error;
Expand Down

0 comments on commit ea3a6a7

Please sign in to comment.