Browse Source

优化镜头旋转

dev
刘向辉 3 years ago
parent
commit
32be8c948a
  1. 2
      src/app/babylon/controller/mode-manager.ts
  2. 2
      src/app/babylon/tool/babylon-tool.ts
  3. 18
      src/app/babylon/view/mark-window/mark-window.ts
  4. 11
      src/app/pages/plan/plan.component.ts

2
src/app/babylon/controller/mode-manager.ts

@ -23,7 +23,7 @@ export class ModeManager {
/**
*
*/
public static s_isMakeMode = false;
public static s_isMakeMode = true;
/**
*

2
src/app/babylon/tool/babylon-tool.ts

@ -433,7 +433,7 @@ export class BabylonTool {
public static limitPI(value: number) {
let result = value;
while (result < 0) {
while (result < - Math.PI) {
result += Math.PI * 2;
}

18
src/app/babylon/view/mark-window/mark-window.ts

@ -40,9 +40,9 @@ import { WeatherTool } from "./weather-tool";
export class MarkWindow extends UIBase {
/**
* Key
*
*/
readonly c_leaveNode: string = "node_leave_";
readonly c_leaveNodeName: string = "";
static instance: MarkWindow;
@ -255,10 +255,16 @@ export class MarkWindow extends UIBase {
let copyNodeData = classToClass(this.currentMarkNodeDataCopy);//覆盖数据
copyNodeData.id = oldNodeData.id;
copyNodeData.index = oldNodeData.index;
if (newName != null && newName != this.c_leaveNode) {
if (newName != null && newName != this.c_leaveNodeName) {
copyNodeData.name = newName;
}
// copyNodeData.name = oldNodeData.name;
if (copyNodeData.name == this.c_leaveNodeName) //如果来自空节点,则保留原名
{
copyNodeData.name = oldNodeData.name;
}
console.log("记录的数据", copyNodeData.texture, this.currentMarkNodeInfo.nodeData.texture);
markPlaneData.setNodeData(nodeId, copyNodeData);//覆盖数据
this.saveAllMarkPlanData();
@ -368,8 +374,10 @@ export class MarkWindow extends UIBase {
//清空
this.currentMarkNodeDataCopy = nodeCopy;//更新备份数据
this.currentMarkNodeInfo = new MarkNodeInfo(markPlanData, this.currentMarkNodeDataCopy);
//this.currentMarkNodeDataCopy = classToClass(this.currentMarkNodeInfo.nodeData); //更新备份数据
this.updateNodeInfo(readDescribe);
PlanComponent.instance.updateBeforePlanNode();
// let instance = this;
// if (readDescribe) { //镜头移动完,开始说话
// setTimeout(() => {
@ -1022,7 +1030,7 @@ export class MarkWindow extends UIBase {
*
*/
createLeaveNode() {
let result = new MarkNodeData(0, this.c_leaveNode);
let result = new MarkNodeData(0, this.c_leaveNodeName);
return result;
}

11
src/app/pages/plan/plan.component.ts

@ -475,13 +475,19 @@ export class PlanComponent implements OnInit {
this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id : null
this.isShowChildComponent && this.leftDomain ? this.leftDomain.selectNodeId = this.beforePlanNode.id : null
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true)
this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData
this.initViewer()
this.updateProgress() //更新进度条
resolve(true)
})
}
/**
* BeforePlanNode
*/
updateBeforePlanNode() {
this.beforePlanNode = MarkWindow.instance.currentMarkNodeInfo.nodeData
}
//选中 底部一级节点 开启自动播放
selectChildNode(item: MarkPlanData) {
if (item.nodes.length) {
@ -696,6 +702,9 @@ export class PlanComponent implements OnInit {
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
if (!isVideo) { //img
this.beforePlanNode.texture = ObjectsService.getFullPath(path + name)
console.log("上传图片保存数据", this.beforePlanNode);
this.initViewer()
} else { //video
this.beforePlanNode.video = ObjectsService.getFullPath(path + name)

Loading…
Cancel
Save