@@ -141,17 +141,19 @@ IRender_Sector* CRender::detectSector(const Fvector& P, Fvector& dir)
141141 }
142142}
143143
144- xr_vector<IRender_Sector*> CRender ::detectSectors_sphere (CSector* sector, const Fvector& b_center , const Fvector& b_dim )
144+ void R_dsgraph_structure ::detectSectors_sphere (CSector* sector, xr_vector<IRender_Sector*>& m_sectors , const Fsphere& sphere )
145145{
146- xr_vector<IRender_Sector*> m_sectors;
147- m_sectors.push_back (sector);
148- if (rmPortals)
146+ if (sector)
147+ m_sectors.push_back (sector);
148+
149+ if (CDB::MODEL* portals_cform = RImplementation.rmPortals )
149150 {
150151 sectors_detect_xrc.box_options (CDB::OPT_FULL_TEST);
151- sectors_detect_xrc.box_query (rmPortals,b_center,b_dim);
152+ float sphere_r = sphere.R ;
153+ sectors_detect_xrc.box_query (portals_cform, sphere.P , { sphere_r, sphere_r, sphere_r });
152154 for (int K=0 ; K< sectors_detect_xrc.r_count (); K++)
153155 {
154- CPortal* pPortal = (CPortal*) Portals[rmPortals ->get_tris ()[sectors_detect_xrc.r_begin ()[K].id ].dummy ];
156+ CPortal* pPortal = (CPortal*)RImplementation. Portals [portals_cform ->get_tris ()[sectors_detect_xrc.r_begin ()[K].id ].dummy ];
155157
156158 if (!pPortal)
157159 continue ;
@@ -166,20 +168,20 @@ xr_vector<IRender_Sector*> CRender::detectSectors_sphere(CSector* sector, const
166168 m_sectors.push_back (pBack);
167169 }
168170 }
169- return m_sectors;
170171}
171172
172- xr_vector<IRender_Sector*> CRender ::detectSectors_frustum (CSector* sector, CFrustum* _frustum)
173+ void R_dsgraph_structure ::detectSectors_frustum (CSector* sector, xr_vector<IRender_Sector*>& m_sectors , CFrustum* _frustum)
173174{
174- xr_vector<IRender_Sector*> m_sectors;
175- m_sectors.push_back (sector);
176- if (rmPortals)
175+ if (sector)
176+ m_sectors.push_back (sector);
177+
178+ if (CDB::MODEL* portals_cform = RImplementation.rmPortals )
177179 {
178180 sectors_detect_xrc.frustum_options (CDB::OPT_FULL_TEST);
179- sectors_detect_xrc.frustum_query (rmPortals, *_frustum);
181+ sectors_detect_xrc.frustum_query (portals_cform, *_frustum);
180182 for (int K=0 ; K< sectors_detect_xrc.r_count (); K++)
181183 {
182- CPortal* pPortal = (CPortal*) Portals[rmPortals ->get_tris ()[sectors_detect_xrc.r_begin ()[K].id ].dummy ];
184+ CPortal* pPortal = (CPortal*)RImplementation. Portals [portals_cform ->get_tris ()[sectors_detect_xrc.r_begin ()[K].id ].dummy ];
183185
184186 if (!pPortal)
185187 continue ;
@@ -194,5 +196,4 @@ xr_vector<IRender_Sector*> CRender::detectSectors_frustum(CSector* sector, CFrus
194196 m_sectors.push_back (pBack);
195197 }
196198 }
197- return m_sectors;
198199}
0 commit comments