Create visuals from c++ plugin during runtime

asked 2018-07-04 08:37:11 -0500

JakobWelner gravatar image

I am writing a custom muscle system and struggling with visualizing my muscles.

I would like to create visual elements (cylinders) through my plugin for each muscle that I instantiate. These visual elements should then be available for updating their position, scale and color during runtime.

I can see that the Sonar plugin does something similar ( and I have found the BlinkVisualPlugin example for reference on visual plugins, but I must admit that I haven't found much else documentation on the matter and I am a bit unsure of how to put it together.

My understanding so far is, that I create my muscles through a model plugin (or maybe a world plugin?) and that visuals should be created through a visual plugin? But how/where I instantiate/create new visuals when new muscles are instantiated, I am not sure about. Neither do I know where I should attach the visual plugin to the world file? I have seen examples of a visual plugin subscribing to topics that define their state (ie. pose, scale and color), which I guess is a way to get a model plugin and a visual plugin to talk.

If anyone know of a working example or can post a minimal (pseudo) code that does something similar, it would be much appreciated!

Thanks in advance

edit retag flag offensive close merge delete