@@ -52,9 +52,10 @@ class CollType(Enum):
5252
5353@attrs .frozen
5454class QC :
55+ """The relevant we need from a QC."""
5556 path : str # QC path.
56- ref_smd : str # Location of main visible geometry.
57- phy_smd : Optional [str ] # Relative location of collision model, or None
57+ ref_smd : str # Absolute location of main visible geometry.
58+ phy_smd : Optional [str ] # Absolute location of collision model, or None
5859 ref_scale : float # Scale of main model.
5960 phy_scale : float # Scale of collision model.
6061 is_concave : bool # If the collision model is known to be concave.
@@ -150,10 +151,6 @@ def make_collision_brush(origin: Vec, angles: Angle, brush: BModel) -> Callable[
150151 """Produce a collision checker using a brush entity."""
151152 # Transpose the angles, giving us the inverse transform.
152153 inv_angles = Matrix .from_angle (angles ).transpose ()
153- # brushes = {
154- # br for leaf in brush.node.iter_leafs()
155- # for br in leaf.brushes
156- # }
157154
158155 def check (point : Vec ) -> bool :
159156 """Check if the given position is inside the volume."""
@@ -336,7 +333,6 @@ async def compile_func(
336333 offset = Vec (prop .x , prop .y , prop .z )
337334 rot_matrix = Matrix .from_angle (prop .pit , prop .yaw , prop .rol )
338335
339-
340336 ref_mesh .append_model (child_ref , rot_matrix , offset , scale * qc .ref_scale )
341337
342338 if has_coll and child_coll is not None :
@@ -345,9 +341,9 @@ async def compile_func(
345341 matrix = Matrix ()
346342
347343 # Set the scale
348- matrix [0 ,0 ] = phy_scale .x
349- matrix [1 ,1 ] = phy_scale .y
350- matrix [2 ,2 ] = phy_scale .z
344+ matrix [0 , 0 ] = phy_scale .x
345+ matrix [1 , 1 ] = phy_scale .y
346+ matrix [2 , 2 ] = phy_scale .z
351347
352348 # Rotate the matrix
353349 matrix @= rot_matrix
@@ -1271,15 +1267,15 @@ def get_grouping_key(prop: StaticProp) -> Optional[tuple]:
12711267 pack_models = pack_models ,
12721268 ) as compiler :
12731269 async def do_combine (group : List [StaticProp ]) -> None :
1274- nonlocal group_count
1270+ """Task run to combine one prop."""
12751271 grouped_prop = await combine_group (compiler , group , get_model , volume_tolerance )
12761272 rejected .difference_update (group )
12771273 final_props .append (grouped_prop )
1278- group_count += 1
12791274
12801275 async with trio .open_nursery () as nursery :
12811276 for group_ in grouper :
12821277 nursery .start_soon (do_combine , group_ )
1278+ group_count += 1
12831279
12841280 final_props .extend (rejected )
12851281
0 commit comments