@quake2ts/engine 0.0.875 → 0.0.877

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4989,6 +4989,16 @@ function createBspSurfaces(map) {
4989
4989
  }
4990
4990
  }
4991
4991
  }
4992
+ const mins = { x: Infinity, y: Infinity, z: Infinity };
4993
+ const maxs = { x: -Infinity, y: -Infinity, z: -Infinity };
4994
+ for (let k = 0; k < vertices.length; k += 3) {
4995
+ if (vertices[k] < mins.x) mins.x = vertices[k];
4996
+ if (vertices[k + 1] < mins.y) mins.y = vertices[k + 1];
4997
+ if (vertices[k + 2] < mins.z) mins.z = vertices[k + 2];
4998
+ if (vertices[k] > maxs.x) maxs.x = vertices[k];
4999
+ if (vertices[k + 1] > maxs.y) maxs.y = vertices[k + 1];
5000
+ if (vertices[k + 2] > maxs.z) maxs.z = vertices[k + 2];
5001
+ }
4992
5002
  results.push({
4993
5003
  vertices: new Float32Array(vertices),
4994
5004
  textureCoords: new Float32Array(textureCoords),
@@ -4997,7 +5007,9 @@ function createBspSurfaces(map) {
4997
5007
  texture: texInfo.texture,
4998
5008
  surfaceFlags: texInfo.flags,
4999
5009
  lightmap: lightmapData,
5000
- faceIndex
5010
+ faceIndex,
5011
+ mins,
5012
+ maxs
5001
5013
  });
5002
5014
  }
5003
5015
  return results;
@@ -5077,7 +5089,9 @@ function buildBspGeometry(gl, surfaces, map, options = {}) {
5077
5089
  surfaceFlags: surface.surfaceFlags ?? shared.SURF_NONE,
5078
5090
  lightmap: placement,
5079
5091
  vertexData,
5080
- indexData
5092
+ indexData,
5093
+ mins: surface.mins,
5094
+ maxs: surface.maxs
5081
5095
  };
5082
5096
  });
5083
5097
  return { surfaces: results, lightmaps };