邓洁 : 隧道模型合并

This commit is contained in:
dengj
2023-12-07 15:58:43 +08:00
parent 7766cd16ef
commit 5f14289731
25 changed files with 438499 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
export function addDev(devId) {
if (!this.checkDevId) {
alert("请选择设备");
return;
}
const devModel = this.devMap.get(devId).clone();
handleLoadedDevice.call(this, devModel);
}
function handleLoadedDevice(model) {
if (!this.targetPoint) return;
//获取定位位置
const wp = this.targetPoint.getWorldPosition(new this.THREE.Vector3());
model.position.copy(wp);
this.targetPoint.visible = false;
this.scene.add(model);
if (model.name === "camera") {
model.translateX(-5);
model.translateZ(4);
model.translateY(-0.5);
}
// 添加的信息请求或初始化的信息
this.targetPoint.info = {
name: "摄像头",
state: "未开启",
devId: model.id,
};
this.targetPoint.hasDevice = true;
}

View File

@@ -0,0 +1 @@
export function checkDevModel() {}

View File

@@ -0,0 +1,36 @@
/**
*
* @param {Vector3} Vec3 出现位置
*/
export function checkAnimation(Vec3 = new this.THREE.Vector3(), size = 0.3) {
// 先清空group
if (this.group) {
if (Vec3.x === this.group.position.x && Vec3.z === this.group.position.z) {
return;
}
this.scene.remove(this.group);
}
// 创建一个group
this.group = new this.THREE.Group();
// 创建一个圆柱
const cylinder = new this.THREE.CylinderGeometry(0.5, 0.5, 3, 32);
const material = new this.THREE.MeshBasicMaterial({ color: "#0dbc79" });
const cylinderMesh = new this.THREE.Mesh(cylinder, material);
const header = new this.THREE.CylinderGeometry(1, 0.1, 3, 32);
const headerMesh = new this.THREE.Mesh(header, material);
headerMesh.position.set(0, -3, 0);
this.group.add(cylinderMesh, headerMesh);
this.group.position.set(Vec3.x, Vec3.y + 2, Vec3.z);
// 创建动画
this.checkAnimationTween = new this.TWEEN.Tween(this.group.position);
this.checkAnimationTween.to({ y: this.group.position.y + 1 }, 500);
// 循环动画
this.checkAnimationTween.repeat(Infinity);
this.checkAnimationTween.yoyo(true);
this.checkAnimationTween.start();
this.group.scale.set(size, size, size);
this.scene.add(this.group);
}

View File

@@ -0,0 +1,456 @@
import { handleLClick } from "./handleRLclick/handleLclick";
import { handleRClick } from "./handleRLclick/handleRclick";
import { handleDBLClick } from "./handleDBLclick";
import { checkAnimation } from "./checkTag";
import {
handleEndChange,
handleStartChange,
} from "./handleOrbitControlsChange";
import { saveState, resetState } from "./viewBack";
import { addDev } from "./addDevice";
import { removeDev } from "./removeDevice";
import { checkDevModel } from "./checkDevModel";
export default class Demo {
// 摄像机看向位置
origin = null;
//附着点的模型
points = [];
//设备模型数组
deviceModels = [];
constructor(three, mountedElement) {
// 外部引入匿名函数
this._handleLClick = handleLClick;
this._handleRClick = handleRClick;
this._handleDBLClick = handleDBLClick;
this._checkAnimation = checkAnimation;
this._saveSate = saveState;
this._resetState = resetState;
this._removeDev = removeDev;
this.THREE = three;
this.mountedElement = mountedElement;
//初始化场景
this.scene = new this.THREE.Scene();
// 初始化摄像机
this.camera = new this.THREE.PerspectiveCamera(
75,
window.innerWidth / window.innerHeight,
0.1,
1000
);
this.camera.position.z = 130;
this.camera.position.y = 35;
this.camera.position.x = 40;
this.camera.lookAt(0, 0, 1000);
// 初始化渲染器
this.renderer = new this.THREE.WebGLRenderer({
// 抗锯齿
antialias: true,
});
this.renderer.setSize(window.innerWidth, window.innerHeight);
this.renderer.domElement.style.position = "absolute";
this.mountedElement.appendChild(this.renderer.domElement);
// 创建渲染帧
this.render = () => {
this.__renderScope();
requestAnimationFrame(this.render);
};
this.render();
this.canvasResize();
this.addXYZ();
this.HTMLTagEventListener();
this.bindRightPlaneInfo();
}
//渲染函数作用域(这里主要写渲染帧内操作)
__renderScope() {
this.renderer.render(this.scene, this.camera);
// 轨道控制器更新
if (this.orbitControls) {
this.orbitControls.update();
}
// 摄像头移动动画
if (this.cameraPositionTween) {
this.cameraPositionTween.update();
}
//html标签渲染
if (this.CSS2Renderer) {
this.CSS2Renderer.render(this.scene, this.camera);
}
// 选中标签动画渲染
if (this.checkAnimationTween) {
this.checkAnimationTween.update();
}
// 视角重置动画
if (this.resetViewAngleAnimation) {
this.resetViewAngleAnimation.update();
}
//视角回退动画
if (this.viewSateResetAnimation) {
this.viewSateResetAnimation.update();
}
// 视角跟随动画
if (this.intoPointAnimation) {
this.intoPointAnimation.update();
}
}
// 添加世界坐标系
addXYZ() {
// const axesHelper = new this.THREE.AxesHelper(100);
// this.scene.add(axesHelper);
}
// 屏幕自适应
canvasResize() {
window.addEventListener("resize", () => {
this.camera.aspect = window.innerWidth / window.innerHeight;
this.camera.updateProjectionMatrix();
this.renderer.setSize(window.innerWidth, window.innerHeight);
this.CSS2Renderer.setSize(window.innerWidth, window.innerHeight);
});
}
// 模型加载
/**
* @param {Object} GLTFLoader 模型加载器
* @param {String} path 模型资源路径
*/
loadModel(GLTFLoader, path) {
return new Promise((resolve, reject) => {
this.gltfloader = new GLTFLoader();
this.gltfloader.load(
"../../../../../public/tunnelModel/chanel.glb",
(gltf) => {
gltf.scene.traverse((child) => {
this._forModels(child);
});
this.scene.add(gltf.scene);
// 加载完后可执行函数
this._afterLoaded(gltf.scene);
resolve(gltf);
},
(xhr) => {
console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
},
(error) => {
console.log(error);
reject(error);
}
);
});
}
// 模型加载完函数
_afterLoaded() {
// 可以进行选中
this._hoverModel(this.points);
// 可以进行点击
this._ClickModel(this.points);
}
// 在此方法中对模型批量操作
_forModels(child) {
// 匹配附着点(这里不适合对单个模型进行保存,批量对模型进行操作)
if (child.isMesh && /^point+/.test(child.name)) {
this.points.push(child);
// 改变为基础材质
child.material = new this.THREE.MeshBasicMaterial();
// 遍历一个属性是否存在设备
child.hasDevice = false; //初始化
}
}
// 添加轨道控制器
/**
* @param {Object} OrbitControls 轨道控制器
*/
addOrbitControls(OrbitControls) {
this.orbitControls = new OrbitControls(
this.camera,
this.renderer.domElement
);
//限制轨道控制器的视角变化
this.orbitControls.maxPolarAngle = Math.PI * (3 / 5);
// 监听控制器变化
this.orbitControls.addEventListener("end", handleEndChange.bind(this));
this.orbitControls.addEventListener("start", handleStartChange.bind(this));
}
/**
* @param {Class} Tween 添加补间动画
*/
addTween(Tween) {
this.TWEEN = Tween;
}
/***
* 鼠标移入可以高亮的模型
*@param {Array} hoverModels 需要高亮的模型
*/
_hoverModel(hoverModels) {
this.renderer.domElement.addEventListener("mousemove", (e) => {
const mouse = new this.THREE.Vector2();
mouse.x = (e.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(e.clientY / window.innerHeight) * 2 + 1;
const raycaster = new this.THREE.Raycaster();
raycaster.setFromCamera(mouse, this.camera);
const intersects = raycaster.intersectObjects(hoverModels);
if (intersects.length > 0) {
if (!this.preHover) {
this.preHover = intersects[0].object;
} else {
this.preHover.material.color.set("white");
this.preHover = intersects[0].object;
}
intersects[0].object.material.color.set("red");
const tagP = intersects[0].object.getWorldPosition(
new this.THREE.Vector3()
);
this._checkAnimation(tagP);
} else {
if (!this.preHover) return;
this.preHover.material.color.set("white");
}
});
}
/**
* @param {Array} isClickModels 可以进行点击的模型吧
*/
_ClickModel(isClickModels) {
// 点击两次处理事件
this.renderer.domElement.addEventListener(
"dblclick",
this.__handleListenerDBLClickEvent.bind(this, isClickModels) //注意这里重新指向this第一个是修改this指向第二个是传入函数的参数
);
// 点击一次时处理时间
this.renderer.domElement.addEventListener(
"mousedown",
this.__handleListenerClickRLEvent.bind(this, isClickModels) //注意这里重新指向this第一个是修改this指向第二个是传入函数的参数
);
}
// 处理点击2次触发事件事件
__handleListenerDBLClickEvent(isClickModels, e) {
// 如果监听到双击则清空单次点击事件
clearTimeout(this.EventTimer);
//最后一个是监听器默认参数
const mouse = new this.THREE.Vector2();
mouse.x = (e.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(e.clientY / window.innerHeight) * 2 + 1;
const raycaster = new this.THREE.Raycaster();
raycaster.setFromCamera(mouse, this.camera);
const intersects = raycaster.intersectObjects(isClickModels);
// 取消定位的视角返回初始化
if (intersects.length === 0) {
this.clearTagsObj();
this._resetState();
return;
}
// 处理连续双击击事件
this._handleDBLClick(intersects[0].object);
}
// 处理点击左右键触发的事件
__handleListenerClickRLEvent(isClickModels, e) {
clearTimeout(this.EventTimer);
this.EventTimer = setTimeout(() => {
const mouse = new this.THREE.Vector2();
mouse.x = (e.clientX / window.innerWidth) * 2 - 1;
mouse.y = -(e.clientY / window.innerHeight) * 2 + 1;
const raycaster = new this.THREE.Raycaster();
raycaster.setFromCamera(mouse, this.camera);
const intersects = raycaster.intersectObjects(isClickModels);
if (intersects.length === 0) return;
this.setBoxHelper(intersects[0].object);
// 处理点击左右键事件
if (e.button === 0) {
this._handleLClick(intersects[0].object);
} else if (e.button === 2) {
this._handleRClick(intersects[0].object);
}
}, 400);
}
// 添加css3Renderer
addCSS3Renderer(CSS2Renderer, CSS2DObject, [infoDom, editDom]) {
this.CSS2Renderer = new CSS2Renderer();
this.CSS2Renderer.setSize(window.innerWidth, window.innerHeight);
this.CSS2Renderer.render(this.scene, this.camera);
this.mountedElement.appendChild(this.CSS2Renderer.domElement);
// 初始化html标签
this.tagHtml = infoDom;
this.tag2Html = infoDom;
this.tag3Html = editDom;
this.CSS2DObject = CSS2DObject;
// 创建html标签模型
this.tagCSS2DObj = new CSS2DObject(this.tagHtml);
this.tag2CSS2DObj = new CSS2DObject(this.tag2Html);
this.tag3CSS2DObj = new CSS2DObject(this.tag3Html);
// 设置该标签初始化透明
this.tagCSS2DObj.element.style.display = "none";
this.tag2CSS2DObj.element.style.display = "none";
this.tag3CSS2DObj.element.style.display = "none";
this.tagCSS2DObj.scale.set(0.1, 0.1, 0.1);
this.tag2CSS2DObj.scale.set(0.1, 0.1, 0.1);
this.tag3CSS2DObj.scale.set(0.1, 0.1, 0.1);
this.tagCSS2DObj.scale.set(3, 3, 3);
}
clearTagsObj() {
if (this.preDBLModel) {
this.preDBLModel.remove(this.tagCSS2DObj);
}
// 所有标签看不见
this.scene.remove(this.tag2CSS2DObj);
this.scene.remove(this.tag3CSS2DObj);
// 删除标记动画
this.scene.remove(this.group);
}
/**
* @param {Array} paths 所有设备模型的路径
*/
addDeviceModels(paths) {
const gltfloader = this.gltfloader;
load(paths);
function load(paths, current = 0) {
return new Promise((resolve, reject) => {
// try {
gltfloader(paths[current], (deviceModel) => {
this.deviceModels.push(deviceModel);
current++;
console.log(deviceModel);
load(paths, current);
if (current > paths.length) {
resolve("ok");
}
});
// } catch (e) {
// reject(new Error("加载异常"));
// }
});
}
}
// 附着点选中线宽包围
setBoxHelper(obj) {
// 判断场景是否纯在该3d对象
if (this.scene.getObjectByName("boxHelper")) {
const preModel = this.scene.getObjectByName("boxHelper");
this.scene.remove(preModel);
}
const boxHelper = new this.THREE.BoxHelper(obj, 0xffff00);
boxHelper.name = "boxHelper";
this.scene.add(boxHelper);
}
/**
*@param {Class} DRACOLoader 解压器
* @param {String} dracoPath 解压器路径
*/
addDARCOLoder(DRACOLoader, dracoPath) {
this.DRAC = new DRACOLoader();
this.DRAC.setDecoderPath(dracoPath);
//给模型加载器添解压器
this.gltfloader.setDRACOLoader(this.DRAC);
}
// 监听tagHTML标签内事件
HTMLTagEventListener() {
// this.addBtn = document.querySelector("#add-model");
// this.removeBtn = document.querySelector("#remove-model");
// //开启监听
// this.addBtn.addEventListener("click", addDev.bind(this));
// this.removeBtn.addEventListener("click", removeDev.bind(this));
// //监听选择设备
// this.devList = document.querySelector(".divice-list ul");
// this.devList.addEventListener("click", checkDevModel.bind(this));
}
/**
* @param {Meshes} meshes gltf加载过后的模型数组
*/
initDevicesModel(meshes) {
this.deviceList = [];
meshes.forEach((mesh) => {
this.deviceList.push(mesh);
});
console.log(this.deviceList);
}
/**
* @param {String} devId 添加的设备ID
*/
addDevice(devId) {
addDev.bind(this, devId);
}
/**
* @param {String} devId 删除的设备ID
*/
removeDevice(devId) {
removeDev.bind(this, devId);
}
//获取右边面板信息
bindRightPlaneInfo() {
// this.chanelLengthInput = document.querySelector("#chanel-length-input");
// this.aspectValue = document.querySelector("#aspect-length-value");
// this.chanelLengthInput.addEventListener("input", (e) => {
// // console.log(e.target.value);
// });
}
/**
* @param {OBJLoader} objloader 模型加载器
*/
addOBJLoader(objloader) {
this.OBJLoader = new objloader();
}
// 先把模型加载完成
loadeOBJModel() {
this.devMap = new Map();
this.OBJLoader.load(
"../../../../../public/devicesModel/Camera.obj",
callBack.bind(this, "dev_1")
);
this.OBJLoader.load(
"../../../../../public/devicesModel/Camera.obj",
callBack.bind(this, "dev_2")
);
this.OBJLoader.load(
"../../../../../public/devicesModel/Camera.obj",
callBack.bind(this, "dev_3")
);
this.OBJLoader.load(
"../../../../../public/devicesModel/Camera.obj",
callBack.bind(this, "camera")
);
function callBack(param, model) {
switch (param) {
case "dev_1":
model.scale.set(0.2, 0.2, 0.2);
break;
case "dev_2":
model.scale.set(0.2, 0.2, 0.2);
break;
case "dev_3":
model.scale.set(0.1, 0.1, 0.1);
break;
case "camera":
model.scale.set(0.7, 0.7, 0.7);
model.name = "camera";
break;
}
this.devMap.set(param, model);
}
}
}

View File

@@ -0,0 +1,99 @@
export function handleDBLClick(e) {
this._saveSate();
// 注意位置不能改变
this.clearTagsObj();
this.preDBLModel = e;
//获取模型世界坐标位置
const modelP = new this.THREE.Vector3();
e.getWorldPosition(modelP);
this._checkAnimation(modelP);
this.setBoxHelper(e);
if (/l$/.test(e.name)) {
//匹配单个隧道左边附着点
modelP.x += 5;
modelP.y -= 5;
modelP.z += 10;
this.orbitControls.target = modelP;
this.cameraPositionTween = new this.TWEEN.Tween(this.camera.position);
this.cameraPositionTween.to(modelP, 400);
this.cameraPositionTween.start();
modelP.x -= 4;
modelP.y += 4;
modelP.z -= 20;
} else if (/r$/.test(e.name)) {
//匹配单个隧道右边附着点
modelP.x -= 5;
modelP.y -= 5;
modelP.z += 10;
this.orbitControls.target = modelP;
this.cameraPositionTween = new this.TWEEN.Tween(this.camera.position);
this.cameraPositionTween.to(modelP, 400);
this.cameraPositionTween.start();
modelP.x += 4;
modelP.y += 4;
modelP.z -= 20;
}
if (this.preTargetModel) {
this.preTargetModel.remove(this.tagCSS2DObj);
}
this.cameraPositionTween.onComplete(() => {
this.orbitControls.target = modelP;
this.camera.lookAt(modelP);
// 选中的物体闪梭(这里必需放在下一个函数之前,这里需要使用到下一个函数需要清空的上一个模型)
// handleModelFlash(e, this);
// 动画完成过后自动弹出标签
autoOutTag(e, this);
this.listenerEventFlag = false;
});
}
//点击模型视角位移过去后模型闪烁函数
// function handleModelFlash(e, context) {
// if (context.timer) {
// clearInterval(context.timer);
// context.preTargetModel.material.color.set("white");
// }
// context.timer = setInterval(fun, 400);
// let flag = false;
// function fun() {
// if (flag) {
// e.material.color.set("red");
// flag = false;
// } else {
// e.material.color.set("white");
// flag = true;
// }
// }
// }
// 视角移动过去自动弹出标签
function autoOutTag(targetModel, context) {
// 判断是否纯在设备
// if (targetModel.hasDevice) return;
context.preTargetModel = targetModel;
context.tagCSS2DObj.element.style.display = "block";
displayDevInfo(context, targetModel);
targetModel.add(context.tagCSS2DObj);
if (/l$/.test(targetModel.name)) {
context.tagCSS2DObj.position.set(150, 0, 700);
} else if (/r$/.test(targetModel.name)) {
context.tagCSS2DObj.position.set(-150, 0, 700);
}
}
function displayDevInfo(context, targetModel) {
if (!targetModel.info) {
// 因为标签内的内容共同使用所以附着点没有信心则清空信息
// context.tagCSS2DObj.element.children[1].children[1].innerHTML = "无";
// context.tagCSS2DObj.element.children[2].children[1].innerHTML = "无";
return;
}
console.log(targetModel.info);
context.tagCSS2DObj.element.children[1].children[1].innerHTML =
targetModel.info.name;
context.tagCSS2DObj.element.children[2].children[1].innerHTML =
targetModel.info.state;
}

View File

@@ -0,0 +1,9 @@
// 轨道控制器开始结束hook
export function handleStartChange(e) {
// console.log("开始");
}
export function handleEndChange(e) {
// 围绕点到照相机的位置
// console.log("结束");
// console.log(this.camera.position);
}

View File

@@ -0,0 +1,71 @@
export function handleLClick(targetPoint) {
this.clearTagsObj();
const worldPosition = new this.THREE.Vector3();
//获取附着点的世界坐标系
targetPoint.getWorldPosition(worldPosition);
this._checkAnimation(worldPosition);
// 显示左键属性栏
this.tag2CSS2DObj.element.style.display = "block";
// 设置标签位置
this.tag2CSS2DObj.position.set(
worldPosition.x,
worldPosition.y,
worldPosition.z
);
this.tag2CSS2DObj.translateY(-15);
this.tag2CSS2DObj.translateX(15);
displayDevInfo(this, targetPoint);
this.scene.add(this.tag2CSS2DObj);
intoAnimation.call(this, targetPoint);
}
function displayDevInfo(context, targetModel) {
if (!targetModel.info) {
// 因为标签内的内容共同使用所以附着点没有信心则清空信息
context.tag2CSS2DObj.element.children[1].children[1].innerHTML = "无";
context.tag2CSS2DObj.element.children[2].children[1].innerHTML = "无";
return;
}
context.tag2CSS2DObj.element.children[1].children[1].innerHTML =
targetModel.info.name;
context.tag2CSS2DObj.element.children[2].children[1].innerHTML =
targetModel.info.state;
}
function intoAnimation(targetPoint) {
const worldP = targetPoint.getWorldPosition(new this.THREE.Vector3());
const positionOBj = this.camera.position;
const start = this.orbitControls.target;
this.intoPointAnimation = new this.TWEEN.Tween({
x: positionOBj.x,
y: positionOBj.y,
z: positionOBj.z,
xTarget: start.x,
yTarget: start.y,
zTarget: start.z,
});
this.intoPointAnimation.to(
{
x: worldP.x + 20,
y: worldP.y + 5,
z: worldP.z + 50,
xTarget: worldP.x,
yTarget: worldP.y,
zTarget: worldP.z,
},
600
);
this.intoPointAnimation.start();
this.intoPointAnimation.onUpdate((obj) => {
this.camera.position.set(obj.x, obj.y, obj.z);
this.camera.lookAt(obj.xTarget, obj.yTarget, obj.zTarget);
this.orbitControls.target.set(obj.xTarget, obj.yTarget, obj.zTarget);
});
this.intoPointAnimation.onComplete(() => {
this.camera.lookAt(worldP.x, worldP.y, worldP.z);
});
}

View File

@@ -0,0 +1,56 @@
export function handleRClick(targetPoint) {
this.clearTagsObj();
// 全局临时标记该选中的模型;
this.targetPoint = targetPoint;
const worldPosition = new this.THREE.Vector3();
//获取附着点的世界坐标系
targetPoint.getWorldPosition(worldPosition);
this._checkAnimation(worldPosition);
// 显示左键属性栏
this.tag3CSS2DObj.element.style.display = "block";
// 设置标签位置
this.tag3CSS2DObj.position.set(
worldPosition.x,
worldPosition.y,
worldPosition.z
);
this.tag3CSS2DObj.translateY(-15);
this.tag3CSS2DObj.translateX(15);
this.scene.add(this.tag3CSS2DObj);
intoAnimation.call(this);
}
function intoAnimation() {
const worldP = this.targetPoint.getWorldPosition(new this.THREE.Vector3());
const positionOBj = this.camera.position;
const start = this.orbitControls.target;
this.intoPointAnimation = new this.TWEEN.Tween({
x: positionOBj.x,
y: positionOBj.y,
z: positionOBj.z,
xTarget: start.x,
yTarget: start.y,
zTarget: start.z,
});
this.intoPointAnimation.to(
{
x: worldP.x + 20,
y: worldP.y + 20,
z: worldP.z + 50,
xTarget: worldP.x,
yTarget: worldP.y,
zTarget: worldP.z,
},
600
);
this.intoPointAnimation.start();
this.intoPointAnimation.onUpdate((obj) => {
this.camera.position.set(obj.x, obj.y, obj.z);
this.camera.lookAt(obj.xTarget, obj.yTarget, obj.zTarget);
this.orbitControls.target.set(obj.xTarget, obj.yTarget, obj.zTarget);
});
}

View File

@@ -0,0 +1,20 @@
export function removeDev() {
if (!this.targetPoint.hasDevice) {
alert("该附着点不存在设备");
return;
} else {
// 删除模型逻辑
const devId = this.targetPoint.info.devId;
const model = this.scene.getObjectById(devId);
this.scene.remove(model);
// 附着点可见
this.targetPoint.visible = true;
this.targetPoint.info = null;
// 按钮可否操作情况
this.addBtn.disabled = false;
this.removeBtn.disabled = true;
this.targetPoint.hasDevice = false;
}
}

View File

@@ -0,0 +1,29 @@
/**
*
* @param {*} Vec3 保存单前摄像机位置状态
*/
export function saveState() {
// 保存当前摄像机位置
if (this.viewSate && this.viewSate.isSave) return;
this.viewSate = {
position: this.camera.position.clone(),
isSave: true,
};
}
/**
* 恢复摄像机状态
*/
export function resetState() {
if (this.viewSate && this.viewSate.isSave) {
this.viewSate.isSave = false;
//恢复原始的镜头指向
this.camera.lookAt(0, 0, 0);
this.orbitControls.target.set(0, 0, 0);
//创建动画
this.viewSateResetAnimation = new this.TWEEN.Tween(this.camera.position);
this.viewSateResetAnimation.to(this.viewSate.position, 800);
this.viewSateResetAnimation.start();
//清空boxHelper
this.scene.remove(this.scene.getObjectByName("boxHelper"));
}
}