Jump to content

Visualizer not working


photo

Recommended Posts

Good evening,

I wrote the code below everywhere. The visuilizer is not working. The editor view shows the Shape of the physical space, but not in the simulation mode. Nothing Appears.

Code:

	private void Init(){
		Visualizer.Enabled = true;
		Visualizer.Mode = Visualizer.MODE.ENABLED_DEPTH_TEST_ENABLED;
		Unigine.Console.Onscreen = true;
    }

Editor View:

image.png.fce03d625dfc934b0f817a080394252f.png

Simulation Mode:

image.thumb.png.2239d6f5aa3db06ec588f1a31e4ac0a7.png

Link to comment

Hi, Sevdat!

https://developer.unigine.com/en/docs/2.18.1/api/library/engine/class.visualizer?rlang=cpp&autotranslate=en

Visualizer itself doesn't display shapes and joints. You need to switch it separately after the visualizer is turned on.

Try to use console command -physics_show_shapes 2 in runtime to display the shapes. 

https://developer.unigine.com/en/docs/2.18.1/code/console/?rlang=cpp#physics_debug

Will it be acceptable for your work?

Thanks!

 

Link to comment
Posted (edited)

Good day arizmenda,

I wrote the code and it works, but in the documentation the value 2 is not mentioned:

image.thumb.png.05007fe873694abdab5343cff41040f4.png

I added this part of the code to automatically enter the command to the console at launch:

Unigine.Console.Run("physics_show_shapes 2");

Is there a better way of doing this than writing string inside Run()? This isn't a very user friendly method.

Edited by Sevdat
Link to comment
Posted (edited)
23 minutes ago, arizmenda said:

Good day arizmenda,

This works, but it's not very intuitive for beginners.

 Physics.ShowShapes = Physics.SHOW_TYPE.SOLID;

I have an idea that might be a little better. Since all of these are console commands why not make:

Unigine.Console.Run(ConsoleOptions.Physics_Show_Shapes_2);

We can have ConsoleOptions as a class of string values with names containing explenations.

 

Edited by Sevdat
Link to comment
×
×
  • Create New...