File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ function findLayerInParent(obj) {
99
99
}
100
100
101
101
const raycaster = new THREE . Raycaster ( ) ;
102
+ const normalized = new THREE . Vector2 ( ) ;
102
103
103
104
/**
104
105
* @module Picking
@@ -208,8 +209,9 @@ export default {
208
209
} else {
209
210
raycaster . layers . enableAll ( ) ;
210
211
}
212
+ // Raycaster use NDC coordinate
213
+ view . viewToNormalizedCoords ( viewCoords , normalized ) ;
211
214
if ( radius < 0 ) {
212
- const normalized = view . viewToNormalizedCoords ( viewCoords ) ;
213
215
raycaster . setFromCamera ( normalized , view . camera . camera3D ) ;
214
216
215
217
const intersects = raycaster . intersectObject ( object , true ) ;
@@ -239,8 +241,6 @@ export default {
239
241
const clearG = Math . round ( 255 * clearColor . g ) ;
240
242
const clearB = Math . round ( 255 * clearColor . b ) ;
241
243
242
- // Raycaster use NDC coordinate
243
- const normalized = view . viewToNormalizedCoords ( viewCoords ) ;
244
244
const tmp = normalized . clone ( ) ;
245
245
traversePickingCircle ( radius , ( x , y ) => {
246
246
// x, y are offset from the center of the picking circle,
You can’t perform that action at this time.
0 commit comments