|
34 | 34 | import com.ss.editor.asset.locator.FolderAssetLocator; |
35 | 35 | import com.ss.editor.config.EditorConfig; |
36 | 36 | import com.ss.editor.executor.impl.JMEThreadExecutor; |
| 37 | +import com.ss.editor.model.EditorCamera; |
37 | 38 | import com.ss.editor.model.tool.TangentGenerator; |
38 | 39 | import com.ss.editor.ui.scene.EditorFXScene; |
39 | 40 | import com.ss.editor.util.EditorUtil; |
@@ -479,12 +480,24 @@ private void clearImpl() { |
479 | 480 | final DirectionalLight light = new DirectionalLight(); |
480 | 481 | light.setDirection(LIGHT_DIRECTION); |
481 | 482 |
|
| 483 | + final Node cameraNode = new Node("Camera node"); |
482 | 484 | final Node rootNode = editor.getPreviewNode(); |
483 | 485 | rootNode.addControl(this); |
484 | 486 | rootNode.attachChild(sky); |
485 | 487 | rootNode.addLight(light); |
| 488 | + rootNode.attachChild(cameraNode); |
486 | 489 | rootNode.attachChild(modelNode); |
487 | 490 |
|
| 491 | + final Camera camera = editor.getPreviewCamera(); |
| 492 | + final EditorCamera editorCamera = new EditorCamera(camera, cameraNode); |
| 493 | + editorCamera.setMaxDistance(10000); |
| 494 | + editorCamera.setMinDistance(0.01F); |
| 495 | + editorCamera.setSmoothMotion(false); |
| 496 | + editorCamera.setRotationSensitivity(1); |
| 497 | + editorCamera.setZoomSensitivity(0.2F); |
| 498 | + |
| 499 | + //TODO added supporting moving the camera |
| 500 | + |
488 | 501 | processor = bind(editor, imageView, imageView, editor.getPreviewViewPort(), false); |
489 | 502 | processor.setTransferMode(ON_CHANGES); |
490 | 503 | processor.setEnabled(false); |
|
0 commit comments