@@ -57,7 +57,7 @@ class _MM_ALIGN16 spatial_box_walker
57
57
}
58
58
};
59
59
60
- void ISpatial_DB::q_box (xr_vector<ISpatialShared>& R, u32 _o, u32 _mask, const Fvector& _center, const Fvector& _size, const Fvector& near_sort_origin )
60
+ void ISpatial_DB::q_box (xr_vector<ISpatialShared>& R, u32 _o, u32 _mask, const Fvector& _center, const Fvector& _size)
61
61
{
62
62
PROF_EVENT (" ISpatial_DB::q_frustum" );
63
63
xrSRWLockGuard guard (&db_lock, true );
@@ -69,21 +69,10 @@ void ISpatial_DB::q_box(xr_vector<ISpatialShared>& R, u32 _o, u32 _mask, const F
69
69
spatial_box_walker W (this , _mask, _center, _size);
70
70
W.bFirst = !!(_o&O_ONLYFIRST);
71
71
W.walk (R, m_root, m_center, m_bounds);
72
-
73
- if (&near_sort_origin != &zero_fvector3)// nearest sorting
74
- {
75
- std::sort (R.begin (), R.end (),
76
- [&near_sort_origin](ISpatialShared& _1, ISpatialShared& _2)
77
- {
78
- float d1 = _1.get () ? _1->spatial .sphere .P .distance_to_sqr (near_sort_origin) : EPS_L;
79
- float d2 = _1.get () ? _2->spatial .sphere .P .distance_to_sqr (near_sort_origin) : EPS;
80
- return d1 < d2;
81
- });
82
- }
83
72
}
84
73
85
- void ISpatial_DB::q_sphere (xr_vector<ISpatialShared>& R, u32 _o, u32 _mask, const Fvector& _center, const float _radius, const Fvector& near_sort_origin )
74
+ void ISpatial_DB::q_sphere (xr_vector<ISpatialShared>& R, u32 _o, u32 _mask, const Fvector& _center, const float _radius)
86
75
{
87
76
Fvector _size = { _radius,_radius,_radius };
88
- q_box (R, _o, _mask, _center, _size, near_sort_origin );
77
+ q_box (R, _o, _mask, _center, _size);
89
78
}
0 commit comments