diff --git a/dist/cannon-es.cjs.js b/dist/cannon-es.cjs.js index 92c1c1654..b2c03bb32 100644 --- a/dist/cannon-es.cjs.js +++ b/dist/cannon-es.cjs.js @@ -9127,7 +9127,7 @@ class Trimesh extends Shape { const n = this.vertices.length / 3, verts = this.vertices; const minx,miny,minz,maxx,maxy,maxz; - const v = tempWorldVertex; + const v = tempWorldVertex; for(let i=0; i maxx || maxx===undefined){ maxx = v.x; } - if (v.y < miny || miny===undefined){ + if (v.y < miny || miny===undefined){ miny = v.y; } else if(v.y > maxy || maxy===undefined){ maxy = v.y; } - if (v.z < minz || minz===undefined){ + if (v.z < minz || minz===undefined){ minz = v.z; } else if(v.z > maxz || maxz===undefined){ maxz = v.z; diff --git a/dist/cannon-es.js b/dist/cannon-es.js index 26d835965..cc3f1c647 100644 --- a/dist/cannon-es.js +++ b/dist/cannon-es.js @@ -9123,7 +9123,7 @@ class Trimesh extends Shape { const n = this.vertices.length / 3, verts = this.vertices; const minx,miny,minz,maxx,maxy,maxz; - const v = tempWorldVertex; + const v = tempWorldVertex; for(let i=0; i maxx || maxx===undefined){ maxx = v.x; } - if (v.y < miny || miny===undefined){ + if (v.y < miny || miny===undefined){ miny = v.y; } else if(v.y > maxy || maxy===undefined){ maxy = v.y; } - if (v.z < minz || minz===undefined){ + if (v.z < minz || minz===undefined){ minz = v.z; } else if(v.z > maxz || maxz===undefined){ maxz = v.z; @@ -12194,7 +12194,7 @@ class World extends EventTarget { const tmpAABB1 = new AABB(); const tmpRay$1 = new Ray(); // performance.now() fallback on Date.now() -const performance = window.performance || {}; +const performance = globalThis.performance || {}; if (!performance.now) { let nowOffset = Date.now(); diff --git a/rollup.config.js b/rollup.config.js index 7726968cc..40f52f2d3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -40,7 +40,7 @@ export default [ sizeSnapshot(), replace({ // Use node built-in performance.now in commonjs environments - 'window.performance': `require('perf_hooks').performance`, + 'globalThis.performance': `require('perf_hooks').performance`, }), ], }, diff --git a/src/world/World.ts b/src/world/World.ts index 214fd1aec..0a1456928 100644 --- a/src/world/World.ts +++ b/src/world/World.ts @@ -800,7 +800,7 @@ const tmpArray1 = [] const tmpRay = new Ray() // performance.now() fallback on Date.now() -const performance = (window.performance || {}) as Performance +const performance = (globalThis.performance || {}) as Performance if (!performance.now) { let nowOffset = Date.now()