Consider move “EditorControls” outside “viewport” aim to User can oparete controls

consider move “EditorControls” outside “viewport” aim to User can oparete controls

I feel it dont need to make this control customized

why not use “import { OrbitControls } from “three/examples/jsm/controls/OrbitControls”;” instead?

I have checked this issue, and comform I am using the fixed code. Use ViewHelper when my camera up is zAxis (0,0,1)

my code has bad smell:

  1. do a hack: add this line after “Viewport.js” line.56. " editor.viewHelper = viewHelper;"
  2. in my script, import OrbitControls
  3. const controls = new OrbitControls(, this.viewport.dom);
  4. assignment
  5. //@ts-ignore
    this.editor.viewHelper.controls = controls;

I hope I made myself clear :joy:

EditorControls and OrbitControls are similar in certain ways however EditorControls was specifically designed for the editor. By having two classes, one can add editor specific code to EditorControls without affecting OrbitControls. It is just the more flexible approach.

I think I understand what you are asking for but I’m not sure I get the benefit of including and instantiating EditorControls elsewhere in the editor’s code base. Do you mind explaining in more detail?