PF_inPVS Also checks portalareas so that doors block sight.
(float[] p1, float[] p2)
| 144 | * Also checks portalareas so that doors block sight. |
| 145 | */ |
| 146 | public boolean PF_inPVS(float[] p1, float[] p2) { |
| 147 | int leafnum; |
| 148 | int cluster; |
| 149 | int area1, area2; |
| 150 | byte mask[]; |
| 151 | |
| 152 | leafnum = gameImports.cm.CM_PointLeafnum(p1); |
| 153 | cluster = gameImports.cm.CM_LeafCluster(leafnum); |
| 154 | area1 = gameImports.cm.CM_LeafArea(leafnum); |
| 155 | mask = gameImports.cm.CM_ClusterPVS(cluster); |
| 156 | |
| 157 | leafnum = gameImports.cm.CM_PointLeafnum(p2); |
| 158 | cluster = gameImports.cm.CM_LeafCluster(leafnum); |
| 159 | area2 = gameImports.cm.CM_LeafArea(leafnum); |
| 160 | |
| 161 | // quake2 bugfix |
| 162 | if (cluster == -1) |
| 163 | return false; |
| 164 | if (mask != null && (0 == (mask[cluster >>> 3] & (1 << (cluster & 7))))) |
| 165 | return false; |
| 166 | |
| 167 | if (!gameImports.cm.CM_AreasConnected(area1, area2)) |
| 168 | return false; // a door blocks sight |
| 169 | |
| 170 | return true; |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * PF_inPHS. |
nothing calls this directly
no test coverage detected