fixing some smaller issues #449

This commit is contained in:
m-schuetz 2017-12-22 09:42:40 +01:00
parent fd038b0327
commit 54e86ccf4f
4 changed files with 28 additions and 17 deletions

View File

@ -122,7 +122,8 @@ Potree.EarthControls = class EarthControls extends THREE.EventDispatcher {
e.mouse,
this.scene.getActiveCamera(),
this.viewer,
this.scene.pointclouds);
this.scene.pointclouds,
{pickClipped: true});
if (I) {
this.pivot = I.location;

View File

@ -132,7 +132,8 @@ Potree.OrbitControls = class OrbitControls extends THREE.EventDispatcher{
mouse,
camera,
this.viewer,
this.scene.pointclouds);
this.scene.pointclouds,
{pickClipped: true});
if (I === null) {
return;

View File

@ -621,20 +621,25 @@ Potree.ProfileWindow = class ProfileWindow extends THREE.EventDispatcher {
entry.addPoints(points);
this.pointCloudRoot.add(entry.sceneNode);
this.projectedBox.union(entry.projectedBox);
//console.log(this.projectedBox.min.toArray().map(v => v.toFixed(2)).join(", "));
//console.log(this.projectedBox.getSize().toArray().map(v => v.toFixed(2)).join(", "));
if (this.autoFit) {
let width = this.renderArea[0].clientWidth;
let height = this.renderArea[0].clientHeight;
let size = entry.projectedBox.getSize();
let size = this.projectedBox.getSize();
let sx = width / size.x;
let sy = height / size.y;
let sy = height / size.z;
let scale = Math.min(sx, sy);
let center = entry.projectedBox.getCenter();
let center = this.projectedBox.getCenter();
this.scale.set(scale, scale, 1);
this.camera.position.copy(center);
//console.log("camera: ", this.camera.position.toArray().join(", "));
}
//console.log(entry);

View File

@ -34,6 +34,8 @@ function CustomView (buffer) {
Potree = {};
onmessage = function (event) {
performance.mark("binary-decoder-start");
let buffer = event.data.buffer;
let pointAttributes = event.data.pointAttributes;
@ -273,18 +275,6 @@ onmessage = function (event) {
}
performance.mark("spacing-end");
{ // print timings
performance.measure("spacing", "spacing-start", "spacing-end");
let measure = performance.getEntriesByType("measure")[0];
let dpp = 1000 * measure.duration / numPoints;
let debugMessage = `${measure.duration.toFixed(3)} ms, ${numPoints} points, ${dpp.toFixed(3)} µs / point`;
console.log(debugMessage);
}
performance.clearMarks();
performance.clearMeasures();
}
{ // add indices
@ -294,6 +284,20 @@ onmessage = function (event) {
}
}
performance.mark("binary-decoder-end");
//{ // print timings
// //performance.measure("spacing", "spacing-start", "spacing-end");
// performance.measure("binary-decoder", "binary-decoder-start", "binary-decoder-end");
// let measure = performance.getEntriesByType("measure")[0];
// let dpp = 1000 * measure.duration / numPoints;
// let debugMessage = `${measure.duration.toFixed(3)} ms, ${numPoints} points, ${dpp.toFixed(3)} µs / point`;
// console.log(debugMessage);
//}
performance.clearMarks();
performance.clearMeasures();
let message = {
mean: mean,
data: iData,