@@ -463,14 +463,18 @@ suite('raycaster', function () {
463463 el . sceneEl . object3D . updateMatrixWorld ( ) ;
464464 component . refreshObjects ( ) ;
465465 component . tick ( ) ;
466- line = el . getAttribute ( 'line' ) ;
467- assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 24.5 ) ;
468- box . parentNode . removeChild ( box ) ;
469466 setTimeout ( ( ) => {
470- component . tick ( ) ;
471467 line = el . getAttribute ( 'line' ) ;
472- assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 1000 ) ;
473- done ( ) ;
468+ assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 24.5 ) ;
469+ box . parentNode . removeChild ( box ) ;
470+ setTimeout ( ( ) => {
471+ component . tick ( ) ;
472+ setTimeout ( ( ) => {
473+ line = el . getAttribute ( 'line' ) ;
474+ assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 1000 ) ;
475+ done ( ) ;
476+ } ) ;
477+ } ) ;
474478 } ) ;
475479 } ) ;
476480 } ) ;
@@ -488,7 +492,7 @@ suite('raycaster', function () {
488492
489493 rayEl2 = document . createElement ( 'a-entity' ) ;
490494 rayEl2 . setAttribute ( 'raycaster' , {
491- direction : '0 -1 -1' ,
495+ direction : '0 0 -1' ,
492496 origin : '0 0 0' ,
493497 showLine : true ,
494498 objects : '#target'
@@ -512,19 +516,23 @@ suite('raycaster', function () {
512516 component . tick ( ) ;
513517 rayEl2 . components . raycaster . tick ( ) ;
514518 rayEl2 . components . raycaster . tick ( ) ;
515- // ensure component and geometry are unaffected by other raycaster
516- line = el . getAttribute ( 'line' ) ;
517- assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 24.5 ) ;
518- lineEnd . fromArray ( lineArray , 3 ) ;
519- assert . equal ( lineStart . fromArray ( lineArray ) . sub ( lineEnd ) . length ( ) , 24.5 ) ;
520- box . parentNode . removeChild ( box ) ;
521519 setTimeout ( ( ) => {
522- component . tick ( ) ;
520+ // Ensure component and geometry are unaffected by other raycaster
523521 line = el . getAttribute ( 'line' ) ;
524- assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 1000 ) ;
522+ assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 24.5 ) ;
525523 lineEnd . fromArray ( lineArray , 3 ) ;
526- assert . equal ( lineStart . fromArray ( lineArray ) . sub ( lineEnd ) . length ( ) , 1000 ) ;
527- done ( ) ;
524+ assert . equal ( lineStart . fromArray ( lineArray ) . sub ( lineEnd ) . length ( ) , 24.5 ) ;
525+ box . parentNode . removeChild ( box ) ;
526+ setTimeout ( ( ) => {
527+ component . tick ( ) ;
528+ setTimeout ( ( ) => {
529+ line = el . getAttribute ( 'line' ) ;
530+ assert . equal ( new THREE . Vector3 ( ) . copy ( line . start ) . sub ( line . end ) . length ( ) , 1000 ) ;
531+ lineEnd . fromArray ( lineArray , 3 ) ;
532+ assert . equal ( lineStart . fromArray ( lineArray ) . sub ( lineEnd ) . length ( ) , 1000 ) ;
533+ done ( ) ;
534+ } ) ;
535+ } ) ;
528536 } ) ;
529537 } ) ;
530538 } ) ;
0 commit comments