-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(editor): fix camera's aspect for scene view, game view and publis…
…hed canvas
- Loading branch information
Showing
47 changed files
with
206 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...d-pipeline-viewrect-sceneview/src/Main.ts → ...line-editor-viewrect-gameview/src/Main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...line-viewrect-sceneview/src/jobs/Utils.ts → ...ditor-viewrect-gameview/src/jobs/Utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
contributes/meta3d-pipeline-editor-viewrect-gameview/src/jobs/init/GetViewRectJob.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { execFunc as execFuncType } from "meta3d-engine-core-gameview-protocol/src/contribute/work/PipelineContributeType" | ||
import { getState, setState } from "../Utils"; | ||
import { states } from "meta3d-pipeline-viewrect-gameview-protocol/src/StateType" | ||
|
||
export let execFunc: execFuncType = (meta3dState, { api, getStatesFunc, setStatesFunc }) => { | ||
let states = getStatesFunc<states>(meta3dState) | ||
let { mostService } = getState(states) | ||
|
||
return mostService.just(meta3dState) | ||
} |
30 changes: 30 additions & 0 deletions
30
contributes/meta3d-pipeline-editor-viewrect-gameview/src/jobs/update/GetViewRectJob.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { execFunc as execFuncType } from "meta3d-engine-core-gameview-protocol/src/contribute/work/PipelineContributeType" | ||
import { getState, setState } from "../Utils"; | ||
import { states } from "meta3d-pipeline-viewrect-gameview-protocol/src/StateType" | ||
import { getViewRect } from "meta3d-view-utils/src/GameViewRect"; | ||
import { getExn } from "meta3d-commonlib-ts/src/NullableUtils"; | ||
import { service as uiService } from "meta3d-ui-protocol/src/service/ServiceType" | ||
import { state as uiState } from "meta3d-ui-protocol/src/state/StateType" | ||
|
||
export let execFunc: execFuncType = (meta3dState, { api, getStatesFunc, setStatesFunc }) => { | ||
let states = getStatesFunc<states>(meta3dState) | ||
let { mostService } = getState(states) | ||
|
||
return mostService.callFunc(() => { | ||
//console.log("get view rect job"); | ||
|
||
let uiService = api.getExtensionService<uiService>(meta3dState, "meta3d-ui-protocol") | ||
let uiState = api.getExtensionState<uiState>(meta3dState, "meta3d-ui-protocol") | ||
|
||
return setStatesFunc<states>( | ||
meta3dState, | ||
setState(states, { | ||
...getState(states), | ||
viewRect: getExn(getViewRect( | ||
uiService, | ||
uiState | ||
)) | ||
}) | ||
) | ||
}) | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
contributes/meta3d-pipeline-editor-webgl1-game-view1/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ributes/meta3d-pipeline-editor-webgl1-game-view1/src/jobs/update/UpdateCameraAspectJob.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { execFunc as execFuncType } from "meta3d-engine-core-sceneview-protocol/src/contribute/work/PipelineContributeType" | ||
import { getState, setState } from "../Utils"; | ||
import { states } from "meta3d-pipeline-editor-webgl1-game-view1-protocol/src/StateType"; | ||
import { getExn } from "meta3d-commonlib-ts/src/NullableUtils"; | ||
import { getViewRect } from "meta3d-view-utils/src/GameViewRect"; | ||
import { service as uiService } from "meta3d-ui-protocol/src/service/ServiceType" | ||
import { state as uiState } from "meta3d-ui-protocol/src/state/StateType" | ||
import { updateAllCameraAspect } from "meta3d-pipeline-editor-webgl1-view1-utils/src/CreateDefaultSceneJobUtils"; | ||
|
||
export let execFunc: execFuncType = (meta3dState, { api, getStatesFunc, setStatesFunc }) => { | ||
let states = getStatesFunc<states>(meta3dState) | ||
let { | ||
mostService, | ||
engineWholeService | ||
} = getState(states) | ||
|
||
return mostService.callFunc(() => { | ||
let uiService = api.getExtensionService<uiService>(meta3dState, "meta3d-ui-protocol") | ||
let uiState = api.getExtensionState<uiState>(meta3dState, "meta3d-ui-protocol") | ||
|
||
let { width, height } = getExn(getViewRect( | ||
uiService, | ||
uiState | ||
)) | ||
|
||
return updateAllCameraAspect(meta3dState, engineWholeService, width, height) | ||
}) | ||
} |
2 changes: 1 addition & 1 deletion
2
contributes/meta3d-pipeline-editor-webgl1-scene-view1/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ibutes/meta3d-pipeline-editor-webgl1-scene-view1/src/jobs/update/UpdateCameraAspectJob.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { execFunc as execFuncType } from "meta3d-engine-core-sceneview-protocol/src/contribute/work/PipelineContributeType" | ||
import { getState, setState } from "../Utils"; | ||
import { states } from "meta3d-pipeline-editor-webgl1-scene-view1-protocol/src/StateType"; | ||
import { getExn } from "meta3d-commonlib-ts/src/NullableUtils"; | ||
import { getViewRect } from "meta3d-view-utils/src/SceneViewRect"; | ||
import { service as uiService } from "meta3d-ui-protocol/src/service/ServiceType" | ||
import { state as uiState } from "meta3d-ui-protocol/src/state/StateType" | ||
import { updateAllCameraAspect } from "meta3d-pipeline-editor-webgl1-view1-utils/src/CreateDefaultSceneJobUtils"; | ||
|
||
export let execFunc: execFuncType = (meta3dState, { api, getStatesFunc, setStatesFunc }) => { | ||
let states = getStatesFunc<states>(meta3dState) | ||
let { | ||
mostService, | ||
engineWholeService | ||
} = getState(states) | ||
|
||
return mostService.callFunc(() => { | ||
let uiService = api.getExtensionService<uiService>(meta3dState, "meta3d-ui-protocol") | ||
let uiState = api.getExtensionState<uiState>(meta3dState, "meta3d-ui-protocol") | ||
|
||
let { width, height } = getExn(getViewRect( | ||
uiService, | ||
uiState | ||
)) | ||
|
||
return updateAllCameraAspect(meta3dState, engineWholeService, width, height) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.