|
40 | 40 | LOGGER = get_logger(__name__) |
41 | 41 |
|
42 | 42 |
|
| 43 | +class CollType(Enum): |
| 44 | + """Collision types that static props can have.""" |
| 45 | + NONE = 0 # No collision |
| 46 | + BSP = 1 # Treat the same as MODEL. |
| 47 | + BBOX = 2 |
| 48 | + OBB = 3 |
| 49 | + OBB_YAW = 4 |
| 50 | + VPHYS = 6 # Collision model |
| 51 | + |
| 52 | + |
43 | 53 | @attrs.frozen |
44 | 54 | class QC: |
45 | 55 | path: str # QC path. |
@@ -78,7 +88,7 @@ class QC: |
78 | 88 | # Cache of the SMD models we have already parsed, so we don't need |
79 | 89 | # to parse them again. For the collision model, we store them pre-split. |
80 | 90 | _mesh_cache: ACache[Tuple[QC, int], Mesh] = ACache() |
81 | | -_coll_cache: ACache[Optional[str], List[Mesh]] = ACache() |
| 91 | +_coll_cache: ACache[Tuple[Optional[str], CollType], List[Mesh]] = ACache() |
82 | 92 |
|
83 | 93 | # Limit the amount of decompile/recompiles we do simultaneously. |
84 | 94 | LIM_PROCESS = trio.CapacityLimiter(8) |
@@ -153,16 +163,6 @@ def check(point: Vec) -> bool: |
153 | 163 | return check |
154 | 164 |
|
155 | 165 |
|
156 | | -class CollType(Enum): |
157 | | - """Collision types that static props can have.""" |
158 | | - NONE = 0 # No collision |
159 | | - BSP = 1 # Treat the same as MODEL. |
160 | | - BBOX = 2 |
161 | | - OBB = 3 |
162 | | - OBB_YAW = 4 |
163 | | - VPHYS = 6 # Collision model |
164 | | - |
165 | | - |
166 | 166 | @attrs.frozen |
167 | 167 | class PropPos: |
168 | 168 | """Key used to match models to each other.""" |
@@ -330,7 +330,7 @@ async def compile_func( |
330 | 330 | assert mdl is not None, prop.model |
331 | 331 |
|
332 | 332 | child_ref = await _mesh_cache.fetch((qc, prop.skin), build_reference, prop, qc, mdl) |
333 | | - child_coll = await _coll_cache.fetch(qc.phy_smd, build_collision, qc, prop, child_ref, volume_tolerance > 0) |
| 333 | + child_coll = await _coll_cache.fetch((qc.phy_smd, prop.solidity), build_collision, qc, prop, child_ref, volume_tolerance > 0) |
334 | 334 |
|
335 | 335 | scale = Vec(prop.scale_x, prop.scale_y, prop.scale_z) |
336 | 336 | offset = Vec(prop.x, prop.y, prop.z) |
|
0 commit comments