The client will interpolate the view position, so we can't use a single PVS point.
(float[] org)
| 212 | * PVS point. |
| 213 | */ |
| 214 | public void SV_FatPVS(float[] org) { |
| 215 | int leafs[] = new int[64]; |
| 216 | int i, j, count; |
| 217 | int longs; |
| 218 | byte src[]; |
| 219 | float[] mins = { 0, 0, 0 }, maxs = { 0, 0, 0 }; |
| 220 | |
| 221 | for (i = 0; i < 3; i++) { |
| 222 | mins[i] = org[i] - 8; |
| 223 | maxs[i] = org[i] + 8; |
| 224 | } |
| 225 | final CM cm = gameImports.cm; |
| 226 | count = cm.CM_BoxLeafnums(mins, maxs, leafs, 64, null); |
| 227 | |
| 228 | if (count < 1) |
| 229 | Com.Error(Defines.ERR_FATAL, "SV_FatPVS: count < 1"); |
| 230 | |
| 231 | longs = (cm.CM_NumClusters() + 31) >> 5; |
| 232 | |
| 233 | // convert leafs to clusters |
| 234 | for (i = 0; i < count; i++) |
| 235 | leafs[i] = cm.CM_LeafCluster(leafs[i]); |
| 236 | |
| 237 | System.arraycopy(cm.CM_ClusterPVS(leafs[0]), 0, fatpvs, 0, |
| 238 | longs << 2); |
| 239 | // or in all the other leaf bits |
| 240 | for (i = 1; i < count; i++) { |
| 241 | for (j = 0; j < i; j++) |
| 242 | if (leafs[i] == leafs[j]) |
| 243 | break; |
| 244 | if (j != i) |
| 245 | continue; // already have the cluster we want |
| 246 | |
| 247 | src = cm.CM_ClusterPVS(leafs[i]); |
| 248 | |
| 249 | //for (j=0 ; j<longs ; j++) |
| 250 | // ((long *)fatpvs)[j] |= ((long *)src)[j]; |
| 251 | int k = 0; |
| 252 | for (j = 0; j < longs; j++) { |
| 253 | fatpvs[k] |= src[k++]; |
| 254 | fatpvs[k] |= src[k++]; |
| 255 | fatpvs[k] |= src[k++]; |
| 256 | fatpvs[k] |= src[k++]; |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * Decides which entities are going to be visible to the client, and copies |
no test coverage detected