Jump to content

Manipulator example


photo

Recommended Posts

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

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
×
×
  • Create New...