Skip to content

Commit

Permalink
Example tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Jan 18, 2021
1 parent 1d65c63 commit 41dced6
Showing 1 changed file with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ <h1>PerformanceModel Benchmark</h1>
viewer.scene.camera.look = [-977.5, 17.14933204650879, -397.5];
viewer.scene.camera.up = [-0.17806679010391235, 0.9044896960258484, 0.33330681920051575];

viewer.cameraControl.followPointer = true;
viewer.cameraControl.smartPivot = true;

//------------------------------------------------------------------------------------------------------------------
// Generate the buildings
//------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -193,33 +196,33 @@ <h1>PerformanceModel Benchmark</h1>
// Mouse over Entities to highlight them
//------------------------------------------------------------------------------------------------------------------

var lastEntity = null;

viewer.scene.input.on("mousemove", function (coords) {

var hit = viewer.scene.pick({
canvasPos: coords
});

if (hit) {

if (!lastEntity || hit.entity.id !== lastEntity.id) {

if (lastEntity) {
lastEntity.highlighted = false;
}

lastEntity = hit.entity;
hit.entity.highlighted = true;
}
} else {

if (lastEntity) {
lastEntity.highlighted = false;
lastEntity = null;
}
}
});
// var lastEntity = null;
//
// viewer.scene.input.on("mousemove", function (coords) {
//
// var hit = viewer.scene.pick({
// canvasPos: coords
// });
//
// if (hit) {
//
// if (!lastEntity || hit.entity.id !== lastEntity.id) {
//
// if (lastEntity) {
// lastEntity.highlighted = false;
// }
//
// lastEntity = hit.entity;
// hit.entity.highlighted = true;
// }
// } else {
//
// if (lastEntity) {
// lastEntity.highlighted = false;
// lastEntity = null;
// }
// }
// });

window.model = performanceModel;

Expand Down

0 comments on commit 41dced6

Please sign in to comment.