@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.
- package/dist/browser/index.global.js +20 -20
- package/dist/browser/index.global.js.map +1 -1
- package/dist/cjs/index.cjs +16 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +16 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/render/bsp/geometry.d.ts +10 -0
- package/dist/types/render/bsp/geometry.d.ts.map +1 -1
- package/dist/types/render/bsp/surface.d.ts.map +1 -1
- package/dist/types/render/bsp.d.ts +10 -0
- package/dist/types/render/bsp.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/esm/index.js
CHANGED
|
@@ -4988,6 +4988,16 @@ function createBspSurfaces(map) {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
}
|
|
4990
4990
|
}
|
|
4991
|
+
const mins = { x: Infinity, y: Infinity, z: Infinity };
|
|
4992
|
+
const maxs = { x: -Infinity, y: -Infinity, z: -Infinity };
|
|
4993
|
+
for (let k = 0; k < vertices.length; k += 3) {
|
|
4994
|
+
if (vertices[k] < mins.x) mins.x = vertices[k];
|
|
4995
|
+
if (vertices[k + 1] < mins.y) mins.y = vertices[k + 1];
|
|
4996
|
+
if (vertices[k + 2] < mins.z) mins.z = vertices[k + 2];
|
|
4997
|
+
if (vertices[k] > maxs.x) maxs.x = vertices[k];
|
|
4998
|
+
if (vertices[k + 1] > maxs.y) maxs.y = vertices[k + 1];
|
|
4999
|
+
if (vertices[k + 2] > maxs.z) maxs.z = vertices[k + 2];
|
|
5000
|
+
}
|
|
4991
5001
|
results.push({
|
|
4992
5002
|
vertices: new Float32Array(vertices),
|
|
4993
5003
|
textureCoords: new Float32Array(textureCoords),
|
|
@@ -4996,7 +5006,9 @@ function createBspSurfaces(map) {
|
|
|
4996
5006
|
texture: texInfo.texture,
|
|
4997
5007
|
surfaceFlags: texInfo.flags,
|
|
4998
5008
|
lightmap: lightmapData,
|
|
4999
|
-
faceIndex
|
|
5009
|
+
faceIndex,
|
|
5010
|
+
mins,
|
|
5011
|
+
maxs
|
|
5000
5012
|
});
|
|
5001
5013
|
}
|
|
5002
5014
|
return results;
|
|
@@ -5076,7 +5088,9 @@ function buildBspGeometry(gl, surfaces, map, options = {}) {
|
|
|
5076
5088
|
surfaceFlags: surface.surfaceFlags ?? SURF_NONE,
|
|
5077
5089
|
lightmap: placement,
|
|
5078
5090
|
vertexData,
|
|
5079
|
-
indexData
|
|
5091
|
+
indexData,
|
|
5092
|
+
mins: surface.mins,
|
|
5093
|
+
maxs: surface.maxs
|
|
5080
5094
|
};
|
|
5081
5095
|
});
|
|
5082
5096
|
return { surfaces: results, lightmaps };
|