… | |
… | |
120 | else |
120 | else |
121 | { |
121 | { |
122 | sector center_s (orig + extent / 2 - ctx.orig); |
122 | sector center_s (orig + extent / 2 - ctx.orig); |
123 | point center (center_s.x, center_s.y, center_s.z); |
123 | point center (center_s.x, center_s.y, center_s.z); |
124 | |
124 | |
125 | GLfloat dia = (2. * sqrtf (3))*(GLfloat)extent; |
125 | GLfloat dia = (2. * sqrtf (3)) * (GLfloat)extent; |
126 | |
126 | |
127 | if (ctx.frustum.t.distance (center) < -dia) return; |
127 | if (ctx.frustum.t.distance (center) < -dia) return; |
128 | if (ctx.frustum.b.distance (center) < -dia) return; |
128 | if (ctx.frustum.b.distance (center) < -dia) return; |
129 | if (ctx.frustum.l.distance (center) < -dia) return; |
129 | if (ctx.frustum.l.distance (center) < -dia) return; |
130 | if (ctx.frustum.r.distance (center) < -dia) return; |
130 | if (ctx.frustum.r.distance (center) < -dia) return; |
… | |
… | |
135 | if (fd < -dia) |
135 | if (fd < -dia) |
136 | { |
136 | { |
137 | if (fd < -dia * 2) |
137 | if (fd < -dia * 2) |
138 | return; |
138 | return; |
139 | |
139 | |
140 | // cull, but do check for potential visibility |
|
|
141 | if (size ()) |
|
|
142 | { |
|
|
143 | ctx.farlist.push_back (this); |
140 | ctx.farlist.push_back (this); |
144 | return; |
141 | return; |
145 | } |
|
|
146 | } |
142 | } |
147 | } |
143 | } |
148 | |
144 | |
149 | if (size ()) |
145 | if (size ()) |
150 | ctx.vislist.push_back (this); |
146 | ctx.vislist.push_back (this); |