@@ -508,36 +508,36 @@ namespace
508508
509509 size_t entityNo = state.range ();
510510
511- auto const entities = GenerateBoxesRandom<DIMENSION_NO>(entityNo);
511+ auto const entities = GenerateBoxesRandom<DIMENSION_NO>(entityNo, 2 );
512512 auto const boxSpace = CreateSearcBox<DIMENSION_NO>(0 , rMax);
513513 auto const tree = TreeBoxND<DIMENSION_NO, SPLIT_DEPTH_INCREASEMENT>(entities, depth, boxSpace);
514514
515515 size_t constexpr rayNo = 100 ;
516- auto const rayOrigins = GeneratePointsRandom<DIMENSION_NO>(rayNo, 0 );
517- auto const rayDirections = GeneratePointsRandom<DIMENSION_NO>(rayNo, 0 );
516+ auto const rayOrigins = GeneratePointsRandom<DIMENSION_NO>(rayNo, 3 );
517+ auto const rayDirections = GeneratePointsRandom<DIMENSION_NO>(rayNo, 4 );
518518
519519 auto rays = std::vector<RayND<DIMENSION_NO>>{};
520520 for (size_t rayID = 0 ; rayID < rayNo; ++rayID)
521521 {
522- auto const direction = GetNormalized<DIMENSION_NO>(rayDirections[rayID]);
522+ auto const direction = GetNormalized<DIMENSION_NO>(rayDirections[rayNo - 1 - rayID]);
523523 if (!direction)
524524 {
525525 continue ;
526526 }
527- rays.push_back (RayND<DIMENSION_NO>{ .Origin = rayOrigins[rayNo ], .Direction = *direction });
527+ rays.push_back (RayND<DIMENSION_NO>{ .Origin = rayOrigins[rayID ], .Direction = *direction });
528528 }
529529
530530 size_t entityID = 0 ;
531531 for (auto _ : state)
532532 {
533- auto const [origin, direction] = rays[entityID % rayNo ];
533+ auto const & ray = rays[entityID % rays. size () ];
534534 if constexpr (IS_FIRST)
535535 {
536- tree.RayIntersectedFirst (origin, direction , entities, 0 );
536+ tree.RayIntersectedFirst (ray. Origin , ray. Direction , entities, 0 );
537537 }
538538 else
539539 {
540- tree.RayIntersectedAll (origin, direction , entities, 0 );
540+ tree.RayIntersectedAll (ray. Origin , ray. Direction , entities, 0 );
541541 }
542542 ++entityID;
543543 }
0 commit comments