|
@@ -3,7 +3,6 @@
|
|
import CourseChapter3dMain from '@/components/student/CourseChapter3dMain.vue';
|
|
import CourseChapter3dMain from '@/components/student/CourseChapter3dMain.vue';
|
|
import { threeWorld } from "@/stores/threeWorld.ts";
|
|
import { threeWorld } from "@/stores/threeWorld.ts";
|
|
import { courseChapter3dShow } from "@/stores/courseChapter3dShow.ts";
|
|
import { courseChapter3dShow } from "@/stores/courseChapter3dShow.ts";
|
|
-import { RenderEvent } from "@/components/student/event/RenderEvent.ts";
|
|
|
|
import { ref, watch } from "vue";
|
|
import { ref, watch } from "vue";
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -32,8 +31,7 @@ const emits = defineEmits([
|
|
// );
|
|
// );
|
|
// }, 1000);
|
|
// }, 1000);
|
|
|
|
|
|
-// 3d渲染帧事件处理
|
|
|
|
-let objRenderEvent = new RenderEvent();
|
|
|
|
|
|
+
|
|
|
|
|
|
// 【开发的时候】3d场景,iframe地址
|
|
// 【开发的时候】3d场景,iframe地址
|
|
let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi";
|
|
let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi";
|
|
@@ -233,31 +231,6 @@ const carMoveSpeedInitEvent = () => {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * 初始化 3d渲染帧事件处理
|
|
|
|
- */
|
|
|
|
-const objRenderEventInit = () => {
|
|
|
|
-
|
|
|
|
- // @ts-ignore
|
|
|
|
- objRenderEvent.BABYLON = threeWorld().obj.newIframe.objIframe.BABYLON;
|
|
|
|
- // @ts-ignore
|
|
|
|
- objRenderEvent.ChengGuangYuanJing = threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing;
|
|
|
|
- // @ts-ignore
|
|
|
|
- objRenderEvent.objIframe = threeWorld().obj.newIframe.objIframe;
|
|
|
|
-
|
|
|
|
- // 设置回调方法
|
|
|
|
- objRenderEvent.tipsBtnsUpOpenEventCallback = function(open : Boolean) {
|
|
|
|
- tipsBtnsUpOpenEvent(open);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- objRenderEvent.tipsBtnsDownOpenEventCallback = function(open : Boolean) {
|
|
|
|
- tipsBtnsDownOpenEvent(open);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
setInterval(function() {
|
|
setInterval(function() {
|
|
|
|
|
|
// 如果没有加载完成,则不触发后面的逻辑
|
|
// 如果没有加载完成,则不触发后面的逻辑
|
|
@@ -424,410 +397,6 @@ const threeEvent = () => {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-// 是否因为,移动后停止了
|
|
|
|
-let moveToStop = true;
|
|
|
|
-
|
|
|
|
-// 控制播放超速声音的时间戳,不需要太频繁播放声音
|
|
|
|
-let speedingMusicPlayTime = 0;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * 通过车的不同状态,控制前进还是倒退的逻辑
|
|
|
|
- */
|
|
|
|
-const carStatusEvent = () => {
|
|
|
|
-
|
|
|
|
- // console.log(
|
|
|
|
-
|
|
|
|
- // "carStatusEvent = () => {",
|
|
|
|
- // courseChapter3dShow().show.carStatus,
|
|
|
|
- // courseChapter3dShow().show.carMoveLv,
|
|
|
|
- // courseChapter3dShow().show.carMoveSpeed,
|
|
|
|
-
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 超速提示
|
|
|
|
- courseChapter3dShow().show.showCarEyeViewBoolSpeeding = courseChapter3dShow().show.carMoveLv >= 8 ? true : false;
|
|
|
|
-
|
|
|
|
- var thisTime = new Date().getTime();
|
|
|
|
-
|
|
|
|
- if (
|
|
|
|
- // 如果超速
|
|
|
|
- courseChapter3dShow().show.showCarEyeViewBoolSpeeding == true
|
|
|
|
- && (thisTime - speedingMusicPlayTime) >= 3500
|
|
|
|
- ) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 得到最顶部距离的值
|
|
|
|
- let showCarEyeDistanceMax = (pipelineProblemsArrayEventList.length - 2 - distanceXBoolSum) * 29.94;
|
|
|
|
- showCarEyeDistanceMax -= (29.94 / 2);
|
|
|
|
-
|
|
|
|
- // 由于多出了个出生点与坐标点的距离差
|
|
|
|
- showCarEyeDistanceMax += courseChapter3dShow().show.lineDistance;
|
|
|
|
-
|
|
|
|
- // console.log(
|
|
|
|
- // " 得到最顶部距离的值 showCarEyeDistanceMax ",
|
|
|
|
- // showCarEyeDistanceMax
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
- // console.log(
|
|
|
|
- // "距离判断是否到最顶位置",
|
|
|
|
- // // pipelineProblemsArrayEventList.length,
|
|
|
|
- // // showCarEyeDistanceMax,
|
|
|
|
- // // courseChapter3dShow().show.showCarEyeDistance,
|
|
|
|
- // // courseChapter3dShow().show.birthPointRecord,
|
|
|
|
- // // courseChapter3dShow().show.carPointRecord,
|
|
|
|
-
|
|
|
|
- // // courseChapter3dShow().show.birthPointRecord.x,
|
|
|
|
- // // courseChapter3dShow().show.carPointRecord.x,
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
- if (
|
|
|
|
- // 前视
|
|
|
|
- courseChapter3dShow().show.lookAfterOrFront == "front"
|
|
|
|
- // && courseChapter3dShow().show.showCarEyeDistance >= 476
|
|
|
|
- && courseChapter3dShow().show.showCarEyeDistance >= showCarEyeDistanceMax
|
|
|
|
- ) {
|
|
|
|
- courseChapter3dShow().show.showCarEyeViewBoolSpeeding2 = true;
|
|
|
|
- } else if (
|
|
|
|
- // 后视
|
|
|
|
- courseChapter3dShow().show.lookAfterOrFront == "after"
|
|
|
|
- // && courseChapter3dShow().show.showCarEyeDistance <= 7.3
|
|
|
|
- && courseChapter3dShow().show.showCarEyeDistance <= 1
|
|
|
|
- ) {
|
|
|
|
- courseChapter3dShow().show.showCarEyeViewBoolSpeeding2 = true;
|
|
|
|
- } else {
|
|
|
|
- courseChapter3dShow().show.showCarEyeViewBoolSpeeding2 = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 如果是停止移动了
|
|
|
|
- if (courseChapter3dShow().show.carStatus == "stopMove") {
|
|
|
|
-
|
|
|
|
- // 此时说明要停止移动了
|
|
|
|
- if (moveToStop == false) {
|
|
|
|
-
|
|
|
|
- // 触发键盘的停止逻辑
|
|
|
|
-
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.EventMoveRole.find().moveState = 0;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolW = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolA = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolS = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolD = false;
|
|
|
|
-
|
|
|
|
- // @ts-ignore 恢复初始的移动速度
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.Role.find().speed = courseChapter3dShow().show.carMoveSpeed;
|
|
|
|
-
|
|
|
|
- moveToStop = true;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- moveToStop = false;
|
|
|
|
-
|
|
|
|
- // 根据不同的挡位,控制合理的移动速度
|
|
|
|
- let speed = courseChapter3dShow().show.carMoveSpeed
|
|
|
|
- * (courseChapter3dShow().show.carMoveLv / courseChapter3dShow().show.carMoveSpeedMultipleMax * 1);
|
|
|
|
-
|
|
|
|
- // // @ts-ignore 更新目标角色的参数
|
|
|
|
- // threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.Role.find().modelRoleCreateOrUpdate(
|
|
|
|
- // // @ts-ignore
|
|
|
|
- // threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.Role.find().roleCode,
|
|
|
|
- // {
|
|
|
|
- // "addMoveSpeed" : courseChapter3dShow().show.carMoveSpeed - speed,
|
|
|
|
- // "addMoveSpeedSecond" : 3,
|
|
|
|
- // "addMoveSpeedSecondTimeUpdate" : new Date().getTime()
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.Role.find().speed = speed;
|
|
|
|
-
|
|
|
|
- // 前进
|
|
|
|
- if (courseChapter3dShow().show.carStatus == "forwardMove") {
|
|
|
|
-
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.EventMoveRole.find().moveState = 1;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolW = true;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolA = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolS = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolD = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 后退
|
|
|
|
- if (courseChapter3dShow().show.carStatus == "retreatMove") {
|
|
|
|
-
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.EventMoveRole.find().moveState = 1;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolS = true;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolA = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolW = false;
|
|
|
|
- // @ts-ignore
|
|
|
|
- threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.CommonEvent.find().boolD = false;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // console.log(
|
|
|
|
- // " carStatusEvent = () => { 移动速度 ",
|
|
|
|
- // speed
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * 通过每帧的方式来控制变化的
|
|
|
|
- * courseChapter3dShow().show.carCameraAlphaNew
|
|
|
|
- * courseChapter3dShow().show.carCameraBetaNew
|
|
|
|
- * …… 左右旋转,上下旋转,镜头放大缩小
|
|
|
|
- * 等逻辑
|
|
|
|
- * 跟 车机器人相关的逻辑
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
-const carCameraAlphaAndBetaNew = () => {
|
|
|
|
-
|
|
|
|
- // 可旋转角度
|
|
|
|
- let mathPiMax = Math.PI / 2;
|
|
|
|
- let mathPiMax2 = Math.PI / 10;
|
|
|
|
-
|
|
|
|
- // fov每次变化参数
|
|
|
|
- let fovUpdate = 0.2;
|
|
|
|
-
|
|
|
|
- // fov最大值
|
|
|
|
- let fovMax = 1.6;
|
|
|
|
- // fov最小值
|
|
|
|
- let fovMin = 0.4;
|
|
|
|
-
|
|
|
|
- // 帧数
|
|
|
|
- let fps = 75;
|
|
|
|
- // 完成秒数
|
|
|
|
- let secondFps = fps * 1.5;
|
|
|
|
- let secondFps2 = fps * 1.5;
|
|
|
|
- let secondFps3 = fps * 3;
|
|
|
|
-
|
|
|
|
- // y轴支架每次变化的参数
|
|
|
|
- let yUpdate = 1 / 2;
|
|
|
|
- // let yUpdate = 1;
|
|
|
|
-
|
|
|
|
- // y轴支架最大值
|
|
|
|
- let yMax = 1.5;
|
|
|
|
- // y轴支架最小值
|
|
|
|
- let yMin = 0;
|
|
|
|
-
|
|
|
|
- // 车速
|
|
|
|
- // let carMoveLvProportionMax = 100 * 50;
|
|
|
|
- let carMoveLvProportionMax = 100;
|
|
|
|
-
|
|
|
|
- // 车相机左右旋转
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlpha != courseChapter3dShow().show.carCameraAlphaNew) {
|
|
|
|
-
|
|
|
|
- let distance = courseChapter3dShow().show.carCameraAlpha - courseChapter3dShow().show.carCameraAlphaNew;
|
|
|
|
- if (distance > 0) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaNew += mathPiMax / secondFps3;
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaNew >= courseChapter3dShow().show.carCameraAlpha) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaNew = courseChapter3dShow().show.carCameraAlpha;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaNew -= mathPiMax / secondFps3;
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaNew <= courseChapter3dShow().show.carCameraAlpha) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaNew = courseChapter3dShow().show.carCameraAlpha;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaNew >= mathPiMax) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaNew = mathPiMax;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaNew <= -mathPiMax) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaNew = -mathPiMax;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 车相机上下旋转
|
|
|
|
- if (courseChapter3dShow().show.carCameraBeta != courseChapter3dShow().show.carCameraBetaNew) {
|
|
|
|
-
|
|
|
|
- let distance = courseChapter3dShow().show.carCameraBeta - courseChapter3dShow().show.carCameraBetaNew;
|
|
|
|
- if (distance > 0) {
|
|
|
|
- courseChapter3dShow().show.carCameraBetaNew += mathPiMax / secondFps3;
|
|
|
|
- if (courseChapter3dShow().show.carCameraBetaNew >= courseChapter3dShow().show.carCameraBeta) {
|
|
|
|
- courseChapter3dShow().show.carCameraBetaNew = courseChapter3dShow().show.carCameraBeta;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- courseChapter3dShow().show.carCameraBetaNew -= mathPiMax / secondFps3;
|
|
|
|
- if (courseChapter3dShow().show.carCameraBetaNew <= courseChapter3dShow().show.carCameraBeta) {
|
|
|
|
- courseChapter3dShow().show.carCameraBetaNew = courseChapter3dShow().show.carCameraBeta;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraBetaNew >= mathPiMax) {
|
|
|
|
- courseChapter3dShow().show.carCameraBetaNew = mathPiMax;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraBetaNew <= -mathPiMax) {
|
|
|
|
- courseChapter3dShow().show.carCameraBetaNew = -mathPiMax;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 车左右转弯
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaWheel != courseChapter3dShow().show.carCameraAlphaWheelNew) {
|
|
|
|
-
|
|
|
|
- let distance = courseChapter3dShow().show.carCameraAlphaWheel - courseChapter3dShow().show.carCameraAlphaWheelNew;
|
|
|
|
- if (distance > 0) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaWheelNew += mathPiMax2 / secondFps2;
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaWheelNew >= courseChapter3dShow().show.carCameraAlphaWheel) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaWheelNew = courseChapter3dShow().show.carCameraAlphaWheel;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaWheelNew -= mathPiMax2 / secondFps2;
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaWheelNew <= courseChapter3dShow().show.carCameraAlphaWheel) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaWheelNew = courseChapter3dShow().show.carCameraAlphaWheel;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaWheelNew >= mathPiMax2) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaWheelNew = mathPiMax2;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraAlphaWheelNew <= -mathPiMax2) {
|
|
|
|
- courseChapter3dShow().show.carCameraAlphaWheelNew = -mathPiMax2;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 车相机是否放大
|
|
|
|
- if (courseChapter3dShow().show.carCameraFov != courseChapter3dShow().show.carCameraFovNew) {
|
|
|
|
-
|
|
|
|
- let distance = courseChapter3dShow().show.carCameraFov - courseChapter3dShow().show.carCameraFovNew;
|
|
|
|
- if (distance > 0) {
|
|
|
|
- courseChapter3dShow().show.carCameraFovNew += fovUpdate / secondFps;
|
|
|
|
- if (courseChapter3dShow().show.carCameraFovNew >= courseChapter3dShow().show.carCameraFov) {
|
|
|
|
- courseChapter3dShow().show.carCameraFovNew = courseChapter3dShow().show.carCameraFov;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- courseChapter3dShow().show.carCameraFovNew -= fovUpdate / secondFps;
|
|
|
|
- if (courseChapter3dShow().show.carCameraFovNew <= courseChapter3dShow().show.carCameraFov) {
|
|
|
|
- courseChapter3dShow().show.carCameraFovNew = courseChapter3dShow().show.carCameraFov;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraFovNew >= fovMax) {
|
|
|
|
- courseChapter3dShow().show.carCameraFovNew = fovMax;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraFovNew <= fovMin) {
|
|
|
|
- courseChapter3dShow().show.carCameraFovNew = fovMin;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 支架上升还是下降
|
|
|
|
- if (courseChapter3dShow().show.carCameraPositionY != courseChapter3dShow().show.carCameraPositionYNew) {
|
|
|
|
-
|
|
|
|
- let distance = courseChapter3dShow().show.carCameraPositionY - courseChapter3dShow().show.carCameraPositionYNew;
|
|
|
|
- if (distance > 0) {
|
|
|
|
-
|
|
|
|
- courseChapter3dShow().show.carCameraPositionYNew += yUpdate / secondFps;
|
|
|
|
- if (courseChapter3dShow().show.carCameraPositionYNew >= courseChapter3dShow().show.carCameraPositionY) {
|
|
|
|
- courseChapter3dShow().show.carCameraPositionYNew = courseChapter3dShow().show.carCameraPositionY;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- courseChapter3dShow().show.carCameraPositionYNew -= yUpdate / secondFps;
|
|
|
|
- if (courseChapter3dShow().show.carCameraPositionYNew <= courseChapter3dShow().show.carCameraPositionY) {
|
|
|
|
- courseChapter3dShow().show.carCameraPositionYNew = courseChapter3dShow().show.carCameraPositionY;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraPositionYNew >= yMax) {
|
|
|
|
- courseChapter3dShow().show.carCameraPositionYNew = yMax;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carCameraPositionYNew <= yMin) {
|
|
|
|
- courseChapter3dShow().show.carCameraPositionYNew = yMin;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 车速变动百分比
|
|
|
|
- if (courseChapter3dShow().show.carMoveLvProportion != courseChapter3dShow().show.carMoveLvProportionNew) {
|
|
|
|
-
|
|
|
|
- let distance = courseChapter3dShow().show.carMoveLvProportion - courseChapter3dShow().show.carMoveLvProportionNew;
|
|
|
|
- if (distance > 0) {
|
|
|
|
-
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionNew += carMoveLvProportionMax / secondFps;
|
|
|
|
- if (courseChapter3dShow().show.carMoveLvProportionNew >= courseChapter3dShow().show.carMoveLvProportion) {
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionNew = courseChapter3dShow().show.carMoveLvProportion;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionNew -= carMoveLvProportionMax / secondFps;
|
|
|
|
- if (courseChapter3dShow().show.carMoveLvProportionNew <= courseChapter3dShow().show.carMoveLvProportion) {
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionNew = courseChapter3dShow().show.carMoveLvProportion;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // if (courseChapter3dShow().show.carMoveLvProportionNew >= 100) {
|
|
|
|
- // courseChapter3dShow().show.carMoveLvProportionNew = 100;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // if (courseChapter3dShow().show.carMoveLvProportionNew <= 0) {
|
|
|
|
- // courseChapter3dShow().show.carMoveLvProportionNew = 0;
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carMoveLvProportionNew >= 96) {
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionNew = 96;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carMoveLvProportionNew <= 3) {
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionNew = 3;
|
|
|
|
- courseChapter3dShow().show.bottomSpeedImgTopSptWidth = '0rem';
|
|
|
|
- } else {
|
|
|
|
- // courseChapter3dShow().show.bottomSpeedImgTopSptWidth = '2.6rem';
|
|
|
|
- courseChapter3dShow().show.bottomSpeedImgTopSptWidth = '2rem';
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 最大的例子所在位置
|
|
|
|
- let topRemMax = 6;
|
|
|
|
- // let topRemMax = 8;
|
|
|
|
-
|
|
|
|
- if (courseChapter3dShow().show.carMoveLvProportionNew <= 50) {
|
|
|
|
-
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionTopNew = -(topRemMax * courseChapter3dShow().show.carMoveLvProportionNew / 100);
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
-
|
|
|
|
- courseChapter3dShow().show.carMoveLvProportionTopNew = -(topRemMax * ( 100 - courseChapter3dShow().show.carMoveLvProportionNew) / 100);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 3d加载完成优先切换到默认的视角
|
|
* 3d加载完成优先切换到默认的视角
|
|
*/
|
|
*/
|
|
@@ -864,15 +433,7 @@ const initScene = () => {
|
|
* 将所有设置为地面的,改为不设置为地面
|
|
* 将所有设置为地面的,改为不设置为地面
|
|
*/
|
|
*/
|
|
const groundNoRemove = () => {
|
|
const groundNoRemove = () => {
|
|
-
|
|
|
|
- // // 临时测试用的,后续正式,在注释掉
|
|
|
|
- // return;
|
|
|
|
-
|
|
|
|
- // console.log(
|
|
|
|
- // "groundNoRemove = () => {",
|
|
|
|
- // threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.ModelObjEdit.find().meshListIdToJson
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
|
|
+
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
for (const key in threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.ModelObjEdit.find().meshListIdToJson) {
|
|
for (const key in threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.ModelObjEdit.find().meshListIdToJson) {
|
|
|
|
|
|
@@ -910,7 +471,6 @@ const groundNoRemove = () => {
|
|
|
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.Role.find().isGroundList = {};
|
|
threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.Role.find().isGroundList = {};
|
|
-
|
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.ModelObjEdit.find().myIsGroundConfigNum = 0;
|
|
threeWorld().obj.newIframe.objIframe.ChengGuangYuanJing.ModelObjEdit.find().myIsGroundConfigNum = 0;
|
|
|
|
|
|
@@ -947,16 +507,11 @@ const typeEvent = (type : any) => {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-// let wearYes = new URL("./../../assets/3dmodel/body.webp", import.meta.url).href;
|
|
|
|
-let wearYes = new URL("./../../assets/3dmodel/04_M_Construction_d_2.webp", import.meta.url).href;
|
|
|
|
-let wearNo = new URL("./../../assets/3dmodel/04_M_Construction_d_1.webp", import.meta.url).href;
|
|
|
|
-
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
|
|
|
<!-- 3d课程配置:{{ props.config }} -->
|
|
<!-- 3d课程配置:{{ props.config }} -->
|
|
-
|
|
|
|
<img v-if="courseChapter3dShow().show.threeWorldMask == true" class="threeWorldMask" src="../../assets/student/mask.webp" />
|
|
<img v-if="courseChapter3dShow().show.threeWorldMask == true" class="threeWorldMask" src="../../assets/student/mask.webp" />
|
|
|
|
|
|
<CourseChapter3dMain
|
|
<CourseChapter3dMain
|