mirror of
https://github.com/overte-org/overte.git
synced 2025-04-27 00:56:53 +02:00
39 lines
No EOL
1.1 KiB
JavaScript
39 lines
No EOL
1.1 KiB
JavaScript
//
|
|
// antialiasing.js
|
|
//
|
|
// Created by Sam Gateau on 8/14/2017
|
|
// Copyright 2017 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
// Set up the qml ui
|
|
var qml = Script.resolvePath('antialiasing.qml');
|
|
var window = new OverlayWindow({
|
|
title: 'Antialiasing',
|
|
source: qml,
|
|
width: 400, height:400,
|
|
});
|
|
window.setPosition(Window.innerWidth - 420, 50);
|
|
window.closed.connect(function() { Script.stop(); });
|
|
|
|
|
|
|
|
var moveDebugCursor = false;
|
|
Controller.mousePressEvent.connect(function (e) {
|
|
if (e.isMiddleButton) {
|
|
moveDebugCursor = true;
|
|
setDebugCursor(e.x, e.y);
|
|
}
|
|
});
|
|
Controller.mouseReleaseEvent.connect(function() { moveDebugCursor = false; });
|
|
Controller.mouseMoveEvent.connect(function (e) { if (moveDebugCursor) setDebugCursor(e.x, e.y); });
|
|
|
|
|
|
function setDebugCursor(x, y) {
|
|
nx = (x / Window.innerWidth);
|
|
ny = 1.0 - ((y) / (Window.innerHeight - 32));
|
|
|
|
Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny };
|
|
} |