Sevdat Posted July 16 Share Posted July 16 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: Simulation Mode: Link to comment
arizmenda Posted July 17 Share Posted July 17 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
Sevdat Posted July 17 Author Share Posted July 17 (edited) Good day arizmenda, I wrote the code and it works, but in the documentation the value 2 is not mentioned: 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 July 17 by Sevdat Link to comment
arizmenda Posted July 17 Share Posted July 17 Try using setShowShapes https://developer.unigine.com/en/docs/2.18.1/api/library/physics/class.physics?rlang=cpp&words=showshapes%2Cshowshapeslll%2Cshowshap%2Cshowshapesll#setShowShapes_int_void Link to comment
Sevdat Posted July 17 Author Share Posted July 17 (edited) 23 minutes ago, arizmenda said: Try using setShowShapes https://developer.unigine.com/en/docs/2.18.1/api/library/physics/class.physics?rlang=cpp&words=showshapes%2Cshowshapeslll%2Cshowshap%2Cshowshapesll#setShowShapes_int_void 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 July 17 by Sevdat Link to comment
Recommended Posts