diff --git a/src/jlmap3d/lesson3d/lesson3dplayer.js b/src/jlmap3d/lesson3d/lesson3dplayer.js index 1a84b8f0b..bb7e36e89 100644 --- a/src/jlmap3d/lesson3d/lesson3dplayer.js +++ b/src/jlmap3d/lesson3d/lesson3dplayer.js @@ -104,13 +104,17 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) { // console.log(nowRole); // console.log(lessonData.lessonProgress[lessonIndex].roleName); if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){ - controlManager.initControlMode(lessonIndex); + assetModelManager.changeSceneGroup(scope.nowSceneType); controlManager.initRoleMode(true,nowRole); + controlManager.initControlMode(lessonIndex); controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,true,assetModelManager.lessonTriggerList[scope.nowSceneType]); - }else{ - controlManager.initControlMode(lessonIndex); + } else{ + if(lessonData.lessonProgress[lessonIndex].roleName == 'kong'){ + assetModelManager.changeSceneGroup(scope.nowSceneType); controlManager.initRoleMode(false,nowRole); + } controlManager.initRoleMode(false,nowRole); + controlManager.initControlMode(lessonIndex); controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,false,assetModelManager.lessonTriggerList[scope.nowSceneType]); } diff --git a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js index 8c430e5a6..8118cd0ec 100644 --- a/src/jlmap3d/lesson3d/manager/assetmodelmanager.js +++ b/src/jlmap3d/lesson3d/manager/assetmodelmanager.js @@ -13,6 +13,7 @@ export function AssetModelManager(editor,scene) { groupList["standstation"] = new THREE.Group(); groupList["stopstation"] = new THREE.Group(); groupList["device"] = new THREE.Group(); + groupList["occ"] = new THREE.Group(); groupList["xl"] = new THREE.Group(); groupList["dc"] = new THREE.Group(); @@ -90,15 +91,36 @@ export function AssetModelManager(editor,scene) { sceneType:"stopstation", }; + scope.staticAsset['occ'] = { + modelId:'occ', + packageName:"occ大厅", + url:"/MODEL/2021-09-02/210-32471.FBX", + mesh:"", + assetType:'onlineasset', + isUse:true, + resourceType:"三维课程", + sceneType:"occ", + }; //场景中可触发事件模型 this.lessonTriggerList = []; scope.lessonTriggerList["standstation"] = []; scope.lessonTriggerList["stopstation"] = []; scope.lessonTriggerList["device"] = []; + scope.lessonTriggerList["occ"] = []; scope.lessonTriggerList["xl"] = []; scope.lessonTriggerList["dc"] = []; + this.changeSceneGroup = function(groupType){ + // console.log(groupType); + // console.log(editor.nowSceneType); + // console.log(scope.lessonTriggerList[editor.nowSceneType]); + editor.nowSceneType = groupType; + scene.remove(this.otherModel); + this.otherModel = groupList[groupType]; + scene.add(this.otherModel); + updateTriggerList(scope.lessonTriggerList[editor.nowSceneType]); + } //加载课程资源 this.lessonAssetsLoader = function(lessonData){ let initlist = []; diff --git a/src/jlmap3d/lesson3d/manager/controlmanager.js b/src/jlmap3d/lesson3d/manager/controlmanager.js index 4e64c1665..81f90cca5 100644 --- a/src/jlmap3d/lesson3d/manager/controlmanager.js +++ b/src/jlmap3d/lesson3d/manager/controlmanager.js @@ -84,7 +84,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { let loaderObj = new THREE.OBJLoader(); - let standstationPZ,stopstationPZ; + let standstationPZ,stopstationPZ,occPZ; // load a resource loaderObj.load( JL3D_LOCAL_STATIC+'/lesson3d/standstationPZ.obj', @@ -110,6 +110,19 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { console.log( 'An error happened' ); } ); + loaderObj.load( + JL3D_LOCAL_STATIC+'/lesson3d/occPZ.obj', + function ( object ) { + occPZ = object; + }, + function ( xhr ) { + console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' ); + }, + function ( error ) { + console.log( 'An error happened' ); + } + ); + this.initRoleMode = function(rMode,role){ roleMode = rMode; nowRole = role; @@ -215,7 +228,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { this.init = function(actions){ - worldOctree.fromGraphNode( standstationPZ ); + // worldOctree.fromGraphNode( standstationPZ ); actionList = actions; } @@ -279,6 +292,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { } }else if(raycasterBoxs[i].type == "urgeSwitch"){ + console.log(raycasterBoxs[i]); if(raycasterBoxs[i].action.status == "02"){ raycasterBoxs[i].action.status = "01"; raycasterBoxs[i].action.action.stop(); @@ -485,16 +499,23 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { } this.initControlMode = function(nowLessonIndex){ - console.log(lessonData.lessonProgress[nowLessonIndex].progressScene); + // console.log(lessonData.lessonProgress[nowLessonIndex].progressScene); if(lessonData.lessonProgress[nowLessonIndex].progressScene == "standstation"){ worldOctree.fromGraphNode( standstationPZ ); }else if(lessonData.lessonProgress[nowLessonIndex].progressScene == "stopstation"){ worldOctree.fromGraphNode( stopstationPZ ); + }else if(lessonData.lessonProgress[nowLessonIndex].progressScene == "occ"){ + worldOctree.fromGraphNode( occPZ ); } - scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode; - if(lessonData.lessonProgress[nowLessonIndex].changeCamera == true){ + + + + if((lessonData.lessonProgress[nowLessonIndex].changeCamera == true && lessonData.lessonProgress[nowLessonIndex].roleName == nowRole) || nowLessonIndex == 0 || lessonData.lessonProgress[nowLessonIndex].roleName== 'kong'){ + console.log(scope.controlMode); + + scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode; if(scope.controlMode == "free" || scope.controlMode == "non"){ scope.nowCamera = orbitCamera; oribitControl.enabled = true; @@ -537,11 +558,11 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) { // eventBoxs = newEventBoxs; raycasterBoxs = []; roleMode = rMode; - console.log("---------changeIndex--------"); - console.log(actions); - console.log(roleMode); - console.log(eventTrigger); - console.log("----------------------------"); + // console.log("---------changeIndex--------"); + // console.log(actions); + // console.log(roleMode); + // console.log(eventTrigger); + // console.log("----------------------------"); if(actions.length>0 && roleMode){ diff --git a/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js b/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js index 3250ebb3c..6feedfdea 100644 --- a/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js +++ b/src/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js @@ -102,7 +102,7 @@ export function AssetModelManager(editor,scene) { scope.staticAsset['occ'] = { modelId:'occ', packageName:"occ大厅", - url:"/MODEL/2021-08-23/203-65635.FBX", + url:"/MODEL/2021-09-02/210-32471.FBX", mesh:"", assetType:'onlineasset', isUse:true, diff --git a/src/views/jlmap3d/lesson3dedit/component/property.vue b/src/views/jlmap3d/lesson3dedit/component/property.vue index 4dec42bcd..31041e13d 100644 --- a/src/views/jlmap3d/lesson3dedit/component/property.vue +++ b/src/views/jlmap3d/lesson3dedit/component/property.vue @@ -216,11 +216,12 @@ - + + diff --git a/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue b/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue index 9f06ac12a..92b5e10ef 100644 --- a/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue +++ b/src/views/jlmap3d/lesson3dplayer/lesson3dplayer.vue @@ -45,22 +45,23 @@ + :nowRole ='nowRole' + v-show="lessonTools[0].isShow" + @jumpEvent="jumpEvent"> + v-show="lessonTools[1].isShow"> + v-show="lessonTools[2].isShow && !examMode" + > + v-show="lessonTools[3].isShow"> @@ -273,7 +274,7 @@ this.selectJobList = loadData.setup.checkedRole; this.jobPaneData.dataList = loadData.toolJobPane; this.$refs.jobpane.initJobList(this.jobPaneData.dataList); - + console.log(loadData.lessonTools); this.lessonTools = loadData.lessonTools; this.lessonData.loadLessonProgress(loadData.lessonProgress); diff --git a/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue b/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue index e52e8903a..b2556c520 100644 --- a/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue +++ b/src/views/jlmap3d/lesson3dplayer/tools/explainpane.vue @@ -3,19 +3,16 @@ v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex]" :style="{'background-image': 'url('+lessonbg+')'}"> - -
+
+ 操作提示 +
+
{{lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.text}}
-
+