From 02bf4e35833eb2198caf76b7d7e1c6eb66951cb0 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 07 三月 2023 13:59:09 +0800
Subject: [PATCH] #
---
views/sketh/js/InitCommon.js | 70 +++++++++++------------------------
1 files changed, 22 insertions(+), 48 deletions(-)
diff --git a/views/sketh/js/InitCommon.js b/views/sketh/js/InitCommon.js
index dddc502..0769ee4 100644
--- a/views/sketh/js/InitCommon.js
+++ b/views/sketh/js/InitCommon.js
@@ -86,16 +86,6 @@
let PI_2 = Math.PI / 2; //used by controls below
-let infoElement = document.getElementById('info');
-infoElement.style.cursor = "default";
-infoElement.style.userSelect = "none";
-infoElement.style.MozUserSelect = "none";
-
-let cameraInfoElement = document.getElementById('cameraInfo');
-cameraInfoElement.style.cursor = "default";
-cameraInfoElement.style.userSelect = "none";
-cameraInfoElement.style.MozUserSelect = "none";
-
let mouseControl = true;
let pointerlockChange;
let fileLoader = new THREE.FileLoader();
@@ -167,7 +157,7 @@
SCREEN_WIDTH = document.body.clientWidth; //window.innerWidth;
SCREEN_HEIGHT = document.body.clientHeight; //window.innerHeight;
- renderer.setPixelRatio(pixelRatio);
+ // renderer.setPixelRatio(pixelRatio);
renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
fontAspect = (SCREEN_WIDTH / 175) * (SCREEN_HEIGHT / 200);
@@ -238,7 +228,6 @@
} // end function onWindowResize( event )
-
function init()
{
@@ -282,27 +271,27 @@
// since I use the lil-gui.min.js minified version of lil-gui without modern exports,
//'g()' is 'GUI()' ('g' is the shortened version of 'GUI' inside the lil-gui.min.js file)
- gui = new g(); // same as gui = new GUI();
+ // gui = new g(); // same as gui = new GUI();
- pixel_ResolutionController = gui.add(pixel_ResolutionObject, 'pixel_Resolution', 0.5, 1.0, 0.05).onChange(handlePixelResolutionChange);
- if (!mouseControl)
- orthographicCamera_ToggleController = gui.add(orthographicCamera_ToggleObject, 'Orthographic_Camera', false).onChange(handleCameraProjectionChange);
+ // pixel_ResolutionController = gui.add(pixel_ResolutionObject, 'pixel_Resolution', 0.5, 1.0, 0.05).onChange(handlePixelResolutionChange);
+ // if (!mouseControl) // todo: 鏄惁鑳藉鐐瑰嚮
+ // orthographicCamera_ToggleController = gui.add(orthographicCamera_ToggleObject, 'Orthographic_Camera', false).onChange(handleCameraProjectionChange);
- gui.domElement.style.userSelect = "none";
- gui.domElement.style.MozUserSelect = "none";
+ // gui.domElement.style.userSelect = "none";
+ // gui.domElement.style.MozUserSelect = "none";
if (mouseControl)
{
- gui.domElement.addEventListener("mouseenter", function (event)
- {
- ableToEngagePointerLock = false;
- }, false);
- gui.domElement.addEventListener("mouseleave", function (event)
- {
- ableToEngagePointerLock = true;
- }, false);
+ // gui.domElement.addEventListener("mouseenter", function (event)
+ // {
+ // ableToEngagePointerLock = false;
+ // }, false);
+ // gui.domElement.addEventListener("mouseleave", function (event)
+ // {
+ // ableToEngagePointerLock = true;
+ // }, false);
window.addEventListener('wheel', onMouseWheel, false);
@@ -347,21 +336,6 @@
document.addEventListener('webkitpointerlockchange', pointerlockChange, false);
} // end if (mouseControl)
-
-
- /* // Fullscreen API (optional)
- document.addEventListener("click", function()
- {
- if ( !document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement )
- {
- if (document.documentElement.requestFullscreen)
- document.documentElement.requestFullscreen();
- else if (document.documentElement.mozRequestFullScreen)
- document.documentElement.mozRequestFullScreen();
- else if (document.documentElement.webkitRequestFullscreen)
- document.documentElement.webkitRequestFullscreen();
- }
- }); */
initTHREEjs(); // boilerplate: init necessary three.js items and scene/demo-specific objects
@@ -461,12 +435,12 @@
// setup scene/demo-specific objects, variables, GUI elements, and data
initSceneData();
- pixel_ResolutionController.setValue(pixelRatio);
- if (!allowOrthographicCamera && !mouseControl)
- {
- orthographicCamera_ToggleController.domElement.hidden = true;
- orthographicCamera_ToggleController.domElement.remove();
- }
+ // pixel_ResolutionController.setValue(pixelRatio);
+ // if (!allowOrthographicCamera && !mouseControl)
+ // {
+ // orthographicCamera_ToggleController.domElement.hidden = true;
+ // orthographicCamera_ToggleController.domElement.remove();
+ // }
@@ -613,7 +587,7 @@
// if GUI has been used, update
if (needChangePixelResolution)
{
- pixelRatio = pixel_ResolutionController.getValue();
+ // pixelRatio = pixel_ResolutionController.getValue();
onWindowResize();
needChangePixelResolution = false;
}
--
Gitblit v1.9.1