Skip to content
Merged
Changes from 1 commit
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
8 changes: 5 additions & 3 deletions src/objects/Points.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
const index = geometry.index;
const attributes = geometry.attributes;
const positions = attributes.position.array;
const stride = attributes.position.isInterleavedBufferAttribute ? attributes.position.data.stride : 3;
const offset = attributes.position.isInterleavedBufferAttribute ? attributes.position.offset : 0;

if ( index !== null ) {

Expand All @@ -79,17 +81,17 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {

const a = indices[ i ];

_position.fromArray( positions, a * 3 );
_position.fromArray( positions, a * stride + offset );

testPoint( _position, a, localThresholdSq, matrixWorld, raycaster, intersects, this );

}

} else {

for ( let i = 0, l = positions.length / 3; i < l; i ++ ) {
for ( let i = 0, l = positions.length / stride; i < l; i ++ ) {

_position.fromArray( positions, i * 3 );
_position.fromArray( positions, i * stride + offset );

testPoint( _position, i, localThresholdSq, matrixWorld, raycaster, intersects, this );

Expand Down