This commit is contained in:
fan 2021-11-15 09:41:17 +08:00
commit ab87adabb3
12 changed files with 85 additions and 21 deletions

View File

@ -53,6 +53,10 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
// let fire = new Fire();
// fire.init(scene);
var audionext = JL3D_LOCAL_STATIC+'/lesson3d/audio/next.wav';
audionext = new Audio(audionext);
let animateManager = new AnimateManager();
@ -65,7 +69,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
scope.nowSceneType = lessonData.lessonProgress[0].progressScene;
animateManager.initAnimation(assetModelManager);
console.log(lessonData.trainDeviceData);
// console.log(lessonData.trainDeviceData);
controlManager.init(animateManager.actions,assetModelManager,lessonData.trainDeviceData);
startLesson();
@ -88,6 +92,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
}else if(actionType == "changeIndex"){
actionModel.visible = true;
assetModelManager.otherModel.add(actionModel);
audionext.play();
}
}
@ -98,14 +103,13 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
this.changeIndex = function(nowIndex){
if(nowIndex!=0){
audionext.play();
oldIndex = lessonIndex;
if(lessonData.lessonProgress[oldIndex].roleName == nowRole){
updateExam(lessonData.lessonProgress[oldIndex],oldIndex);
}
}
lessonIndex = nowIndex;
// console.log(nowIndex);

View File

@ -22,8 +22,8 @@ export function AnimateManager() {
for(let i=0;i <assetModelManager.staticAsset[k].mesh.children.length;i++){
if(assetModelManager.staticAsset[k].mesh.children[i].type == "Group"){
assetModelManager.staticAsset[k].mesh.children[i].animations = [];
//
// console.log(assetModelManager.staticAsset[k].mesh.children[i]);
//console.log(assetModelManager.staticAsset[k].mesh);
assetModelManager.staticAsset[k].mesh.children[i].animations.push(animations.clone());
let mixer = new THREE.AnimationMixer( assetModelManager.staticAsset[k].mesh.children[i] );
@ -31,7 +31,8 @@ export function AnimateManager() {
scope.actions[actionName] = {
status:"01",
action:mixer.clipAction( assetModelManager.staticAsset[k].mesh.children[i].animations[ 0 ])
action:mixer.clipAction( assetModelManager.staticAsset[k].mesh.children[i].animations[ 0 ]),
actionType:assetModelManager.staticAsset[k].mesh.name,
};
scope.actions[actionName].action.setLoop(THREE.LoopOnce);
@ -41,7 +42,7 @@ export function AnimateManager() {
}
}
}else{
}else{
let animations = assetModelManager.staticAsset[k].mesh.animations;
let mixer = new THREE.AnimationMixer( assetModelManager.staticAsset[k].mesh );
let actionName = assetModelManager.staticAsset[k].mesh.name;
@ -62,8 +63,6 @@ export function AnimateManager() {
let mixerUpdateDelta;
this.updateAnimation = function(){
mixerUpdateDelta = clock.getDelta();
for(let i=mixers.length-1;i>=0;i--){
if(mixers[i]._actions[0].isRunning()){
mixers[i].update( mixerUpdateDelta );

View File

@ -29,6 +29,9 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
let trainDeviceMode = false;
let trainDeviceList = [];
var audiopbm = JL3D_LOCAL_STATIC+'/lesson3d/audio/pbm.wav';
audiopbm = new Audio(audiopbm);
let renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setClearColor(new THREE.Color(0x000000));
renderer.setViewport( 0, 0, dom.offsetWidth, dom.offsetHeight);
@ -130,7 +133,6 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
this.initRoleMode = function(rMode,role){
roleMode = rMode;
nowRole = role;
// console.log(roleMode);
};
this.initExam = function(newExamList,newExamData){
@ -297,6 +299,10 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
actionEvent("remove",raycasterBoxs[i],raycasterBoxs[i].mesh);
jumpEvent("action",raycasterBoxs[i]);
}else if(raycasterBoxs[i].actionMode == "play"){
// console.log(raycasterBoxs[i]);
if(raycasterBoxs[i].action.actionType == "PBMDH"){
audiopbm.play();
}
if(raycasterBoxs[i].animateModel != "播放动画的模型"){
if(raycasterBoxs[i].action.status == "01"){
raycasterBoxs[i].action.status = "02";

View File

@ -0,0 +1,18 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function BagItemData() {
let scope = this;
this.dataList = [];
scope.dataList["ztg"] = [
{
id:"pbmys",
name:"屏蔽门钥匙",
type:"equip",
pic:JL3D_LOCAL_STATIC+"/lesson3d/item/pbmys.png",
status:false,
},
];
}

View File

@ -0,0 +1,18 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function BagItemData() {
let scope = this;
this.dataList = [];
scope.dataList["ztg"] = [
{
id:"pbmys",
name:"屏蔽门钥匙",
type:"equip",
pic:JL3D_LOCAL_STATIC+"/lesson3d/item/pbmys.png",
status:false,
},
];
}

View File

@ -1,13 +1,14 @@
<template>
<div class="toolbardiv" :style="{'background-image': 'url('+lessonbg+')'}">
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/guide.png)'}"
@click="openGuide"></div>
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/bag.png)'}"
@click="openBag"></div>
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/guide.png)'}"
@click="openGuide"></div>
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/back.png)'}">
</div>

View File

@ -40,8 +40,6 @@
</template>
<script>
import Vue from 'vue';
import localStore from 'storejs';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
@ -62,6 +60,7 @@
showJobList:false,
showJob:false,
selectedJob:null,
audioerr:JL3D_LOCAL_STATIC+'/lesson3d/audio/err.wav',
}
},
computed: {
@ -72,6 +71,8 @@
},
mounted() {
// this.initJobList();
this.audioerr = new Audio(this.audioerr);
},
beforeDestroy() {
@ -101,6 +102,8 @@
// console.log(this.lessonData.lessonData.lessonProgress[this.lessonPlayIndex]);
if(selectTool.sceneId == nowProgress.id && this.lessonData.lessonData.lessonProgress[this.lessonPlayIndex].roleName == this.nowRole){
jumpEvent("tools",selectTool);
}else{
this.audioerr.play();
}
// console.log(this.lessonData.lessonProgress[this.lessonPlayIndex]);
},

View File

@ -1,15 +1,16 @@
<template>
<div class="toolbardiv" :style="{'background-image': 'url('+lessonbg+')'}">
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/bag.png)'}"
@click="openBag">
</div>
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/guide.png)'}"
@click="openGuide">
</div>
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/bag.png)'}"
@click="openBag">
</div>
<div class="toolbarbutton"
:style="{'background-image': 'url('+localstatic+'/lesson3d/back.png)'}"
@ -33,9 +34,11 @@
</div>
</template>
<script>
import Vue from 'vue';
import localStore from 'storejs';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import { BagItemData } from '@/jlmap3d/lesson3d/toolsmodel/bagitemdata.js';
//
export default {
name: 'ToolBar',
@ -52,6 +55,10 @@
toolsList:[],
showGuide:false,
showBag:false,
bagListData:[],
bagItems:[],
usedItems:[],
}
},
computed: {
@ -168,6 +175,14 @@
},
];
this.bagListData = new BagItemData();
// this.bagItems:[],
// usedItems:[],
console.log(this.bagListData);
},

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB