private void BuilFaceToLeafMap(FaceToLeafMap faceMap, int i, leaf_t dleaf) { if (dleaf.leafface >= 0 && dleaf.n_leaffaces >= 0) for (int j = dleaf.leafface; j < dleaf.leafface + dleaf.n_leaffaces; ++j) faceMap.Faces[(int)listOfFaces[j]].AddLeaf(i); }
private BspTreeLeaf BuildLeaf(leaf_t dleaf) { var res = new BspTreeLeaf(); res.Mins = new Vector3(dleaf.box.mins[0], dleaf.box.mins[1], dleaf.box.mins[2]); res.Maxs = new Vector3(dleaf.box.maxs[0], dleaf.box.maxs[1], dleaf.box.maxs[2]); for (int i = dleaf.leafbrush; i < dleaf.leafbrush + dleaf.n_leafbrushes; ++i) { BspCollisionObject b = BuildLeafBrush((int)listOfBrushes[i]); if (b != null) res.Colliders.Add(b); } //res.Geometries.Add(BuildGeometry((uint)dleaf.leafface, (uint)dleaf.n_leaffaces)); return res; }