lightmap Posted May 17, 2018 Share Posted May 17, 2018 Hello I can't get interaction (select axis by mouse) with manipulator. I can see manipulator on scene, matrices are set ok. do I miss some function that test if mouse above some axis for getFocusedAxis()? or I must highlight it manually? I'm initialize manipulator like: manipulator = new WidgetManipulatorTranslator(Gui.get()); manipulator.setSize(64); Gui.get().addChild(manipulator, Gui.ALIGN_OVERLAP); manipulator.setEnabled(1); and on Update set matrices: Player p = Render.CurrentCamera.Player; if (p == null){ System.Console.WriteLine("player == null");// ok return; } dmat4 transform = dmat4.IDENTITY; if (Target != null) transform = Target.getWorldTransform(); manipulator.setBasis(transform); manipulator.setTransform(transform * dmat4.IDENTITY); manipulator.setProjection(p.getProjection()); manipulator.setModelview(p.getIWorldTransform()); if (manipulator.isFocused() != 0){ int fa = manipulator.getFocusedAxis(); System.Console.WriteLine("getFocusedAxis = {0}", fa); // never triggered } thanks Link to comment
lightmap Posted May 18, 2018 Author Share Posted May 18, 2018 when Unigine console opened( Unigine.Console.get().run("show") ) and hidden I can see selection on manipulator for a second it seems not all input translated to gui and when console hidden, Gui.get().getFocus(); return null, even when cursor above manipulator Link to comment
moroz Posted May 18, 2018 Share Posted May 18, 2018 Hi! I attached sample with manipulator. You don't need in special methods to drag manipulator. Enough press by left mouse button on any axis and drag this. manipulator_sample_cs.zip 1 Link to comment
lightmap Posted May 18, 2018 Author Share Posted May 18, 2018 solved Gui.get().setMouseGrab(1); Link to comment
moroz Posted May 18, 2018 Share Posted May 18, 2018 Did you previously disable mouse grab? It should be enabled by default :) Link to comment
Recommended Posts