|
@@ -41,46 +41,18 @@ class FmXR {
|
|
|
}
|
|
|
|
|
|
addLight() {
|
|
|
- const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5);
|
|
|
- directionalLight.position.set(344, 690, 344);
|
|
|
- this.group?.add(directionalLight);
|
|
|
- directionalLight.target = this.group as THREE.Object3D;
|
|
|
-
|
|
|
- const pointLight2 = new THREE.PointLight(0xffeeee, 1, 300);
|
|
|
- pointLight2.position.set(-4, 10, 1.8);
|
|
|
- pointLight2.shadow.bias = 0.05;
|
|
|
- this.group?.add(pointLight2);
|
|
|
-
|
|
|
- const pointLight3 = new THREE.PointLight(0xffeeee, 1, 200);
|
|
|
- pointLight3.position.set(-0.5, -0.5, 0.75);
|
|
|
- pointLight3.shadow.bias = 0.05;
|
|
|
- this.group?.add(pointLight3);
|
|
|
-
|
|
|
- // const pointLight4 = new THREE.PointLight(0xffeeee, 1, 150);
|
|
|
- // pointLight4.position.set(4.3, 1, -0.9);
|
|
|
- // pointLight4.shadow.bias = 0.05;
|
|
|
- // this.group?.add(pointLight4);
|
|
|
-
|
|
|
- // const pointLight5 = new THREE.PointLight(0xffeeee, 1, 150);
|
|
|
- // pointLight5.position.set(4.3, 1, -0.9);
|
|
|
- // pointLight5.shadow.bias = 0.05;
|
|
|
- // this.group?.add(pointLight5);
|
|
|
-
|
|
|
- // const pointLight6 = new THREE.PointLight(0xffeeee, 1, 150);
|
|
|
- // pointLight6.position.set(-4.4, 1, -0.9);
|
|
|
- // pointLight6.shadow.bias = 0.05;
|
|
|
- // this.group?.add(pointLight6);
|
|
|
-
|
|
|
- // const pointLightHelper2 = new THREE.PointLightHelper(pointLight2, 1);
|
|
|
- // this.model.scene?.add(pointLightHelper2);
|
|
|
-
|
|
|
- // gui.add(pointLight2.position, 'x', -300, 300);
|
|
|
- // gui.add(pointLight2.position, 'y', -300, 300);
|
|
|
- // gui.add(pointLight2.position, 'z', -300, 300);
|
|
|
-
|
|
|
- // gui.add(pointLight3.position, 'x', -300, 300);
|
|
|
- // gui.add(pointLight3.position, 'y', -300, 300);
|
|
|
- // gui.add(pointLight3.position, 'z', -300, 300);
|
|
|
+ // const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5);
|
|
|
+ // directionalLight.position.set(344, 690, 344);
|
|
|
+ // this.group?.add(directionalLight);
|
|
|
+ // directionalLight.target = this.group as THREE.Object3D;
|
|
|
+ // const pointLight2 = new THREE.PointLight(0xffeeee, 1, 300);
|
|
|
+ // pointLight2.position.set(-4, 10, 1.8);
|
|
|
+ // pointLight2.shadow.bias = 0.05;
|
|
|
+ // this.group?.add(pointLight2);
|
|
|
+ // const pointLight3 = new THREE.PointLight(0xffeeee, 1, 200);
|
|
|
+ // pointLight3.position.set(-0.5, -0.5, 0.75);
|
|
|
+ // pointLight3.shadow.bias = 0.05;
|
|
|
+ // this.group?.add(pointLight3);
|
|
|
}
|
|
|
// 重置摄像头
|
|
|
resetCamera() {
|
|
@@ -106,7 +78,7 @@ class FmXR {
|
|
|
color: '#00FF00',
|
|
|
strokeStyle: '#007400',
|
|
|
x: 120,
|
|
|
- y: 100,
|
|
|
+ y: 95,
|
|
|
},
|
|
|
{
|
|
|
text: `净通行高度(m):`,
|
|
@@ -162,7 +134,7 @@ class FmXR {
|
|
|
color: '#00FF00',
|
|
|
strokeStyle: '#007400',
|
|
|
x: History_Type['type'] == 'remote' ? 80 : 20,
|
|
|
- y: 325,
|
|
|
+ y: 330,
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -184,8 +156,8 @@ class FmXR {
|
|
|
const planeGeometry = new THREE.PlaneGeometry(526, 346); // 平面3维几何体PlaneGeometry
|
|
|
const planeMesh = new THREE.Mesh(planeGeometry, textMaterial);
|
|
|
planeMesh.name = 'monitorText';
|
|
|
- planeMesh.scale.set(0.002, 0.002, 0.002);
|
|
|
- planeMesh.position.set(3.685, 0.09, -0.41);
|
|
|
+ planeMesh.scale.set(0.0018, 0.0015, 0.0015);
|
|
|
+ planeMesh.position.set(2.975, 0.46, -0.33);
|
|
|
this.group.add(planeMesh);
|
|
|
}
|
|
|
textMap.dispose();
|
|
@@ -284,16 +256,16 @@ class FmXR {
|
|
|
|
|
|
/* 提取风门序列帧,初始化前后门动画 */
|
|
|
initAnimation() {
|
|
|
- const fmGroup = this.group?.getObjectByName('fmXr-door');
|
|
|
+ const fmGroup = this.group?.getObjectByName('fmXr-all');
|
|
|
if (fmGroup) {
|
|
|
const tracks = fmGroup.animations[0].tracks;
|
|
|
const fontTracks: any[] = [],
|
|
|
backTracks: any[] = [];
|
|
|
for (let i = 0; i < tracks.length; i++) {
|
|
|
const track = tracks[i];
|
|
|
- if (track.name.startsWith('qianmen')) {
|
|
|
+ if (track.name.startsWith('Men_1')) {
|
|
|
fontTracks.push(track);
|
|
|
- } else if (track.name.startsWith('houmen')) {
|
|
|
+ } else if (track.name.startsWith('Men_2')) {
|
|
|
backTracks.push(track);
|
|
|
}
|
|
|
}
|
|
@@ -335,7 +307,7 @@ class FmXR {
|
|
|
handler = () => {
|
|
|
this.clipActionArr.frontDoor.paused = true;
|
|
|
this.clipActionArr.frontDoor.reset();
|
|
|
- this.clipActionArr.frontDoor.time = 1.2;
|
|
|
+ this.clipActionArr.frontDoor.time = 0.5;
|
|
|
this.clipActionArr.frontDoor.timeScale = timeScale;
|
|
|
// this.clipActionArr.frontDoor.clampWhenFinished = true;
|
|
|
this.clipActionArr.frontDoor.play();
|
|
@@ -364,7 +336,7 @@ class FmXR {
|
|
|
handler = () => {
|
|
|
this.clipActionArr.backDoor.paused = true;
|
|
|
this.clipActionArr.backDoor.reset();
|
|
|
- this.clipActionArr.backDoor.time = 1.2;
|
|
|
+ this.clipActionArr.backDoor.time = 0.5;
|
|
|
this.clipActionArr.backDoor.timeScale = timeScale;
|
|
|
// this.clipActionArr.backDoor.clampWhenFinished = true;
|
|
|
this.clipActionArr.backDoor.play();
|
|
@@ -514,10 +486,17 @@ class FmXR {
|
|
|
}
|
|
|
|
|
|
setMeshHide() {
|
|
|
- const wire = this.group.getObjectByName('fmXr-wire');
|
|
|
- if (wire) {
|
|
|
- if (wire.getObjectByName('对象192')) wire.getObjectByName('对象192').visible = false;
|
|
|
- if (wire.getObjectByName('Box595')) wire.getObjectByName('Box595').visible = false;
|
|
|
+ const doorWire = this.group.getObjectByName('JuXingHangDao');
|
|
|
+ if (doorWire) {
|
|
|
+ this.backDamperOpenMesh = doorWire.getObjectByName('Dampler_open_1');
|
|
|
+ if (this.backDamperOpenMesh) this.backDamperOpenMesh.visible = false;
|
|
|
+ this.backDamperClosedMesh = doorWire.getObjectByName('Damper_Closed_1');
|
|
|
+ if (this.backDamperClosedMesh) this.backDamperClosedMesh.visible = true;
|
|
|
+
|
|
|
+ this.frontDamperOpenMesh = doorWire.getObjectByName('Damper_Open_2');
|
|
|
+ if (this.frontDamperOpenMesh) this.frontDamperOpenMesh.visible = false;
|
|
|
+ this.frontDamperClosedMesh = doorWire.getObjectByName('Damper_Closed_2');
|
|
|
+ if (this.frontDamperClosedMesh) this.frontDamperClosedMesh.visible = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -525,13 +504,17 @@ class FmXR {
|
|
|
this.group = new THREE.Object3D();
|
|
|
this.group.name = this.modelName;
|
|
|
return new Promise((resolve) => {
|
|
|
- this.model.setGLTFModel(['fmXr-door', 'fmXr-wire', 'fmXr-wall'], this.group).then(() => {
|
|
|
+ // 小史行人风门 'fmXr-door', 'fmXr-wire', 'fmXr-wall
|
|
|
+ // this.model.setGLTFModel(['fmXr-door', 'fmXr-wire', 'fmXr-wall'], this.group).then(() => {
|
|
|
+ // 白工行人风门 'fmXr-all'
|
|
|
+ this.model.setGLTFModel(['fmXr-all'], this.group, true).then(() => {
|
|
|
+ console.log(this.group);
|
|
|
this.setModalPosition();
|
|
|
- // 初始化左右摇摆动画;
|
|
|
+ // // 初始化左右摇摆动画;
|
|
|
this.initAnimation();
|
|
|
- // this.drawHots();
|
|
|
+ // // this.drawHots();
|
|
|
this.addLight();
|
|
|
- // this.deviceDetailCard();
|
|
|
+ // // this.deviceDetailCard();
|
|
|
this.model.animate();
|
|
|
this.setMeshHide();
|
|
|
resolve(this.model);
|