Jump to content

[SOLVED] WidgetManipulatorTranslator


photo

Recommended Posts

Hi.

 

my unigine version is sim 2.0, I use WidgetManipulatorTranslator class in my init function, but my code could not work, i could not see any effect, main code as  below:

 

 

 

 

Gui gui = engine.getGui();
w = new WidgetManipulatorTranslator(gui);
gui.addChild(w, GUI_ALIGN_OVERLAP);
w.setTransform(translate(11,11,11));
 
 
 
Thanks.

 

 

 

Link to comment

Hi,

Modelview and projection matrices of the manipulator should be updated each frame.

int update() {
	Player player = engine.game.getPlayer();
	if(player != NULL) {
		manipulator.setModelview(player.getModelview());
		manipulator.setProjection(player.getProjection());
	}
	return 1;
}
Link to comment
×
×
  • Create New...