fix mirroring. fix cache refresh bug
This commit is contained in:
parent
ad3575835b
commit
55baeea6c8
2 changed files with 12 additions and 6 deletions
12
app.js
12
app.js
|
|
@ -780,10 +780,14 @@ function getCachedFile(file, fn) {
|
|||
let smod = lastmod(filePath),
|
||||
cmod = cached.mtime;
|
||||
|
||||
if (!smod) throw "missing source file";
|
||||
if (smod > cmod) cached = null;
|
||||
|
||||
cached.lastcheck = now;
|
||||
if (!smod) {
|
||||
throw "missing source file";
|
||||
}
|
||||
if (smod > cmod) {
|
||||
cached = null;
|
||||
} else {
|
||||
cached.lastcheck = now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -519,12 +519,14 @@
|
|||
PRO._mirror = function() {
|
||||
this.setWireframe(false);
|
||||
this.clearSlices();
|
||||
this.mesh.applyMatrix4(new THREE.Matrix4().makeScale(-1, 1, 1));
|
||||
let vert = this.getGeoVertices();
|
||||
for (let i=0; i<vert.length; i += 3) {
|
||||
vert[i] = -vert[i];
|
||||
}
|
||||
let geo = this.mesh.geometry,
|
||||
o = this.track;
|
||||
geo.computeFaceNormals();
|
||||
geo.computeVertexNormals();
|
||||
this.mesh.position.x = -this.mesh.position.x;
|
||||
o.mirror = !o.mirror;
|
||||
this.modified = true;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue