Jump to content

Suggestion: CIGI/DIS debug help


photo

Recommended Posts

Hello,

To help debug our scenario providers, I would like to get something along this features:

- for each CIGI or DIS entity, call a user-defined callback to overlay a text onto the entity. Typically, the callback could be something like "void fct(entity*[in], string*[out], color*[out])".

Note: currently, I couldn't find a way to simply iterate over all defined entities and do the 3d text overlay myself.

- be able to remove all entities (so leftover entities, ie entities which are no longer being moved by the simulation, can be cleaned away)

Thanks!

Link to comment

Hello Stephane,

22 hours ago, Amerio.Stephane said:

- for each CIGI or DIS entity, call a user-defined callback to overlay a text onto the entity. Typically, the callback could be something like "void fct(entity*[in], string*[out], color*[out])".

If I understood you correctly you want a method that will return all entities in the scene. Am I right?

22 hours ago, Amerio.Stephane said:

- be able to remove all entities (so leftover entities, ie entities which are no longer being moved by the simulation, can be cleaned away)

This is already planned for 2.10+.

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
1 hour ago, morbid said:

you want a method that will return all entities in the scene. Am I right?

This would also be a great addition (getting all CIGI entities, and with another fct all DIS entities). But my first need is just to overlay a text on entities. Of course, getting all entities would allow me to write code to add 3d text myself, but I think this feature would be helpful to other users and can be generic enough to be found "out of the box" in Unigine.

With our legacy IG, there was a simple API we could call that looked like this:

cigi->setTextOverlayCallback( &textCallback );

void textCallback(CigiEntity* entity, String* text, Color* color) {
	*text = entity->name();
	*color = Color::red;
}

Setting a nullptr callback would just remove all texts. There could be a different callback for Cigi, Dis, Hla for example, so we could distinguish the text/color with the entities internal data. Of course, this is still just a suggestion you can improve on :)

Link to comment
×
×
  • Create New...