Browse Source

优化页面-旋转功能

master
xuhuajiao 5 months ago
parent
commit
719b997d3f
  1. BIN
      public/webThird/asset/F51.glb
  2. BIN
      public/webThird/asset/F52.glb
  3. BIN
      public/webThird/asset/Line.glb
  4. BIN
      public/webThird/asset/TotalCamera.glb
  5. BIN
      public/webThird/asset/total2.glb
  6. 96
      public/webThird/index.js
  7. 2061
      public/webThird/js/bootstrap-slider.js
  8. 190
      public/webThird/js/easyloader.js
  9. 778
      public/webThird/js/index.js
  10. 18706
      public/webThird/js/jquery-ui.js
  11. 11008
      public/webThird/js/jquery.js
  12. 138
      public/webThird/js/jquery.timers.min.js
  13. BIN
      public/webWater/asset/Line.glb
  14. BIN
      public/webWater/asset/TotalCamera.glb
  15. BIN
      public/webWater/asset/total2.glb
  16. 302
      public/webWater/index.js
  17. 2061
      public/webWater/js/bootstrap-slider.js
  18. 190
      public/webWater/js/easyloader.js
  19. 778
      public/webWater/js/index.js
  20. 18706
      public/webWater/js/jquery-ui.js
  21. 11008
      public/webWater/js/jquery.js
  22. 138
      public/webWater/js/jquery.timers.min.js
  23. 9
      src/assets/styles/index.scss
  24. 11
      src/icons/svg/rotate.svg
  25. 13
      src/icons/svg/srotate.svg
  26. 19
      src/views/header/index.vue
  27. 15
      src/views/index.vue
  28. 64
      src/views/pageBasement/index.vue
  29. 69
      src/views/pageFullView/index.vue
  30. 21
      src/views/pageThirdFloor/index.vue
  31. 27
      src/views/pageWaterPumpHouse/index.vue

BIN
public/webThird/asset/F51.glb

BIN
public/webThird/asset/F52.glb

BIN
public/webThird/asset/Line.glb

BIN
public/webThird/asset/TotalCamera.glb

BIN
public/webThird/asset/total2.glb

96
public/webThird/index.js

@ -164,7 +164,7 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
show = 50
document.getElementById('customLoadingScreenDiv').style.display = 'none'
document.getElementById('customLoadingScreenDiv_first').style.display = 'none'
document.title = '整体'
document.title = '5综3楼'
var prepareGroupButton2ByMesh = function(transformNodex, color, qu) {
var mesheses = null
if (transformNodex.getClassName() === 'Mesh') {
@ -301,6 +301,17 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
}
jk01.baojing = false // 假设初始不报警,可根据实际情况修改
// var mesheses = null
// if (jk01.getClassName() === 'TransformNode') {
// mesheses = jk01.getChildMeshes(false)
// } else {
// mesheses = []
// mesheses.push(jk01)
// }
// for (var i = 0; i < mesheses.length; i++) {
// h2.addMesh(mesheses[i], colorToUse)
// }
prepareGroupButton2(jk01, cl)
})
@ -338,7 +349,7 @@ var createScene = function() {
engine.displayLoadingUI()
var scene = new BABYLON.Scene(engine)
camera = new BABYLON.ArcRotateCamera(
'Camera', 0, 0, 60, // alpha=0(水平角度),beta=90°(垂直俯视),radius=200(距离)
'Camera', 0, 0, 120, // alpha=0(水平角度),beta=90°(垂直俯视),radius=200(距离)
new BABYLON.Vector3(0, 0, 0), // 相机位置会根据 alpha/beta/radius 自动计算,无需手动设置
scene
)
@ -346,8 +357,8 @@ var createScene = function() {
camera.attachControl(canvas, true)
// 其他参数(保持不变或按需调整)
camera.lowerRadiusLimit = 50 // 最小距离(可近看)
camera.upperRadiusLimit = 500 // 最大距离(可远观)
camera.lowerRadiusLimit = 10 // 最小距离(可近看)
camera.upperRadiusLimit = 1000 // 最大距离(可远观)
camera.inertia = 0.1 // 操作惯性
camera.useAutoRotationBehavior = true // 开启自动旋转(可选)
@ -358,15 +369,34 @@ var createScene = function() {
// var camera1_status = scene.activeCamera.storeState()
var assetsManager = new BABYLON.AssetsManager(scene)
var meshTask = assetsManager.addMeshTask('skull task', '', 'asset/', 'F5.glb')
meshTask.onSuccess = function(task) {
task.loadedMeshes[0].scaling = new BABYLON.Vector3(0.4, 0.4, 0.4)
task.loadedMeshes[0].position = new BABYLON.Vector3(0, 0.35, 0)
}
meshTask.onError = function(task, message, exception) {
console.log(message, exception)
}
// var meshTask = assetsManager.addMeshTask('skull task', '', 'asset/', 'F5.glb')
// meshTask.onSuccess = function(task) {
// task.loadedMeshes[0].scaling = new BABYLON.Vector3(0.4, 0.4, 0.4)
// task.loadedMeshes[0].position = new BABYLON.Vector3(0, 0.35, 0)
// }
// meshTask.onError = function(task, message, exception) {
// console.log(message, exception)
// }
// 加载GLB模型并处理材质
BABYLON.SceneLoader.LoadAssetContainerAsync('asset/', 'F5.glb', scene).then((container) => {
// 遍历所有材质
container.materials.forEach(material => {
// 处理标准材质
if (material instanceof BABYLON.StandardMaterial) {
material.backFaceCulling = true // 启用背面剔除
}
// 处理PBR材质
// if (material instanceof BABYLON.PBRMaterial) {
// material.backFaceCulling = true // 启用背面剔除
// }
})
// 将加载的资产添加到场景中
container.addAllToScene()
}).catch((error) => {
console.error('加载模型时出错:', error)
})
var hdrTexture = new BABYLON.CubeTexture.CreateFromPrefilteredData('textures/environmentSpecular.env', scene)
scene.environmentTexture = hdrTexture
@ -389,7 +419,6 @@ var createScene = function() {
}
}
}
// renderCanvas.style.backgroundImage = 'url("./textures/' + '4' + '.jpg")'
assetsManager.load()
@ -399,7 +428,6 @@ var createScene = function() {
// drag.useObjectOrienationForDragging = false;
drag.validateDrag = (targetPosition) => {
// console.log(targetPosition)
if (targetPosition.x > 10.5 || targetPosition.x < -10.5) {
return false
}
@ -415,7 +443,6 @@ var createScene = function() {
// console.log(event);
// console.log(line03_position)
})
// console.log("x3");
// GUI
h1 = new BABYLON.HighlightLayer('hl1', scene)
h2 = new BABYLON.HighlightLayer('hl2', scene)
@ -523,22 +550,37 @@ function handleAlarm(deviceId, isAlarm) {
console.log(`未找到设备 ID 为 ${deviceId} 的设备`)
}
}
// 监测父页面传来得初始化得温度湿度值
window.addEventListener(
'message',
function(e) {
console.log('ddd', e.data.data)
const deviceData = e.data.data
if (Array.isArray(deviceData)) {
deviceData.forEach(device => {
handleAlarm(device.deviceId, device.isAlarm)
})
} else {
handleAlarm(deviceData.deviceId, deviceData.isAlarm)
if (e.data.type === 'deviceState') {
console.log('ddd', e.data.data)
const deviceData = e.data.data
if (Array.isArray(deviceData)) {
deviceData.forEach((device) => {
handleAlarm(device.deviceId, device.isAlarm)
})
} else {
handleAlarm(deviceData.deviceId, deviceData.isAlarm)
}
} else if (e.data.type === 'isGetRotate') {
const isGetRotate = e.data.value
console.log('isGetRotate:', isGetRotate)
// 这里可以添加处理 isGetRotate 的逻辑
toggleAutoRotation(isGetRotate)
}
},
false
)
window.handleAlarm = handleAlarm
function toggleAutoRotation(isAutoRotating) {
var camera = scene.activeCamera
if (!isAutoRotating) {
// 启用自动旋转
camera.useAutoRotationBehavior = true
} else {
// 禁用自动旋转
camera.useAutoRotationBehavior = false
camera.angularSpeed = 0 // 停止旋转
}
}

2061
public/webThird/js/bootstrap-slider.js
File diff suppressed because it is too large
View File

190
public/webThird/js/easyloader.js

@ -1,190 +0,0 @@
/**
* EasyUI for jQuery 1.7.0
*
* Copyright (c) 2009-2018 www.jeasyui.com. All rights reserved.
*
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
* To use it on other terms please contact us: info@jeasyui.com
*
*/
(function(){
var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},radiobutton:{js:"jquery.radiobutton.js",css:"radiobutton.css"},checkbox:{js:"jquery.checkbox.js",css:"checkbox.css"},sidemenu:{js:"jquery.sidemenu.js",css:"sidemenu.css",dependencies:["accordion","tree","tooltip"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}};
var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"};
var _3={};
function _4(_5,_6){
var _7=false;
var _8=document.createElement("script");
_8.type="text/javascript";
_8.language="javascript";
_8.src=_5;
_8.onload=_8.onreadystatechange=function(){
if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){
_7=true;
_8.onload=_8.onreadystatechange=null;
if(_6){
_6.call(_8);
}
}
};
document.getElementsByTagName("head")[0].appendChild(_8);
};
function _9(_a,_b){
_4(_a,function(){
document.getElementsByTagName("head")[0].removeChild(this);
if(_b){
_b();
}
});
};
function _c(_d,_e){
var _f=document.createElement("link");
_f.rel="stylesheet";
_f.type="text/css";
_f.media="screen";
_f.href=_d;
document.getElementsByTagName("head")[0].appendChild(_f);
if(_e){
_e.call(_f);
}
};
function _10(_11,_12){
_3[_11]="loading";
var _13=_1[_11];
var _14="loading";
var _15=(easyloader.css&&_13["css"])?"loading":"loaded";
if(easyloader.css&&_13["css"]){
if(/^http/i.test(_13["css"])){
var url=_13["css"];
}else{
var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"];
}
_c(url,function(){
_15="loaded";
if(_14=="loaded"&&_15=="loaded"){
_16();
}
});
}
if(/^http/i.test(_13["js"])){
var url=_13["js"];
}else{
var url=easyloader.base+"plugins/"+_13["js"];
}
_4(url,function(){
_14="loaded";
if(_14=="loaded"&&_15=="loaded"){
_16();
}
});
function _16(){
_3[_11]="loaded";
easyloader.onProgress(_11);
if(_12){
_12();
}
};
};
function _17(_18,_19){
var mm=[];
var _1a=false;
if(typeof _18=="string"){
add(_18);
}else{
for(var i=0;i<_18.length;i++){
add(_18[i]);
}
}
function add(_1b){
if(!_1[_1b]){
return;
}
var d=_1[_1b]["dependencies"];
if(d){
for(var i=0;i<d.length;i++){
add(d[i]);
}
}
mm.push(_1b);
};
function _1c(){
if(_19){
_19();
}
easyloader.onLoad(_18);
};
var _1d=0;
function _1e(){
if(mm.length){
var m=mm[0];
if(!_3[m]){
_1a=true;
_10(m,function(){
mm.shift();
_1e();
});
}else{
if(_3[m]=="loaded"){
mm.shift();
_1e();
}else{
if(_1d<easyloader.timeout){
_1d+=10;
setTimeout(arguments.callee,10);
}
}
}
}else{
if(easyloader.locale&&_1a==true&&_2[easyloader.locale]){
var url=easyloader.base+"locale/"+_2[easyloader.locale];
_9(url,function(){
_1c();
});
}else{
_1c();
}
}
};
_1e();
};
easyloader={modules:_1,locales:_2,base:".",theme:"default",css:true,locale:null,timeout:2000,load:function(_1f,_20){
if(/\.css$/i.test(_1f)){
if(/^http/i.test(_1f)){
_c(_1f,_20);
}else{
_c(easyloader.base+_1f,_20);
}
}else{
if(/\.js$/i.test(_1f)){
if(/^http/i.test(_1f)){
_4(_1f,_20);
}else{
_4(easyloader.base+_1f,_20);
}
}else{
_17(_1f,_20);
}
}
},onProgress:function(_21){
},onLoad:function(_22){
}};
var _23=document.getElementsByTagName("script");
for(var i=0;i<_23.length;i++){
var src=_23[i].src;
if(!src){
continue;
}
var m=src.match(/easyloader\.js(\W|$)/i);
if(m){
easyloader.base=src.substring(0,m.index);
}
}
window.using=easyloader.load;
if(window.jQuery){
jQuery(function(){
easyloader.load("parser",function(){
jQuery.parser.parse();
});
});
}
})();

778
public/webThird/js/index.js

@ -1,778 +0,0 @@
function IsPC() {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
if(IsPC()==true){
// if(false){
// alert("我是PC");
}else{
// alert("我是手机");
let mains=document.getElementsByClassName("mains")[0];
let contint=document.getElementsByClassName("contint")[0];
mains.setAttribute("class","main2")
contint.setAttribute("class","contint2")
// renderCanvas.setAttribute("class","renderCanvas2")
document.getElementById("renderCanvas").style.width="980px";
document.getElementById("renderCanvas").style.height="960px";
// console.log(document.getElementById("renderCanvas").style.with);
//console.log(document.getElementsByClassName("mains").style.flexDirection);
document.getElementsByClassName("title")[0].style.display = "none";
}
// const width = document.documentElement.clientWidth;
// const height = document.documentElement.clientHeight;
// if (width < height) {
// console.log(width + " " + height);
// const contentDOM = document.getElementById('divTransform');
// contentDOM.style.width = height + 'px';
// contentDOM.style.height = width + 'px';
// contentDOM.style.top = (height - width) / 2 + 'px';
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
// //contentDOM.style.transform = 'rotate(90deg)';
// }
// const evt = "onorientationchange" in window ? "orientationchange" : "resize";
// window.addEventListener(evt, function () {
// const width = document.documentElement.clientWidth;
// const height = document.documentElement.clientHeight;
// const contentDOM = document.getElementById('content');
// //alert('width: ' + width + ' height: ' + height)
// if (width > height) { // 横屏
// contentDOM.style.width = width + 'px';
// contentDOM.style.height = height + 'px';
// contentDOM.style.top = '0px';
// contentDOM.style.left = '0px';
// contentDOM.style.transform = 'none';
// }
// else { // 竖屏,这里微信应该由bug,我切换为竖屏的时候,width:375, height: 323, 导致不能旋转角度。 在safari、chrome上是正确的。
// alert('change to portrait')
// contentDOM.style.width = height + 'px';
// contentDOM.style.height = width + 'px';
// contentDOM.style.top = (height - width) / 2 + 'px';
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
// //contentDOM.style.transform = 'rotate(90deg)';
// }
// }, false);
window.addEventListener('DOMContentLoaded', function(){
BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () {
if (document.getElementById("customLoadingScreenDiv")) {
// Do not add a loading screen if there is already one
document.getElementById("customLoadingScreenDiv").style.display = "initial";
return;
}
this._loadingDiv = document.createElement("div");
this._loadingDiv.id = "customLoadingScreenDiv";
//this._loadingDiv.innerHTML = "模型正在加载....";
this._loadingDiv.innerHTML = "<image src='./loading.gif' />";
var customLoadingScreenCss = document.createElement('style');
customLoadingScreenCss.type = 'text/css';
customLoadingScreenCss.innerHTML = `
#customLoadingScreenDiv{
background-color: #3D4456cc;
color: white;
font-size:50px;
text-align:center;
}
`;
document.getElementsByTagName('head')[0].appendChild(customLoadingScreenCss);
this._resizeLoadingUI();
window.addEventListener("resize", this._resizeLoadingUI);
document.body.appendChild(this._loadingDiv);
};
BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function(){
document.getElementById("customLoadingScreenDiv").style.display = "none";
console.log("scene is now loaded");
}
function sleep(beginTime,endTime) {
var exitTime = beginTime + 3000;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
// get the canvas DOM element
var canvas = document.getElementById('renderCanvas');
var d = new Date();
var n_Begin= d.getTime();
console.log("n_Begin:"+n_Begin);
// load the 3D engine
var engine = new BABYLON.Engine(canvas, true);
// createScene function that creates and return the scene
var createScene = function(){
engine.displayLoadingUI();
// create a basic BJS Scene object
var scene = new BABYLON.Scene(engine);
//scene.debugLayer.show();
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 5, new BABYLON.Vector3(0, 0, 0), scene);
console.log(camera);
// camera.transforms.alpha = 85;
//camea.transforms.beta=95;
// target the camera to scene origin
camera.setTarget(BABYLON.Vector3.Zero());
//camera.setPosition(new BABYLON.Vector3(20, 200, 400));
// attach the camera to the canvas
camera.attachControl(canvas, true);
camera.lowerRadiusLimit = 2.5 ;// 这里是最大的位置,值越大,物体越小
camera.upperRadiusLimit = 20 ;
camera.Radius = 2.5;
camera.alpha = 1.5;
camera.beta = 1;
camera.inertia=0.1; // 缩放的快慢
//scene.VRHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera: false});
//var VRHelper = scene.createDefaultVRExperience();
//console.log(VRHelper);
//VRHelper.onExitingVR.add(()=>{
// scene.setActiveCameraByName("Camera");
// console.log("abc");
//console.log(scene);
//})
//scene.setActiveCameraByName("Camera");
//console.log(VRHelper);
// create a basic light, aiming 0,1,0 - meaning, to the sky
var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene);
// Skybox
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:1000.0}, scene);
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene);
skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
skybox.material = skyboxMaterial;
var myColor = BABYLON.Color3.Blue();
var line03_position = BABYLON.Vector3(0,0,0);
var line01_position = BABYLON.Vector3(0,0,0);
var line17_position = BABYLON.Vector3(0,0,0);
var line26_position = BABYLON.Vector3(0,0,0);
console.log("position:"+line03_position);
// Initialize GizmoManager
var gizmoManager = new BABYLON.GizmoManager(scene)
BABYLON.SceneLoader.Append("./asset/", "abc2.gltf", scene, function (scene) {
//坐场
line03 = scene.getMeshByName("Line03");
line03_position = line03.position;
Line03Mat = new BABYLON.StandardMaterial("ground", scene);
Line03Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4,0.4);
Line03Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line03Mat.emissiveColor = BABYLON.Color3.Blue();
line03.material = Line03Mat;
//左护版
line01 = scene.getMeshByName("Line01");
line01_position = line01.position;
Line01Mat = new BABYLON.StandardMaterial("ground", scene);
Line01Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line01Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line01Mat.emissiveColor = BABYLON.Color3.Blue();
line01.material = Line01Mat;
//左护版
//line05 = scene.getMeshByName("Line05");
//Line05Mat = new BABYLON.StandardMaterial("ground", scene);
//Line05Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
//Line05Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
//Line05Mat.emissiveColor = BABYLON.Color3.Blue();
//line05.material = Line05Mat;
//右腿
line17 = scene.getMeshByName("Line17");
line17_position = line17.position;
Line17Mat = new BABYLON.StandardMaterial("ground", scene);
Line17Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line17Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line17Mat.emissiveColor = BABYLON.Color3.Blue();
line17.material = Line17Mat;
//line17.position.x =1;
//右腿
line26 = scene.getMeshByName("Cylinder56");
line26_position = line26.position;
Line26Mat = new BABYLON.StandardMaterial("ground", scene);
Line26Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line26Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line26Mat.emissiveColor = BABYLON.Color3.Blue();
line26.material = Line26Mat;
//枪
tube15 = scene.getMeshByName("Tube15");
tube15_position = tube15.position;
Tube15Mat = new BABYLON.StandardMaterial("ground", scene);
Tube15Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Tube15Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Tube15Mat.emissiveColor = BABYLON.Color3.Blue();
tube15.material = Tube15Mat;
root = scene.getMeshByName("__root__");
//console.log("abccc");
//console.log(scene);
//root.addRotation(0.01, 0, 0);
//gizmoManager.boundingBoxGizmoEnabled=true
// Restrict gizmos to only spheres
gizmoManager.attachableMeshes =[line03,line01,tube15,line26,line17];
// Toggle gizmos with keyboard buttons
document.onkeydown = (e)=>{
if(e.key == 'w'){
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
}
if(e.key == 'e'){
gizmoManager.rotationGizmoEnabled = !gizmoManager.rotationGizmoEnabled
}
if(e.key == 'r'){
gizmoManager.scaleGizmoEnabled = !gizmoManager.scaleGizmoEnabled
}
if(e.key == 'q'){
gizmoManager.boundingBoxGizmoEnabled = !gizmoManager.boundingBoxGizmoEnabled
}
}
var oldMeth = null;
// On pick interpolations
var prepareButton = function (mesh, color,strss) {
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
mesh.actionManager = new BABYLON.ActionManager(scene);
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor));
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red()));
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Yellow()));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(0.38, 0.38, 0.38), 100));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(0.4, 0.4, 0.4), 100));
//mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "wireframe", true))
mesh.actionManager.registerAction(
new BABYLON.ExecuteCodeAction(
{
trigger:BABYLON.ActionManager.OnPickTrigger,
parameter:""
},
function(){
document.getElementById("show").innerHTML=strss;
console.log(oldMeth);
console.log(mesh);
if(oldMeth != null && oldMeth.id != mesh.id){
oldMeth.material.emissiveColor= myColor;
}
oldMeth = mesh;
// mesh.material.emissiveColor= BABYLON.Color3.Red()
//mesh.material.emissiveColor = myColor;
//console.log(mesh.material.emissiveColor);
//mesh.material = BABYLON.Color3.Yellow()
//a.innerHTML ="这里是坐长的位置,可以坐人的."
}
)
);
}
var prepareButton2 = function (mesh, color,strss) {
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
mesh.actionManager = new BABYLON.ActionManager(scene);
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor));
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red()));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(1,1, 1), 100));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(1, 1, 1), 100));
mesh.actionManager.registerAction(
new BABYLON.ExecuteCodeAction(
{
trigger:BABYLON.ActionManager.OnPickTrigger,
parameter:""
},
function(){
document.getElementById("show").innerHTML=strss;
//a.innerHTML ="这里是坐长的位置,可以坐人的."
}
)
);
}
prepareButton(line03, BABYLON.Color3.Blue(),`<font size="20">坐舱:</font></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;又叫驾驶舱(Cockpit)是操作员控制机器人的座舱,通常位于前端。除了早期的,如今大部分机器人的驾驶舱采用密闭式的设计。机器人驾驶舱内一般安装有各类控制系统。 驾驶舱是机器人的首脑元件,为太空船里下令及控制的中心。它是设计用来尽量让驾驶员感到操控舒适,并包含所有先进导航及各项操控的系统,就如同其他提供居住人员所有必需品的组件是一样重要的。</h2>`);
prepareButton(line01, BABYLON.Color3.Blue(),`<font size="20">铠甲:</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机械外骨骼或称动力外骨骼(Powered exoskeleton),是一种由钢铁的框架构成并且可让人穿上的机器装置,这个装备可以提供额外能量来供四肢运动。别称:强化服、动力服(Power Suit)、动力装甲(Power armor或Powered armor)、Exoframe、Hardsuit或Exosuit等。凭借这套“服装”,人类就可以成为所谓的“铁人”。
<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;动力外骨骼更倾向于军用除了能够增强人体能力的这一基本功能外还要具有良好的防护性对复杂环境的适应性以及辅助火力通信侦查支持等军用功能
<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;动力服是设计成用来保护穿戴者的例如为了保护士兵或建筑工而设计或设计用来进行救援身处险境的人员上广泛一些的用途则是用来做为义肢与帮助老弱者行动其它的用途则是用来进行救援行动就像在一栋要倒塌的建筑物里这个装置可以提供给工人很大的力量来举起重物同时保护它不被落下的碎石砸伤在日本有银行为需常搬运沉重钞票及硬币的员工配备外骨骼以降低身体负担`);
//prepareButton(line05, BABYLON.Color3.Blue(),"右护版");
prepareButton(line17, BABYLON.Color3.Blue(),`<font size="20">左脚:</font>
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用激光器作为辐射源的雷达激光雷达是激光技术与雷达技术相结合的产物 由发射机 天线 接收机 跟踪架及信息处理等部分组成发射机是各种形式的激光器如二氧化碳激光器掺钕钇铝石榴石激光器半导体激光器及波长可调谐的固体激光器等天线是光学望远镜接收机采用各种形式的光电探测器如光电倍增管半导体光电二极管雪崩光电二极管红外和可见光多元探测器件等激光雷达采用脉冲或连续波2种工作方式探测方法分直接探测与外差探测
<br><img src='./img/2.jpg' height='400'>`);
prepareButton(line26, BABYLON.Color3.Blue(),`<font size="20">机器关节:</font><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机器人关节驱动器是一种集电液伺服阀及摆动缸于一体的液压或气动装置。关节机器人常见的有协作机器人(六轴、七轴)、外骨骼机器人、四足、双足、手术机器人等,里面用的东西基本都包含力矩电机、编码器、减速器、驱动器等,有的可能会用到抱闸、力矩传感器。但是每个应用匹配的方案不一样,用的产品也是多种多样。<br/><img src='./img/4.jpg'>`);
prepareButton(tube15, BABYLON.Color3.Blue(),`<p class='p13'><font size="20">机枪:</font><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机枪(Machine gun) 一种带有枪架或枪座,能实现连发射击的自动枪械。世界第一挺机枪是个叫伐商的比利时工程师(曾是拿破伦手下的上尉)于1851年设计的。该枪曾在1870、1871年的普法战争中用过。而普遍观点认为,现代机枪的鼻祖是加特林多管式机枪。1862年,由美国人理查德·杰丹·加特林发明,这种枪有几个枪筒,可以轮转。1883年,美国人海尔曼·S·马克沁进行革新,机枪变为单枪筒,利用后坐力,使上膛、射击和退弹能同时完成,枪身用枪筒上的水套降温,每分钟可射击650次,名为马克沁机枪.<br/></p><video src='a.mp4' controls='controls'></video> `);
var d1 = new Date();
var n_end= d1.getTime();
console.log("n_end:"+n_end);
console.log(n_end - n_Begin);
sleep(n_Begin,n_end);
engine.hideLoadingUI();
});
//GUI
// Another GUI on the right
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");
advancedTexture.layer.layerMask = 2;
var panel3 = new BABYLON.GUI.StackPanel();
panel3.width = "800px";
panel3.fontSize = "30px";
panel3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
panel3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
advancedTexture.addControl(panel3);
var button1 = BABYLON.GUI.Button.CreateSimpleButton("but1", "旋 转");
button1.width = 0.2;
button1.height = "80px";
button1.color = "white";
button1.cornerRadius = 20;
button1.background = "green";
button1.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
//button1.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
//button1.centerY=5;
//console.log(button1);
//button1.position.x = 300;
//button1.position.y = 5;
var aaab = false;
button1.onPointerUpObservable.add(function() {
// circle.scaleX += 0.1;
if(aaab== false){
scene.registerBeforeRender(function(){
root.addRotation(0.00, 0.008, 0);
button1.textBlock.text = "停 止";
aaab = true;
button1.background = "red";
});
}else{
scene.registerBeforeRender(function(){
root.addRotation(0.00, -0.008, 0);
button1.textBlock.text = "旋 转";
aaab = false;
button1.background = "green";
});
}
});
var button3 = BABYLON.GUI.Button.CreateSimpleButton("but2", "展 开");
button3.width = 0.2;
button3.height = "80px";
button3.color = "white";
button3.cornerRadius = 20;
button3.background = "green";
var bob = false;
button3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
button3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
button3.onPointerUpObservable.add(function() {
// circle.scaleX += 0.1;
//gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
if(bob== false){
bob = true;
button3.textBlock.text = "合 体";
button3.background = "red";
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys = [];
keys.push({
frame: 0,
value: line03_position
});
keys.push({
frame: 20,
value: new BABYLON.Vector3(line03_position.x+60,line03_position.y,line03_position.z)
});
animationBox.setKeys(keys);
line03.animations.push(animationBox); //中间坐舱
//scene.beginAnimation(line03, 0, 100, false);
//左护版
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys1 = [];
keys1.push({
frame: 0,
value: line01_position
});
keys1.push({
frame: 20,
value: new BABYLON.Vector3(line01_position.x-40,line01_position.y,line01_position.z)
});
animationBox2.setKeys(keys1);
line01.animations.push(animationBox2); //中间坐舱
//scene.beginAnimation(line01, 0, 100, true);
//左脚
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys2 = [];
keys2.push({
frame: 0,
value: line17_position
});
keys2.push({
frame: 20,
value: new BABYLON.Vector3(line17_position.x-50,line17_position.y,line17_position.z)
});
animationBox3.setKeys(keys2);
line17.animations.push(animationBox3); //中间坐舱
//scene.beginAnimation(line17, 0, 100, true);
//右脚
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys4 = [];
keys4.push({
frame: 0,
value: line26_position
});
keys4.push({
frame: 20,
value: new BABYLON.Vector3(line26_position.x+50,line26_position.y,line26_position.z)
});
animationBox4.setKeys(keys4);
line26.animations.push(animationBox4); //中间坐舱
//scene.beginAnimation(line26, 0, 100, true);
//枪
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys5 = [];
keys5.push({
frame: 0,
value: new BABYLON.Vector3(-23,0,-47.5)
});
keys5.push({
frame: 20,
value:new BABYLON.Vector3(-2,0,-90)
});
animationBox5.setKeys(keys5);
tube15.animations.push(animationBox5); //中间坐舱
//scene.beginAnimation(tube15, 0, 100, true);
setTimeout(async () => {
var anim1 = scene.beginAnimation(line01, 0, 100, false);
var anim2 = scene.beginAnimation(line03, 0, 100, false);
var anim3 = scene.beginAnimation(line17, 0, 100, false);
var anim4 = scene.beginAnimation(line26, 0, 100, false);
var anim5 = scene.beginAnimation(tube15, 0, 100, false);
console.log("ddd");
//await anim1.waitAsync();
//await anim2.waitAsync();
//await anim3.waitAsync();
//await anim4.waitAsync();
await anim5.waitAsync();
console.log("dd33d");
scene.stopAnimation(line01);
scene.stopAnimation(line03);
scene.stopAnimation(line17);
scene.stopAnimation(line26);
scene.stopAnimation(tube15);
});
}else{
bob = false;
button3.background = "green";
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys = [];
keys.push({
frame: 0,
value: new BABYLON.Vector3(line03_position.x-60,line03_position.y,line03_position.z)
});
keys.push({
frame: 20,
value: line03_position
});
animationBox.setKeys(keys);
line03.animations.push(animationBox); //中间坐舱
//scene.beginAnimation(line03, 0, 100, true);
//左护版
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys1 = [];
keys1.push({
frame: 0,
value: new BABYLON.Vector3(line01_position.x+40,line01_position.y,line01_position.z)
});
keys1.push({
frame: 20,
value:line01_position
});
animationBox2.setKeys(keys1);
line01.animations.push(animationBox2); //中间坐舱
//scene.beginAnimation(line01, 0, 100, true);
//左脚
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys2 = [];
keys2.push({
frame: 0,
value: new BABYLON.Vector3(line17_position.x+50,line17_position.y,line17_position.z)
});
keys2.push({
frame: 20,
value:line17_position
});
animationBox3.setKeys(keys2);
line17.animations.push(animationBox3); //中间坐舱
// scene.beginAnimation(line17, 0, 100, true);
//右脚
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys4 = [];
keys4.push({
frame: 0,
value: new BABYLON.Vector3(line26_position.x-50,line26_position.y,line26_position.z)
});
keys4.push({
frame: 20,
value: line26_position
});
animationBox4.setKeys(keys4);
line26.animations.push(animationBox4); //中间坐舱
//scene.beginAnimation(line26, 0, 100, true);
//枪
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys5 = [];
keys5.push({
frame: 0,
value:new BABYLON.Vector3(-2,0,-90)
});
keys5.push({
frame: 20,
value: new BABYLON.Vector3(-23,0,-47.5)
});
animationBox5.setKeys(keys5);
tube15.animations.push(animationBox5); //中间坐舱
button3.textBlock.text = "展 开";
setTimeout(async () => {
var anim1 = scene.beginAnimation(line01, 0, 100, false);
var anim2 = scene.beginAnimation(line03, 0, 100, false);
var anim3 = scene.beginAnimation(line17, 0, 100, false);
var anim4 = scene.beginAnimation(line26, 0, 100, false);
var anim5 = scene.beginAnimation(tube15, 0, 100, false);
console.log("ddd");
await anim1.waitAsync();
await anim2.waitAsync();
await anim3.waitAsync();
await anim4.waitAsync();
await anim5.waitAsync();
console.log("dd33d");
scene.stopAnimation(line01);
scene.stopAnimation(line03);
scene.stopAnimation(line17);
scene.stopAnimation(line26);
scene.stopAnimation(tube15);
});
}
});
var button2 = BABYLON.GUI.Button.CreateSimpleButton("but2", "拆 解");
button2.width =0.2;
button2.height = "80px";
button2.color = "white";
button2.cornerRadius = 20;
button2.background = "green";
button2.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
button2.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
var selectOne = false;
button2.onPointerUpObservable.add(function() {
// circle.scaleX += 0.1;
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
if(selectOne== false){
//scene.stopAnimation(line01);
//scene.stopAnimation(line03);
//scene.stopAnimation(line17);
//scene.stopAnimation(line26);
//scene.stopAnimation(tube15);
selectOne = true;
button2.background = "red";
button2.textBlock.text = "取 消";
}else{
//window.location.reload(true);
selectOne = false;
button2.background = "green";
button2.textBlock.text = "拆 解";
}
});
var button4 = BABYLON.GUI.Button.CreateSimpleButton("but4", "还 原");
//button4.fontSize = "26px";
button4.width = 0.2;
button4.height = "80px";
button4.color = "white";
button4.cornerRadius = 20;
button4.background = "green";
button4.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
button4.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
button4.onPointerUpObservable.add(function() {
window.location.reload(true);
});
panel3.addControl(button1);
panel3.addControl(button3);
panel3.addControl(button2);
panel3.addControl(button4);
return scene;
}
// call the createScene function
var scene = createScene();
//var a = scene.getElementById("__root");
// run the render loop
/**/
engine.runRenderLoop(function(){
scene.render();
});
var abc1 = scene.getMeshByName("plane");
window.addEventListener('resize', function(){
engine.resize();
});
});

18706
public/webThird/js/jquery-ui.js
File diff suppressed because it is too large
View File

11008
public/webThird/js/jquery.js
File diff suppressed because it is too large
View File

138
public/webThird/js/jquery.timers.min.js

@ -1,138 +0,0 @@
/**
* jQuery.timers - Timer abstractions for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/10/16
*
* @author Blair Mitchelmore
* @version 1.2
*
**/
jQuery.fn.extend({
everyTime: function(interval, label, fn, times) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, times);
});
},
oneTime: function(interval, label, fn) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, 1);
});
},
stopTime: function(label, fn) {
return this.each(function() {
jQuery.timer.remove(this, label, fn);
});
}
});
jQuery.extend({
timer: {
global: [],
guid: 1,
dataKey: "jQuery.timer",
regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
powers: {
// Yeah this is major overkill...
'ms': 1,
'cs': 10,
'ds': 100,
's': 1000,
'das': 10000,
'hs': 100000,
'ks': 1000000
},
timeParse: function(value) {
if (value == undefined || value == null)
return null;
var result = this.regex.exec(jQuery.trim(value.toString()));
if (result[2]) {
var num = parseFloat(result[1]);
var mult = this.powers[result[2]] || 1;
return num * mult;
} else {
return value;
}
},
add: function(element, interval, label, fn, times) {
var counter = 0;
if (jQuery.isFunction(label)) {
if (!times)
times = fn;
fn = label;
label = interval;
}
interval = jQuery.timer.timeParse(interval);
if (typeof interval != 'number' || isNaN(interval) || interval < 0)
return;
if (typeof times != 'number' || isNaN(times) || times < 0)
times = 0;
times = times || 0;
var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
if (!timers[label])
timers[label] = {};
fn.timerID = fn.timerID || this.guid++;
var handler = function() {
if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
jQuery.timer.remove(element, label, fn);
};
handler.timerID = fn.timerID;
if (!timers[label][fn.timerID])
timers[label][fn.timerID] = window.setInterval(handler,interval);
this.global.push( element );
},
remove: function(element, label, fn) {
var timers = jQuery.data(element, this.dataKey), ret;
if ( timers ) {
if (!label) {
for ( label in timers )
this.remove(element, label, fn);
} else if ( timers[label] ) {
if ( fn ) {
if ( fn.timerID ) {
window.clearInterval(timers[label][fn.timerID]);
delete timers[label][fn.timerID];
}
} else {
for ( var fn in timers[label] ) {
window.clearInterval(timers[label][fn]);
delete timers[label][fn];
}
}
for ( ret in timers[label] ) break;
if ( !ret ) {
ret = null;
delete timers[label];
}
}
for ( ret in timers ) break;
if ( !ret )
jQuery.removeData(element, this.dataKey);
}
}
}
});
jQuery(window).bind("unload", function() {
jQuery.each(jQuery.timer.global, function(index, item) {
jQuery.timer.remove(item);
});
});

BIN
public/webWater/asset/Line.glb

BIN
public/webWater/asset/TotalCamera.glb

BIN
public/webWater/asset/total2.glb

302
public/webWater/index.js

@ -174,99 +174,6 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
document.getElementById('customLoadingScreenDiv_first').style.display = 'none'
document.title = '水泵房'
// var prepareGroupButton = function(transformNodex, color, qu) {
// var mesheses = null
// if (transformNodex.getClassName() === 'TransformNode') {
// mesheses = transformNodex.getChildMeshes(false)
// } else {
// mesheses = []
// mesheses.push(transformNodex)
// }
// for (var i = 0; i < mesheses.length; i++) {
// mesheses[i].actionManager = new BABYLON.ActionManager(scene)
// // var theScaling = mesheses[i].scaling
// /* if (true) {
// try {
// mesheses[i].actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesheses[i], "scaling", new BABYLON.Vector3(theScaling.x, theScaling.y, theScaling.z), 100));
// mesheses[i].actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesheses[i], "scaling", new BABYLON.Vector3(theScaling.x * 1.01, theScaling.y * 1.01, theScaling.z * 1.01), 100));
// } catch (error) {
// //alert(error)
// }
// }*/
// var clickbegin = false
// mesheses[i].actionManager.registerAction(
// new BABYLON.ExecuteCodeAction({
// trigger: BABYLON.ActionManager.OnPointerOverTrigger,
// parameter: ''
// },
// function() {
// clickbegin = true
// if (true) {
// if (oldtransformNodeOther != null) {
// oldtransformNodeOther.removeBehavior(drag)
// var mesheses2 = null
// if (oldtransformNodeOther.getClassName() == 'TransformNode') {
// mesheses2 = oldtransformNodeOther.getChildMeshes(false)
// } else {
// mesheses2 = []
// mesheses2.push(oldtransformNodeOther)
// }
// for (var i = 0; i < mesheses2.length; i++) {
// try {
// h2.removeMesh(mesheses2[i])
// } catch (error) {
// // alert(error)
// }
// }
// }
// oldtransformNodeOther = transformNodex
// // transformNodex.addBehavior(drag);
// var mesheses3 = null
// if (transformNodex.getClassName() === 'TransformNode') {
// mesheses3 = transformNodex.getChildMeshes(false)
// } else {
// mesheses3 = []
// mesheses3.push(transformNodex)
// }
// for (var i = 0; i < mesheses3.length; i++) {
// try {
// h2.addMesh(mesheses3[i], color)
// } catch (error) {
// // alert(error)
// }
// }
// clickbegin = false
// }
// }
// )
// )
// mesheses[i].actionManager.registerAction(
// new BABYLON.ExecuteCodeAction({
// trigger: BABYLON.ActionManager.OnPickTrigger,
// parameter: ''
// },
// function() {
// clickbegin = true
// if (true) {
// try {
// quClick(qu)
// } catch (error) {
// // alert(error)
// }
// clickbegin = false
// }
// }
// )
// )
// }
// }
var prepareGroupButton2ByMesh = function(transformNodex, color, qu) {
var mesheses = null
if (transformNodex.getClassName() === 'Mesh') {
@ -441,46 +348,63 @@ BABYLON.DracoCompression.Configuration.decoder.fallbackUrl = './js/draco_decoder
// createScene function that creates and return the scene
var createScene = function() {
engine.displayLoadingUI()
// var scene = new BABYLON.Scene(engine)
// camera = new BABYLON.ArcRotateCamera('Camera', 0, 0, 5, new BABYLON.Vector3(0, -1, 0), scene)
// camera.setTarget(new BABYLON.Vector3(0, 0, 0))
// camera.attachControl(canvas, true)
var scene = new BABYLON.Scene(engine)
camera = new BABYLON.ArcRotateCamera('Camera', 0, 0, 5, new BABYLON.Vector3(0, -1, 0), scene)
camera.setTarget(new BABYLON.Vector3(0, 0, 0))
camera = new BABYLON.ArcRotateCamera(
'Camera', Math.PI * -218.4 / 180, Math.PI * 40 / 180, 24, // alpha=0(水平角度),beta=90°(垂直俯视),radius=200(距离)
new BABYLON.Vector3(0, 0, 0), // 相机位置会根据 alpha/beta/radius 自动计算,无需手动设置
scene
)
camera.setTarget(new BABYLON.Vector3(0, 0, 0)) // 瞄准原点
camera.attachControl(canvas, true)
camera.lowerRadiusLimit = 5.0 // 这里是最大的位置,值越大,物体越小
camera.upperRadiusLimit = 200
camera.radius = 10 // 增加 radius 值,模型变小 减小 radius 值,模型变大
camera.alpha = Math.PI * -218.4 / 180 // 改Y轴角度
camera.beta = Math.PI * 40 / 180 // XZ 平面的倾斜角度
camera.inertia = 0.1 // 缩放的快慢
camera.useAutoRotationBehavior = isRotating // 自动旋转
camera.panningDistanceLimit = 2 // 平移半径
camera.panningInertia = 0
camera.autoTransitionRange = 1
camera.pinchToPanMaxDistance = 0.1
camera.pinchDeltaPercentage = 0.001
camera.useAutoRotationBehavior = true
// 改变场景背景颜色 - 背景颜色opacity值设为0,达到透明背景的效果
scene.clearColor = new BABYLON.Color4(0, 0, 0, 0)
scene.activeCamera = camera
scene.activeCamera.useInputToRestoreState = true
// var camera1_status = scene.activeCamera.storeState()
var assetsManager = new BABYLON.AssetsManager(scene)
var meshTask = assetsManager.addMeshTask('skull task', '', 'asset/', 'F5.glb')
// var meshTask = assetsManager.addMeshTask('skull task', '', 'asset/', 'F5.glb')
meshTask.onSuccess = function(task) {
task.loadedMeshes[0].scaling = new BABYLON.Vector3(0.4, 0.4, 0.4)
task.loadedMeshes[0].position = new BABYLON.Vector3(0, 0.35, 0)
}
meshTask.onError = function(task, message, exception) {
console.log(message, exception)
}
// meshTask.onSuccess = function(task) {
// task.loadedMeshes[0].scaling = new BABYLON.Vector3(0.4, 0.4, 0.4)
// task.loadedMeshes[0].position = new BABYLON.Vector3(0, 0.35, 0)
// }
// meshTask.onError = function(task, message, exception) {
// console.log(message, exception)
// }
var hdrTexture = new BABYLON.CubeTexture.CreateFromPrefilteredData('textures/environmentSpecular.env', scene)
// 加载GLB模型并处理材质
BABYLON.SceneLoader.LoadAssetContainerAsync('asset/', 'F5.glb', scene).then((container) => {
// 遍历所有材质
container.materials.forEach(material => {
// 处理标准材质
if (material instanceof BABYLON.StandardMaterial) {
material.backFaceCulling = true // 启用背面剔除
}
// 处理PBR材质
// if (material instanceof BABYLON.PBRMaterial) {
// material.backFaceCulling = true // 启用背面剔除
// }
})
// 将加载的资产添加到场景中
container.addAllToScene()
}).catch((error) => {
console.error('加载模型时出错:', error)
})
var hdrTexture = new BABYLON.CubeTexture.CreateFromPrefilteredData('textures/environmentSpecular.env', scene)
scene.environmentTexture = hdrTexture
var spriteManagerPlayer = new BABYLON.SpriteManager('playerManager', './img/bl9.png', 10, {
@ -503,7 +427,6 @@ var createScene = function() {
}
// renderCanvas.style.backgroundImage = 'url("./textures/' + '4' + '.jpg")'
// console.log("x2");
assetsManager.load()
drag = new BABYLON.PointerDragBehavior({
@ -512,7 +435,6 @@ var createScene = function() {
// drag.useObjectOrienationForDragging = false;
drag.validateDrag = (targetPosition) => {
// console.log(targetPosition)
if (targetPosition.x > 10.5 || targetPosition.x < -10.5) {
return false
}
@ -528,7 +450,6 @@ var createScene = function() {
// console.log(event);
// console.log(line03_position)
})
// console.log("x3");
// GUI
h1 = new BABYLON.HighlightLayer('hl1', scene)
h2 = new BABYLON.HighlightLayer('hl2', scene)
@ -575,8 +496,6 @@ var createScene = function() {
step *= -1
}
currentx += step
// console.log("here");
return scene
}
@ -600,110 +519,6 @@ window.addEventListener('resize', function() {
engine.resize()
})
// 功能:点区以后跳转到新页
// quName :转过来的区号
// function quClick(quName) {
// if (quName === '现行w文件室内') {
// window.location.href = 'http://ikki2000.gitee.io/101/webA/index.html'
// }
// if (quName === '待销文件室') {
// window.location.href = 'http://ikki2000.gitee.io/101/webB/index.html'
// }
// }
// 功能:点camera后事件
// function cameraClick(camera) {
// alert(camera.nameID)
// }
// function HashMap() {
// // 定义长度
// var length = 0
// // 创建一个对象
// var obj = {}
// // 判断Map是否为空
// this.isEmpty = function() {
// return length === 0
// }
// // 判断对象中是否包含给定Key
// this.containsKey = function(key) {
// return (key in obj)
// }
// // 判断对象中是否包含给定的Value
// this.containsValue = function(value) {
// for (var key in obj) {
// if (obj[key] === value) {
// return true
// }
// }
// return false
// }
// 向map中添加数据
// this.put = function(key, value) {
// if (!this.containsKey(key)) {
// length++
// }
// obj[key] = value
// }
// // 根据给定的key获取Value
// this.get = function(key) {
// return this.containsKey(key) ? obj[key] : null
// }
// // 根据给定的Key删除一个值
// this.remove = function(key) {
// if (this.containsKey(key) && (delete obj[key])) {
// length--
// }
// }
// // 获得Map中所有的value
// this.values = function() {
// var _values = []
// for (var key in obj) {
// _values.push(obj[key])
// }
// return _values
// }
// // 获得Map中的所有key
// this.keySet = function() {
// var _keys = []
// for (var key in obj) {
// _keys.push(key)
// }
// return _keys
// }
// // 获得Map的长度
// this.size = function() {
// return length
// }
// // 清空Map
// this.clear = function() {
// length = 0
// obj = {}
// }
// }
// var yangans = new HashMap()
// yangans.put('CAM_000', 'yan')
// console.log("here2");
// yangans.put('DAK_MO_CAM_002', 'camera02');
// yangans.put('DAK_MO_CAM_003', 'camera03');
// yangans.put('DAK_MO_CAM_004', 'camera04');
// yangans.put('ZLS_MO_CAM_001', 'camera05');
// yangans.put('ZLS_MO_CAM_002', 'camera06');
// yangans.put('YLS_MO_CAM_001', 'camera07');
// yangans.put('YLS_MO_CAM_002', 'camera08');
// yangans.put('ZL_MO_CAM_001', 'camera09');
// 功能转入报警
// function Myalert(MathineID, baojingx) {
// var theName = yangans.get(MathineID)
@ -715,7 +530,6 @@ window.addEventListener('resize', function() {
// }
// scene.debugLayer.show();
// 报警 true:表示报警, false :表示不报警
// Myalert('CAM_000', true)
function cameraClick(TheCamera) {
window.parent.postMessage(
{
@ -726,7 +540,6 @@ function cameraClick(TheCamera) {
}
function handleAlarm(deviceId, isAlarm) {
console.log('rrrrr')
var cl = new BABYLON.Color3(0, 0, 1)
var c2 = new BABYLON.Color3(1, 0, 0)
const targetDevice = scene.transformNodes.find(node => node.nameID === deviceId)
@ -756,21 +569,38 @@ function handleAlarm(deviceId, isAlarm) {
}
}
// 监测父页面传来得初始化得温度湿度值
window.addEventListener(
'message',
function(e) {
console.log('ddd', e.data.data)
const deviceData = e.data.data
if (Array.isArray(deviceData)) {
deviceData.forEach(device => {
handleAlarm(device.deviceId, device.isAlarm)
})
} else {
handleAlarm(deviceData.deviceId, deviceData.isAlarm)
if (e.data.type === 'deviceState') {
console.log('ddd', e.data.data)
const deviceData = e.data.data
if (Array.isArray(deviceData)) {
deviceData.forEach((device) => {
handleAlarm(device.deviceId, device.isAlarm)
})
} else {
handleAlarm(deviceData.deviceId, deviceData.isAlarm)
}
} else if (e.data.type === 'isGetRotate') {
const isGetRotate = e.data.value
console.log('isGetRotate:', isGetRotate)
// 这里可以添加处理 isGetRotate 的逻辑
toggleAutoRotation(isGetRotate)
}
},
false
)
window.handleAlarm = handleAlarm
function toggleAutoRotation(isAutoRotating) {
var camera = scene.activeCamera
if (!isAutoRotating) {
// 启用自动旋转
camera.useAutoRotationBehavior = true
} else {
// 禁用自动旋转
camera.useAutoRotationBehavior = false
camera.angularSpeed = 0 // 停止旋转
}
}

2061
public/webWater/js/bootstrap-slider.js
File diff suppressed because it is too large
View File

190
public/webWater/js/easyloader.js

@ -1,190 +0,0 @@
/**
* EasyUI for jQuery 1.7.0
*
* Copyright (c) 2009-2018 www.jeasyui.com. All rights reserved.
*
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
* To use it on other terms please contact us: info@jeasyui.com
*
*/
(function(){
var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},radiobutton:{js:"jquery.radiobutton.js",css:"radiobutton.css"},checkbox:{js:"jquery.checkbox.js",css:"checkbox.css"},sidemenu:{js:"jquery.sidemenu.js",css:"sidemenu.css",dependencies:["accordion","tree","tooltip"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}};
var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"};
var _3={};
function _4(_5,_6){
var _7=false;
var _8=document.createElement("script");
_8.type="text/javascript";
_8.language="javascript";
_8.src=_5;
_8.onload=_8.onreadystatechange=function(){
if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){
_7=true;
_8.onload=_8.onreadystatechange=null;
if(_6){
_6.call(_8);
}
}
};
document.getElementsByTagName("head")[0].appendChild(_8);
};
function _9(_a,_b){
_4(_a,function(){
document.getElementsByTagName("head")[0].removeChild(this);
if(_b){
_b();
}
});
};
function _c(_d,_e){
var _f=document.createElement("link");
_f.rel="stylesheet";
_f.type="text/css";
_f.media="screen";
_f.href=_d;
document.getElementsByTagName("head")[0].appendChild(_f);
if(_e){
_e.call(_f);
}
};
function _10(_11,_12){
_3[_11]="loading";
var _13=_1[_11];
var _14="loading";
var _15=(easyloader.css&&_13["css"])?"loading":"loaded";
if(easyloader.css&&_13["css"]){
if(/^http/i.test(_13["css"])){
var url=_13["css"];
}else{
var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"];
}
_c(url,function(){
_15="loaded";
if(_14=="loaded"&&_15=="loaded"){
_16();
}
});
}
if(/^http/i.test(_13["js"])){
var url=_13["js"];
}else{
var url=easyloader.base+"plugins/"+_13["js"];
}
_4(url,function(){
_14="loaded";
if(_14=="loaded"&&_15=="loaded"){
_16();
}
});
function _16(){
_3[_11]="loaded";
easyloader.onProgress(_11);
if(_12){
_12();
}
};
};
function _17(_18,_19){
var mm=[];
var _1a=false;
if(typeof _18=="string"){
add(_18);
}else{
for(var i=0;i<_18.length;i++){
add(_18[i]);
}
}
function add(_1b){
if(!_1[_1b]){
return;
}
var d=_1[_1b]["dependencies"];
if(d){
for(var i=0;i<d.length;i++){
add(d[i]);
}
}
mm.push(_1b);
};
function _1c(){
if(_19){
_19();
}
easyloader.onLoad(_18);
};
var _1d=0;
function _1e(){
if(mm.length){
var m=mm[0];
if(!_3[m]){
_1a=true;
_10(m,function(){
mm.shift();
_1e();
});
}else{
if(_3[m]=="loaded"){
mm.shift();
_1e();
}else{
if(_1d<easyloader.timeout){
_1d+=10;
setTimeout(arguments.callee,10);
}
}
}
}else{
if(easyloader.locale&&_1a==true&&_2[easyloader.locale]){
var url=easyloader.base+"locale/"+_2[easyloader.locale];
_9(url,function(){
_1c();
});
}else{
_1c();
}
}
};
_1e();
};
easyloader={modules:_1,locales:_2,base:".",theme:"default",css:true,locale:null,timeout:2000,load:function(_1f,_20){
if(/\.css$/i.test(_1f)){
if(/^http/i.test(_1f)){
_c(_1f,_20);
}else{
_c(easyloader.base+_1f,_20);
}
}else{
if(/\.js$/i.test(_1f)){
if(/^http/i.test(_1f)){
_4(_1f,_20);
}else{
_4(easyloader.base+_1f,_20);
}
}else{
_17(_1f,_20);
}
}
},onProgress:function(_21){
},onLoad:function(_22){
}};
var _23=document.getElementsByTagName("script");
for(var i=0;i<_23.length;i++){
var src=_23[i].src;
if(!src){
continue;
}
var m=src.match(/easyloader\.js(\W|$)/i);
if(m){
easyloader.base=src.substring(0,m.index);
}
}
window.using=easyloader.load;
if(window.jQuery){
jQuery(function(){
easyloader.load("parser",function(){
jQuery.parser.parse();
});
});
}
})();

778
public/webWater/js/index.js

@ -1,778 +0,0 @@
function IsPC() {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
if(IsPC()==true){
// if(false){
// alert("我是PC");
}else{
// alert("我是手机");
let mains=document.getElementsByClassName("mains")[0];
let contint=document.getElementsByClassName("contint")[0];
mains.setAttribute("class","main2")
contint.setAttribute("class","contint2")
// renderCanvas.setAttribute("class","renderCanvas2")
document.getElementById("renderCanvas").style.width="980px";
document.getElementById("renderCanvas").style.height="960px";
// console.log(document.getElementById("renderCanvas").style.with);
//console.log(document.getElementsByClassName("mains").style.flexDirection);
document.getElementsByClassName("title")[0].style.display = "none";
}
// const width = document.documentElement.clientWidth;
// const height = document.documentElement.clientHeight;
// if (width < height) {
// console.log(width + " " + height);
// const contentDOM = document.getElementById('divTransform');
// contentDOM.style.width = height + 'px';
// contentDOM.style.height = width + 'px';
// contentDOM.style.top = (height - width) / 2 + 'px';
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
// //contentDOM.style.transform = 'rotate(90deg)';
// }
// const evt = "onorientationchange" in window ? "orientationchange" : "resize";
// window.addEventListener(evt, function () {
// const width = document.documentElement.clientWidth;
// const height = document.documentElement.clientHeight;
// const contentDOM = document.getElementById('content');
// //alert('width: ' + width + ' height: ' + height)
// if (width > height) { // 横屏
// contentDOM.style.width = width + 'px';
// contentDOM.style.height = height + 'px';
// contentDOM.style.top = '0px';
// contentDOM.style.left = '0px';
// contentDOM.style.transform = 'none';
// }
// else { // 竖屏,这里微信应该由bug,我切换为竖屏的时候,width:375, height: 323, 导致不能旋转角度。 在safari、chrome上是正确的。
// alert('change to portrait')
// contentDOM.style.width = height + 'px';
// contentDOM.style.height = width + 'px';
// contentDOM.style.top = (height - width) / 2 + 'px';
// contentDOM.style.left = 0 - (height - width) / 2 + 'px';
// //contentDOM.style.transform = 'rotate(90deg)';
// }
// }, false);
window.addEventListener('DOMContentLoaded', function(){
BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () {
if (document.getElementById("customLoadingScreenDiv")) {
// Do not add a loading screen if there is already one
document.getElementById("customLoadingScreenDiv").style.display = "initial";
return;
}
this._loadingDiv = document.createElement("div");
this._loadingDiv.id = "customLoadingScreenDiv";
//this._loadingDiv.innerHTML = "模型正在加载....";
this._loadingDiv.innerHTML = "<image src='./loading.gif' />";
var customLoadingScreenCss = document.createElement('style');
customLoadingScreenCss.type = 'text/css';
customLoadingScreenCss.innerHTML = `
#customLoadingScreenDiv{
background-color: #3D4456cc;
color: white;
font-size:50px;
text-align:center;
}
`;
document.getElementsByTagName('head')[0].appendChild(customLoadingScreenCss);
this._resizeLoadingUI();
window.addEventListener("resize", this._resizeLoadingUI);
document.body.appendChild(this._loadingDiv);
};
BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function(){
document.getElementById("customLoadingScreenDiv").style.display = "none";
console.log("scene is now loaded");
}
function sleep(beginTime,endTime) {
var exitTime = beginTime + 3000;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
// get the canvas DOM element
var canvas = document.getElementById('renderCanvas');
var d = new Date();
var n_Begin= d.getTime();
console.log("n_Begin:"+n_Begin);
// load the 3D engine
var engine = new BABYLON.Engine(canvas, true);
// createScene function that creates and return the scene
var createScene = function(){
engine.displayLoadingUI();
// create a basic BJS Scene object
var scene = new BABYLON.Scene(engine);
//scene.debugLayer.show();
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 5, new BABYLON.Vector3(0, 0, 0), scene);
console.log(camera);
// camera.transforms.alpha = 85;
//camea.transforms.beta=95;
// target the camera to scene origin
camera.setTarget(BABYLON.Vector3.Zero());
//camera.setPosition(new BABYLON.Vector3(20, 200, 400));
// attach the camera to the canvas
camera.attachControl(canvas, true);
camera.lowerRadiusLimit = 2.5 ;// 这里是最大的位置,值越大,物体越小
camera.upperRadiusLimit = 20 ;
camera.Radius = 2.5;
camera.alpha = 1.5;
camera.beta = 1;
camera.inertia=0.1; // 缩放的快慢
//scene.VRHelper = scene.createDefaultVRExperience({createDeviceOrientationCamera: false});
//var VRHelper = scene.createDefaultVRExperience();
//console.log(VRHelper);
//VRHelper.onExitingVR.add(()=>{
// scene.setActiveCameraByName("Camera");
// console.log("abc");
//console.log(scene);
//})
//scene.setActiveCameraByName("Camera");
//console.log(VRHelper);
// create a basic light, aiming 0,1,0 - meaning, to the sky
var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene);
// Skybox
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:1000.0}, scene);
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene);
skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
skybox.material = skyboxMaterial;
var myColor = BABYLON.Color3.Blue();
var line03_position = BABYLON.Vector3(0,0,0);
var line01_position = BABYLON.Vector3(0,0,0);
var line17_position = BABYLON.Vector3(0,0,0);
var line26_position = BABYLON.Vector3(0,0,0);
console.log("position:"+line03_position);
// Initialize GizmoManager
var gizmoManager = new BABYLON.GizmoManager(scene)
BABYLON.SceneLoader.Append("./asset/", "abc2.gltf", scene, function (scene) {
//坐场
line03 = scene.getMeshByName("Line03");
line03_position = line03.position;
Line03Mat = new BABYLON.StandardMaterial("ground", scene);
Line03Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4,0.4);
Line03Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line03Mat.emissiveColor = BABYLON.Color3.Blue();
line03.material = Line03Mat;
//左护版
line01 = scene.getMeshByName("Line01");
line01_position = line01.position;
Line01Mat = new BABYLON.StandardMaterial("ground", scene);
Line01Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line01Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line01Mat.emissiveColor = BABYLON.Color3.Blue();
line01.material = Line01Mat;
//左护版
//line05 = scene.getMeshByName("Line05");
//Line05Mat = new BABYLON.StandardMaterial("ground", scene);
//Line05Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
//Line05Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
//Line05Mat.emissiveColor = BABYLON.Color3.Blue();
//line05.material = Line05Mat;
//右腿
line17 = scene.getMeshByName("Line17");
line17_position = line17.position;
Line17Mat = new BABYLON.StandardMaterial("ground", scene);
Line17Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line17Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line17Mat.emissiveColor = BABYLON.Color3.Blue();
line17.material = Line17Mat;
//line17.position.x =1;
//右腿
line26 = scene.getMeshByName("Cylinder56");
line26_position = line26.position;
Line26Mat = new BABYLON.StandardMaterial("ground", scene);
Line26Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line26Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Line26Mat.emissiveColor = BABYLON.Color3.Blue();
line26.material = Line26Mat;
//枪
tube15 = scene.getMeshByName("Tube15");
tube15_position = tube15.position;
Tube15Mat = new BABYLON.StandardMaterial("ground", scene);
Tube15Mat.diffuseColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Tube15Mat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4);
Tube15Mat.emissiveColor = BABYLON.Color3.Blue();
tube15.material = Tube15Mat;
root = scene.getMeshByName("__root__");
//console.log("abccc");
//console.log(scene);
//root.addRotation(0.01, 0, 0);
//gizmoManager.boundingBoxGizmoEnabled=true
// Restrict gizmos to only spheres
gizmoManager.attachableMeshes =[line03,line01,tube15,line26,line17];
// Toggle gizmos with keyboard buttons
document.onkeydown = (e)=>{
if(e.key == 'w'){
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
}
if(e.key == 'e'){
gizmoManager.rotationGizmoEnabled = !gizmoManager.rotationGizmoEnabled
}
if(e.key == 'r'){
gizmoManager.scaleGizmoEnabled = !gizmoManager.scaleGizmoEnabled
}
if(e.key == 'q'){
gizmoManager.boundingBoxGizmoEnabled = !gizmoManager.boundingBoxGizmoEnabled
}
}
var oldMeth = null;
// On pick interpolations
var prepareButton = function (mesh, color,strss) {
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
mesh.actionManager = new BABYLON.ActionManager(scene);
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor));
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red()));
// mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Yellow()));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(0.38, 0.38, 0.38), 100));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(0.4, 0.4, 0.4), 100));
//mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPickTrigger, mesh.material, "wireframe", true))
mesh.actionManager.registerAction(
new BABYLON.ExecuteCodeAction(
{
trigger:BABYLON.ActionManager.OnPickTrigger,
parameter:""
},
function(){
document.getElementById("show").innerHTML=strss;
console.log(oldMeth);
console.log(mesh);
if(oldMeth != null && oldMeth.id != mesh.id){
oldMeth.material.emissiveColor= myColor;
}
oldMeth = mesh;
// mesh.material.emissiveColor= BABYLON.Color3.Red()
//mesh.material.emissiveColor = myColor;
//console.log(mesh.material.emissiveColor);
//mesh.material = BABYLON.Color3.Yellow()
//a.innerHTML ="这里是坐长的位置,可以坐人的."
}
)
);
}
var prepareButton2 = function (mesh, color,strss) {
//var goToColorAction = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, light, "diffuse", color, 1000, null, true);
mesh.actionManager = new BABYLON.ActionManager(scene);
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh.material, "emissiveColor", mesh.material.emissiveColor));
mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh.material, "emissiveColor", BABYLON.Color3.Red()));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOutTrigger, mesh, "scaling", new BABYLON.Vector3(1,1, 1), 100));
mesh.actionManager.registerAction(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh, "scaling", new BABYLON.Vector3(1, 1, 1), 100));
mesh.actionManager.registerAction(
new BABYLON.ExecuteCodeAction(
{
trigger:BABYLON.ActionManager.OnPickTrigger,
parameter:""
},
function(){
document.getElementById("show").innerHTML=strss;
//a.innerHTML ="这里是坐长的位置,可以坐人的."
}
)
);
}
prepareButton(line03, BABYLON.Color3.Blue(),`<font size="20">坐舱:</font></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;又叫驾驶舱(Cockpit)是操作员控制机器人的座舱,通常位于前端。除了早期的,如今大部分机器人的驾驶舱采用密闭式的设计。机器人驾驶舱内一般安装有各类控制系统。 驾驶舱是机器人的首脑元件,为太空船里下令及控制的中心。它是设计用来尽量让驾驶员感到操控舒适,并包含所有先进导航及各项操控的系统,就如同其他提供居住人员所有必需品的组件是一样重要的。</h2>`);
prepareButton(line01, BABYLON.Color3.Blue(),`<font size="20">铠甲:</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机械外骨骼或称动力外骨骼(Powered exoskeleton),是一种由钢铁的框架构成并且可让人穿上的机器装置,这个装备可以提供额外能量来供四肢运动。别称:强化服、动力服(Power Suit)、动力装甲(Power armor或Powered armor)、Exoframe、Hardsuit或Exosuit等。凭借这套“服装”,人类就可以成为所谓的“铁人”。
<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;动力外骨骼更倾向于军用除了能够增强人体能力的这一基本功能外还要具有良好的防护性对复杂环境的适应性以及辅助火力通信侦查支持等军用功能
<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;动力服是设计成用来保护穿戴者的例如为了保护士兵或建筑工而设计或设计用来进行救援身处险境的人员上广泛一些的用途则是用来做为义肢与帮助老弱者行动其它的用途则是用来进行救援行动就像在一栋要倒塌的建筑物里这个装置可以提供给工人很大的力量来举起重物同时保护它不被落下的碎石砸伤在日本有银行为需常搬运沉重钞票及硬币的员工配备外骨骼以降低身体负担`);
//prepareButton(line05, BABYLON.Color3.Blue(),"右护版");
prepareButton(line17, BABYLON.Color3.Blue(),`<font size="20">左脚:</font>
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用激光器作为辐射源的雷达激光雷达是激光技术与雷达技术相结合的产物 由发射机 天线 接收机 跟踪架及信息处理等部分组成发射机是各种形式的激光器如二氧化碳激光器掺钕钇铝石榴石激光器半导体激光器及波长可调谐的固体激光器等天线是光学望远镜接收机采用各种形式的光电探测器如光电倍增管半导体光电二极管雪崩光电二极管红外和可见光多元探测器件等激光雷达采用脉冲或连续波2种工作方式探测方法分直接探测与外差探测
<br><img src='./img/2.jpg' height='400'>`);
prepareButton(line26, BABYLON.Color3.Blue(),`<font size="20">机器关节:</font><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机器人关节驱动器是一种集电液伺服阀及摆动缸于一体的液压或气动装置。关节机器人常见的有协作机器人(六轴、七轴)、外骨骼机器人、四足、双足、手术机器人等,里面用的东西基本都包含力矩电机、编码器、减速器、驱动器等,有的可能会用到抱闸、力矩传感器。但是每个应用匹配的方案不一样,用的产品也是多种多样。<br/><img src='./img/4.jpg'>`);
prepareButton(tube15, BABYLON.Color3.Blue(),`<p class='p13'><font size="20">机枪:</font><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机枪(Machine gun) 一种带有枪架或枪座,能实现连发射击的自动枪械。世界第一挺机枪是个叫伐商的比利时工程师(曾是拿破伦手下的上尉)于1851年设计的。该枪曾在1870、1871年的普法战争中用过。而普遍观点认为,现代机枪的鼻祖是加特林多管式机枪。1862年,由美国人理查德·杰丹·加特林发明,这种枪有几个枪筒,可以轮转。1883年,美国人海尔曼·S·马克沁进行革新,机枪变为单枪筒,利用后坐力,使上膛、射击和退弹能同时完成,枪身用枪筒上的水套降温,每分钟可射击650次,名为马克沁机枪.<br/></p><video src='a.mp4' controls='controls'></video> `);
var d1 = new Date();
var n_end= d1.getTime();
console.log("n_end:"+n_end);
console.log(n_end - n_Begin);
sleep(n_Begin,n_end);
engine.hideLoadingUI();
});
//GUI
// Another GUI on the right
var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");
advancedTexture.layer.layerMask = 2;
var panel3 = new BABYLON.GUI.StackPanel();
panel3.width = "800px";
panel3.fontSize = "30px";
panel3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
panel3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
advancedTexture.addControl(panel3);
var button1 = BABYLON.GUI.Button.CreateSimpleButton("but1", "旋 转");
button1.width = 0.2;
button1.height = "80px";
button1.color = "white";
button1.cornerRadius = 20;
button1.background = "green";
button1.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
//button1.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
//button1.centerY=5;
//console.log(button1);
//button1.position.x = 300;
//button1.position.y = 5;
var aaab = false;
button1.onPointerUpObservable.add(function() {
// circle.scaleX += 0.1;
if(aaab== false){
scene.registerBeforeRender(function(){
root.addRotation(0.00, 0.008, 0);
button1.textBlock.text = "停 止";
aaab = true;
button1.background = "red";
});
}else{
scene.registerBeforeRender(function(){
root.addRotation(0.00, -0.008, 0);
button1.textBlock.text = "旋 转";
aaab = false;
button1.background = "green";
});
}
});
var button3 = BABYLON.GUI.Button.CreateSimpleButton("but2", "展 开");
button3.width = 0.2;
button3.height = "80px";
button3.color = "white";
button3.cornerRadius = 20;
button3.background = "green";
var bob = false;
button3.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
button3.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
button3.onPointerUpObservable.add(function() {
// circle.scaleX += 0.1;
//gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
if(bob== false){
bob = true;
button3.textBlock.text = "合 体";
button3.background = "red";
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys = [];
keys.push({
frame: 0,
value: line03_position
});
keys.push({
frame: 20,
value: new BABYLON.Vector3(line03_position.x+60,line03_position.y,line03_position.z)
});
animationBox.setKeys(keys);
line03.animations.push(animationBox); //中间坐舱
//scene.beginAnimation(line03, 0, 100, false);
//左护版
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys1 = [];
keys1.push({
frame: 0,
value: line01_position
});
keys1.push({
frame: 20,
value: new BABYLON.Vector3(line01_position.x-40,line01_position.y,line01_position.z)
});
animationBox2.setKeys(keys1);
line01.animations.push(animationBox2); //中间坐舱
//scene.beginAnimation(line01, 0, 100, true);
//左脚
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys2 = [];
keys2.push({
frame: 0,
value: line17_position
});
keys2.push({
frame: 20,
value: new BABYLON.Vector3(line17_position.x-50,line17_position.y,line17_position.z)
});
animationBox3.setKeys(keys2);
line17.animations.push(animationBox3); //中间坐舱
//scene.beginAnimation(line17, 0, 100, true);
//右脚
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys4 = [];
keys4.push({
frame: 0,
value: line26_position
});
keys4.push({
frame: 20,
value: new BABYLON.Vector3(line26_position.x+50,line26_position.y,line26_position.z)
});
animationBox4.setKeys(keys4);
line26.animations.push(animationBox4); //中间坐舱
//scene.beginAnimation(line26, 0, 100, true);
//枪
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys5 = [];
keys5.push({
frame: 0,
value: new BABYLON.Vector3(-23,0,-47.5)
});
keys5.push({
frame: 20,
value:new BABYLON.Vector3(-2,0,-90)
});
animationBox5.setKeys(keys5);
tube15.animations.push(animationBox5); //中间坐舱
//scene.beginAnimation(tube15, 0, 100, true);
setTimeout(async () => {
var anim1 = scene.beginAnimation(line01, 0, 100, false);
var anim2 = scene.beginAnimation(line03, 0, 100, false);
var anim3 = scene.beginAnimation(line17, 0, 100, false);
var anim4 = scene.beginAnimation(line26, 0, 100, false);
var anim5 = scene.beginAnimation(tube15, 0, 100, false);
console.log("ddd");
//await anim1.waitAsync();
//await anim2.waitAsync();
//await anim3.waitAsync();
//await anim4.waitAsync();
await anim5.waitAsync();
console.log("dd33d");
scene.stopAnimation(line01);
scene.stopAnimation(line03);
scene.stopAnimation(line17);
scene.stopAnimation(line26);
scene.stopAnimation(tube15);
});
}else{
bob = false;
button3.background = "green";
var animationBox = new BABYLON.Animation("tutoAnimation", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys = [];
keys.push({
frame: 0,
value: new BABYLON.Vector3(line03_position.x-60,line03_position.y,line03_position.z)
});
keys.push({
frame: 20,
value: line03_position
});
animationBox.setKeys(keys);
line03.animations.push(animationBox); //中间坐舱
//scene.beginAnimation(line03, 0, 100, true);
//左护版
var animationBox2 = new BABYLON.Animation("Animation2", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys1 = [];
keys1.push({
frame: 0,
value: new BABYLON.Vector3(line01_position.x+40,line01_position.y,line01_position.z)
});
keys1.push({
frame: 20,
value:line01_position
});
animationBox2.setKeys(keys1);
line01.animations.push(animationBox2); //中间坐舱
//scene.beginAnimation(line01, 0, 100, true);
//左脚
var animationBox3 = new BABYLON.Animation("animationBox3", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys2 = [];
keys2.push({
frame: 0,
value: new BABYLON.Vector3(line17_position.x+50,line17_position.y,line17_position.z)
});
keys2.push({
frame: 20,
value:line17_position
});
animationBox3.setKeys(keys2);
line17.animations.push(animationBox3); //中间坐舱
// scene.beginAnimation(line17, 0, 100, true);
//右脚
var animationBox4 = new BABYLON.Animation("animationBox4", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys4 = [];
keys4.push({
frame: 0,
value: new BABYLON.Vector3(line26_position.x-50,line26_position.y,line26_position.z)
});
keys4.push({
frame: 20,
value: line26_position
});
animationBox4.setKeys(keys4);
line26.animations.push(animationBox4); //中间坐舱
//scene.beginAnimation(line26, 0, 100, true);
//枪
var animationBox5 = new BABYLON.Animation("animationBox5", "position", 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3,
BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
// Animation keys
var keys5 = [];
keys5.push({
frame: 0,
value:new BABYLON.Vector3(-2,0,-90)
});
keys5.push({
frame: 20,
value: new BABYLON.Vector3(-23,0,-47.5)
});
animationBox5.setKeys(keys5);
tube15.animations.push(animationBox5); //中间坐舱
button3.textBlock.text = "展 开";
setTimeout(async () => {
var anim1 = scene.beginAnimation(line01, 0, 100, false);
var anim2 = scene.beginAnimation(line03, 0, 100, false);
var anim3 = scene.beginAnimation(line17, 0, 100, false);
var anim4 = scene.beginAnimation(line26, 0, 100, false);
var anim5 = scene.beginAnimation(tube15, 0, 100, false);
console.log("ddd");
await anim1.waitAsync();
await anim2.waitAsync();
await anim3.waitAsync();
await anim4.waitAsync();
await anim5.waitAsync();
console.log("dd33d");
scene.stopAnimation(line01);
scene.stopAnimation(line03);
scene.stopAnimation(line17);
scene.stopAnimation(line26);
scene.stopAnimation(tube15);
});
}
});
var button2 = BABYLON.GUI.Button.CreateSimpleButton("but2", "拆 解");
button2.width =0.2;
button2.height = "80px";
button2.color = "white";
button2.cornerRadius = 20;
button2.background = "green";
button2.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
button2.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
var selectOne = false;
button2.onPointerUpObservable.add(function() {
// circle.scaleX += 0.1;
gizmoManager.positionGizmoEnabled = !gizmoManager.positionGizmoEnabled
if(selectOne== false){
//scene.stopAnimation(line01);
//scene.stopAnimation(line03);
//scene.stopAnimation(line17);
//scene.stopAnimation(line26);
//scene.stopAnimation(tube15);
selectOne = true;
button2.background = "red";
button2.textBlock.text = "取 消";
}else{
//window.location.reload(true);
selectOne = false;
button2.background = "green";
button2.textBlock.text = "拆 解";
}
});
var button4 = BABYLON.GUI.Button.CreateSimpleButton("but4", "还 原");
//button4.fontSize = "26px";
button4.width = 0.2;
button4.height = "80px";
button4.color = "white";
button4.cornerRadius = 20;
button4.background = "green";
button4.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_RIGHT;
button4.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
button4.onPointerUpObservable.add(function() {
window.location.reload(true);
});
panel3.addControl(button1);
panel3.addControl(button3);
panel3.addControl(button2);
panel3.addControl(button4);
return scene;
}
// call the createScene function
var scene = createScene();
//var a = scene.getElementById("__root");
// run the render loop
/**/
engine.runRenderLoop(function(){
scene.render();
});
var abc1 = scene.getMeshByName("plane");
window.addEventListener('resize', function(){
engine.resize();
});
});

18706
public/webWater/js/jquery-ui.js
File diff suppressed because it is too large
View File

11008
public/webWater/js/jquery.js
File diff suppressed because it is too large
View File

138
public/webWater/js/jquery.timers.min.js

@ -1,138 +0,0 @@
/**
* jQuery.timers - Timer abstractions for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/10/16
*
* @author Blair Mitchelmore
* @version 1.2
*
**/
jQuery.fn.extend({
everyTime: function(interval, label, fn, times) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, times);
});
},
oneTime: function(interval, label, fn) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, 1);
});
},
stopTime: function(label, fn) {
return this.each(function() {
jQuery.timer.remove(this, label, fn);
});
}
});
jQuery.extend({
timer: {
global: [],
guid: 1,
dataKey: "jQuery.timer",
regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
powers: {
// Yeah this is major overkill...
'ms': 1,
'cs': 10,
'ds': 100,
's': 1000,
'das': 10000,
'hs': 100000,
'ks': 1000000
},
timeParse: function(value) {
if (value == undefined || value == null)
return null;
var result = this.regex.exec(jQuery.trim(value.toString()));
if (result[2]) {
var num = parseFloat(result[1]);
var mult = this.powers[result[2]] || 1;
return num * mult;
} else {
return value;
}
},
add: function(element, interval, label, fn, times) {
var counter = 0;
if (jQuery.isFunction(label)) {
if (!times)
times = fn;
fn = label;
label = interval;
}
interval = jQuery.timer.timeParse(interval);
if (typeof interval != 'number' || isNaN(interval) || interval < 0)
return;
if (typeof times != 'number' || isNaN(times) || times < 0)
times = 0;
times = times || 0;
var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
if (!timers[label])
timers[label] = {};
fn.timerID = fn.timerID || this.guid++;
var handler = function() {
if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
jQuery.timer.remove(element, label, fn);
};
handler.timerID = fn.timerID;
if (!timers[label][fn.timerID])
timers[label][fn.timerID] = window.setInterval(handler,interval);
this.global.push( element );
},
remove: function(element, label, fn) {
var timers = jQuery.data(element, this.dataKey), ret;
if ( timers ) {
if (!label) {
for ( label in timers )
this.remove(element, label, fn);
} else if ( timers[label] ) {
if ( fn ) {
if ( fn.timerID ) {
window.clearInterval(timers[label][fn.timerID]);
delete timers[label][fn.timerID];
}
} else {
for ( var fn in timers[label] ) {
window.clearInterval(timers[label][fn]);
delete timers[label][fn];
}
}
for ( ret in timers[label] ) break;
if ( !ret ) {
ret = null;
delete timers[label];
}
}
for ( ret in timers ) break;
if ( !ret )
jQuery.removeData(element, this.dataKey);
}
}
}
});
jQuery(window).bind("unload", function() {
jQuery.each(jQuery.timer.global, function(index, item) {
jQuery.timer.remove(item);
});
});

9
src/assets/styles/index.scss

@ -734,13 +734,18 @@
}
}
// 一键清屏
.onClickClear-btn{
.topRight-btn{
position: absolute;
bottom: -14px;
right: 29px;
font-size: 30px;
display: flex;
justify-content: flex-end;
}
// 一键清屏
.btn-style{
cursor: pointer;
margin-left: 10px;
opacity: .4;
&:hover{
opacity: 1;

11
src/icons/svg/rotate.svg

@ -0,0 +1,11 @@
<svg t="1745560639747" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1507" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
<defs>
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0" style="stop-color:#C8E4FF"/>
<stop offset="0.632" style="stop-color:#339CFF"/>
<stop offset="1" style="stop-color:#339CFF"/>
</linearGradient>
</defs>
<path d="M336 804.8v-91.2l176 123.2L336 960v-89.6C172 826.4 57.6 724 57.6 600.8c0-56.8 24.8-110.4 69.6-156.8 12-12.8 32-13.6 44.8-0.8 12.8 12 13.6 32 0.8 44.8l-0.8 0.8c-33.6 34.4-51.2 72.8-51.2 112 0 85.6 85.6 164.8 215.2 204z m280 80c-17.6 3.2-33.6-8.8-36.8-25.6-3.2-17.6 8.8-33.6 25.6-36.8 0.8 0 0.8 0 2.4-0.8C781.6 795.2 904 701.6 904 600c0-37.6-16-74.4-47.2-108-12-12.8-11.2-32.8 1.6-44.8 12.8-12 32.8-11.2 44.8 1.6C944.8 493.6 968 545.6 968 600c-0.8 140.8-149.6 255.2-352 284.8zM512 678.4L265.6 528.8v-300L512 79.2l247.2 149.6v300L512 678.4z m188.8-180V307.2L540.8 408v192l160-101.6z m-377.6 0l160 101.6V398.4l-160-99.2v199.2zM512 139.2L346.4 244 516 348.8h6.4l160.8-101.6-171.2-108z" fill="url(#gradient)" p-id="1508"></path>
</svg>

13
src/icons/svg/srotate.svg

@ -0,0 +1,13 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1745560614938" class="icon" viewBox="0 0 1048 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1514" xmlns:xlink="http://www.w3.org/1999/xlink" width="204.6875" height="200">
<!-- 定义线性渐变 -->
<linearGradient id="myGradient" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0" style="stop-color:#C8E4FF"/>
<stop offset="0.632" style="stop-color:#339CFF"/>
<stop offset="1" style="stop-color:#339CFF"/>
</linearGradient>
<path d="M962.33522 593.895024c0-44.956098-20.979512-86.915122-56.944391-125.877073-14.985366-14.985366-11.988293-35.964878 0-50.950244 14.985366-14.985366 35.964878-11.988293 50.950244 0 50.950244 50.950244 77.923902 113.88878 77.923903 176.827317 0 137.865366-128.874146 254.75122-314.692683 305.701464v101.900488l-200.803903-140.862439 200.803903-140.862439v101.900487c143.859512-41.959024 242.762927-131.87122 242.762927-227.777561z m-836.183415-176.827317c14.985366 14.985366 14.985366 35.964878 2.997073 50.950244-35.964878 38.961951-53.947317 80.920976-53.947317 122.88 0 116.885854 137.865366 221.783415 335.672195 251.754147h2.997073c20.979512 2.997073 32.967805 20.979512 29.970732 41.959024-2.997073 20.979512-20.979512 32.967805-41.959024 29.970732-230.774634-32.967805-398.610732-164.839024-401.607805-323.683903 0-62.938537 26.973659-119.882927 74.926829-170.833171 14.985366-14.985366 35.964878-14.985366 50.950244-2.997073z m110.891707-174.979122l68.932683 43.082927v188.81561c-2.997073 2.997073 179.82439 116.885854 179.82439 116.885854v-193.336196l65.93561 41.209757v149.154341l118.534244-75.076683 60.690732 37.937951-212.192781 130.048-281.724878-170.83317V242.088585zM157.396293 74.52722l698.967414 436.773463a37.463415 37.463415 0 0 1-39.711219 63.537951L117.685073 138.065171a37.463415 37.463415 0 1 1 39.71122-63.537951zM518.793366 0.499512l278.727805 170.833171v273.732683l-65.93561-41.209756V249.256585l-124.578341 76.8-63.013464-39.386536 160.593171-100.352-188.81561-119.882927c2.197854 2.197854-101.800585 68.757854-157.546146 104.148293l-59.092293-36.913952L518.76839 0.474537z"
fill="url(#myGradient)" p-id="1515">
</path>
</svg>

19
src/views/header/index.vue

@ -30,9 +30,15 @@
<iframe height="50" frameborder="0" scrolling="no" hspace="0" src="https://i.tianqi.com/?c=code&a=getcode&id=52&icon=1&color=%23FFFFFF&py=qiyang&site=14" />
</div>
</div>
<div class="onClickClear-btn" @click="handleClear">
<svg-icon v-if="!isClear" icon-class="copen" class-name="msg-list-svg" />
<svg-icon v-else icon-class="cclose" class-name="msg-list-svg" />
<div class="topRight-btn">
<div class="btn-style" @click="handleRotate">
<svg-icon v-if="!isRotate" icon-class="rotate" class-name="msg-list-svg" />
<svg-icon v-else icon-class="srotate" class-name="msg-list-svg" />
</div>
<div class="btn-style" @click="handleClear">
<svg-icon v-if="!isClear" icon-class="copen" class-name="msg-list-svg" />
<svg-icon v-else icon-class="cclose" class-name="msg-list-svg" />
</div>
</div>
</div>
</template>
@ -59,7 +65,8 @@ export default {
return {
nowDate: '',
currentWeek: this.getCurrentWeek(),
isClear: false
isClear: false,
isRotate: false
}
},
watch: {
@ -82,6 +89,10 @@ export default {
handleClear() {
this.isClear = !this.isClear
this.$emit('onClickClearPage', this.isClear)
},
handleRotate() {
this.isRotate = !this.isRotate
this.$emit('onClickRotate', this.isRotate)
}
}
}

15
src/views/index.vue

@ -6,7 +6,7 @@
<dv-loading>Loading...</dv-loading>
</div>
<!-- Header -->
<Header :header-title="headerTitle" @onClickClearPage="onClickClearPage" />
<Header :header-title="headerTitle" @onClickClearPage="onClickClearPage" @onClickRotate="onClickRotate" />
<!-- 底部菜单 楼栋 / 房间 -->
<div class="page-nav">
@ -23,12 +23,12 @@
</ul>
</div>
<component :is="comName" :is-get-clear="isGetClear" />
<component :is="comName" :is-get-clear="isGetClear" :is-get-rotate="isGetRotate" />
<!-- <ul v-if="isGetClear" :class="{ 'right-fixed': true, 'animate__fadeInRight': isGetClear}">
<ul v-if="isGetClear" :class="{ 'right-fixed': true, 'animate__fadeInRight': isGetClear}">
<li>20</li>
<li>0</li>
</ul> -->
</ul>
<!-- <div class="cus">
<div class="squ as">1
@ -76,7 +76,8 @@ export default {
isLoading: false,
loadingTtimer: null,
isGetClear: false,
showDiv: false
showDiv: false,
isGetRotate: false
}
},
computed: {
@ -115,6 +116,10 @@ export default {
},
onClickClearPage(data) {
this.isGetClear = data
},
onClickRotate(data) {
this.isGetRotate = data
console.log('onClickRotate', data)
}
}
}

64
src/views/pageBasement/index.vue

@ -51,27 +51,89 @@ export default {
isGetClear: {
type: Boolean,
default: false
},
isGetRotate: {
type: Boolean,
default: false
}
},
data() {
return {
open: false
}
},
computed: {
watch: {
isGetRotate(newValue) {
// isGetRotate iframe
this.modelIsRotate(newValue)
}
},
async created() {
// window.getIframeLoading = this.getIframeLoading
},
activated() {
},
beforeDestroy() {
},
mounted() {
// this.iframeWin = this.$refs.myIframe.contentWindow
// iframe
window.addEventListener('message', this.handleMessageEvent)
this.$nextTick(() => {
this.$refs.cameraList.cameraList = []
this.$refs.cameraList.getCameraList('1')
})
},
methods: {
//
getIframeLoading(value) {
// console.log(`iframe${value}`)
if (value === 'false') {
const data = [
// {
// 'deviceId': 'S004',
// 'isAlarm': true
// },
// {
// 'deviceId': 'S002',
// 'isAlarm': true
// }
]
this.deviceState(data)
this.modelIsRotate(this.isGetRotate)
}
},
//
deviceState(e) {
this.iframeWin.postMessage({
type: 'deviceState',
data: e
}, '*')
},
//
modelIsRotate(isRotate) {
this.iframeWin.postMessage({
type: 'isGetRotate',
value: isRotate
}, '*')
},
handleMessageEvent(event) {
if (event.data && event.data.data) {
const data = event.data.data
console.log(data)
//
if (data.includes('C')) {
this.open = true
this.$nextTick(() => {
this.$refs.camera.camConfig = {
'id': data,
'area_id': '1'
}
this.$refs.camera.getVideoUrl()
})
}
}
},
handleViewVideo(item) {
this.$refs.camera.videoTitle = item.name
this.$refs.camera.openVideo(item.rtsp_url)

69
src/views/pageFullView/index.vue

@ -107,6 +107,10 @@ export default {
isGetClear: {
type: Boolean,
default: false
},
isGetRotate: {
type: Boolean,
default: false
}
},
data() {
@ -118,9 +122,13 @@ export default {
open: false
}
},
computed: {
watch: {
isGetRotate(newValue) {
this.modelIsRotate(newValue)
}
},
async created() {
// window.getIframeLoading = this.getIframeLoading
},
activated() {
},
@ -128,6 +136,7 @@ export default {
window.removeEventListener('message', this.handleMessageEvent)
},
mounted() {
// this.iframeWin = this.$refs.myIframe.contentWindow
// iframe
window.addEventListener('message', this.handleMessageEvent)
this.$nextTick(() => {
@ -136,36 +145,52 @@ export default {
})
},
methods: {
//
getIframeLoading(value) {
// console.log(`iframe${value}`)
if (value === 'false') {
const data = [
// {
// 'deviceId': 'S004',
// 'isAlarm': true
// },
// {
// 'deviceId': 'S002',
// 'isAlarm': true
// }
]
this.deviceState(data)
this.modelIsRotate(this.isGetRotate)
}
},
//
deviceState(e) {
this.iframeWin.postMessage({
type: 'deviceState',
data: e
}, '*')
},
//
modelIsRotate(isRotate) {
this.iframeWin.postMessage({
type: 'isGetRotate',
value: isRotate
}, '*')
},
handleMessageEvent(event) {
// const _this = this
if (event.data && event.data.data) {
const data = event.data.data
console.log(data)
// if (data === 'A') {
// _this.activeIndex = 1
// } else if (data === 'B') {
// _this.activeIndex = 2
// } else if (data === 'C') {
// _this.activeIndex = 3
// } else if (data === 'w') {
// _this.activeIndex = 5
// } else if (data === '') {
// _this.activeIndex = 6
// }
// console.log('this.camConfigData', this.camConfigData)
//
if (data.includes('C')) {
// const camConfig = this.camConfigData.find((x) => { return x.divPosition === data })
// console.log(1, camConfig)
// if (camConfig && camConfig.isDisplay && camConfig.bindState) {
// console.log(2, camConfig)
this.open = true
this.$nextTick(() => {
// this.$refs.camera.camConfig = camConfig
this.$refs.camera.videoTitle = data
this.$refs.camera.openVideo()
this.$refs.camera.camConfig = {
'id': data,
'area_id': '0'
}
this.$refs.camera.getVideoUrl()
})
// }
}
}
},

21
src/views/pageThirdFloor/index.vue

@ -47,6 +47,10 @@ export default {
isGetClear: {
type: Boolean,
default: false
},
isGetRotate: {
type: Boolean,
default: false
}
},
data() {
@ -54,7 +58,11 @@ export default {
open: false
}
},
computed: {
watch: {
isGetRotate(newValue) {
// isGetRotate iframe
this.modelIsRotate(newValue)
}
},
async created() {
window.getIframeLoading = this.getIframeLoading // vuewindow
@ -99,14 +107,23 @@ export default {
}
]
this.deviceState(data)
this.modelIsRotate(this.isGetRotate)
}
},
// data / iframe
//
deviceState(e) {
this.iframeWin.postMessage({
type: 'deviceState',
data: e
}, '*')
},
//
modelIsRotate(isRotate) {
this.iframeWin.postMessage({
type: 'isGetRotate',
value: isRotate
}, '*')
},
handleMessageEvent(event) {
if (event.data && event.data.data) {
const data = event.data.data

27
src/views/pageWaterPumpHouse/index.vue

@ -67,6 +67,10 @@ export default {
isGetClear: {
type: Boolean,
default: false
},
isGetRotate: {
type: Boolean,
default: false
}
},
data() {
@ -98,10 +102,13 @@ export default {
open: false
}
},
computed: {
watch: {
isGetRotate(newValue) {
this.modelIsRotate(newValue)
}
},
async created() {
window.getIframeLoading = this.getIframeLoading // vuewindow
window.getIframeLoading = this.getIframeLoading
},
activated() {
},
@ -130,27 +137,31 @@ export default {
methods: {
//
getIframeLoading(value) {
// console.log(`iframe${value}`)
if (value === 'false') {
const data = [
{
'deviceId': 'S001',
'isAlarm': true
},
{
'deviceId': 'S002',
'isAlarm': true
}
]
this.deviceState(data)
this.modelIsRotate(this.isGetRotate)
}
},
// data / iframe
//
deviceState(e) {
this.iframeWin.postMessage({
type: 'deviceState',
data: e
}, '*')
},
//
modelIsRotate(isRotate) {
this.iframeWin.postMessage({
type: 'isGetRotate',
value: isRotate
}, '*')
},
handleMessageEvent(event) {
if (event.data && event.data.data) {
const data = event.data.data

Loading…
Cancel
Save