Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dist/cannon-es.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<n; i++){
this.getVertex(i, v);
quat.vmult(v, v);
Expand All @@ -9137,12 +9137,12 @@ class Trimesh extends Shape {
} else if(v.x > 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;
Expand Down
8 changes: 4 additions & 4 deletions dist/cannon-es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<n; i++){
this.getVertex(i, v);
quat.vmult(v, v);
Expand All @@ -9133,12 +9133,12 @@ class Trimesh extends Shape {
} else if(v.x > 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;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
}),
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/world/World.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down