File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -580,16 +580,20 @@ void SKdNode::SnapToVertex(Vector v, SMesh *extras) {
580
580
bool mightHit = true ;
581
581
582
582
for (k = 0 ; k < 3 ; k++) {
583
- if ((tr->a ).Element (k) < v.Element (k) - KDTREE_EPS &&
584
- (tr->b ).Element (k) < v.Element (k) - KDTREE_EPS &&
585
- (tr->c ).Element (k) < v.Element (k) - KDTREE_EPS)
583
+ double trA = (tr->a ).Element (k);
584
+ double trB = (tr->b ).Element (k);
585
+ double trC = (tr->c ).Element (k);
Has comments. Original line has comments.
586
+ double vk = v.Element (k);
587
+ if (trA < vk - KDTREE_EPS &&
588
+ trB < vk - KDTREE_EPS &&
589
+ trC < vk - KDTREE_EPS)
586
590
{
587
591
mightHit = false ;
588
592
break ;
589
593
}
590
- if ((tr-> a ). Element (k) > v. Element (k) + KDTREE_EPS &&
591
- (tr-> b ). Element (k) > v. Element (k) + KDTREE_EPS &&
592
- (tr-> c ). Element (k) > v. Element (k) + KDTREE_EPS)
594
+ if (trA > vk + KDTREE_EPS &&
595
+ trB > vk + KDTREE_EPS &&
596
+ trC > vk + KDTREE_EPS)
593
597
{
594
598
mightHit = false ;
595
599
break ;
You can’t perform that action at this time.