enrique.trilles Posted November 7, 2019 Share Posted November 7, 2019 Hi. We are trying to load some test entities using the ig_config.xml file. Our client side builds an EntityStatePDU and sends it without issues and our server side is receiving it fine too. Our code looks like this: void OnEntityStatePDUrcv(KDIS::PDU::Entity_State_PDU* pdu){ int64_t entityType = GetInternalEntityType(pdu->GetEntityType()); // We also tried forcing the value, like this: // DATA_TYPE::EntityType testType = DATA_TYPE::EntityType(1, 2, 222, 4, 14, 0, 0); // int64_t entityType = GetInternalEntityType(testType); // >> Different values every time we run the app here... Log::message("EntityType value: %lld\n", entityType); // ... // if(entity->GetType() != entityType) { entity->setType(entityType); } } int64_t GetInternalEntityType(DATA_TYPE::EntityType& t) { // IG::ManagerInterface pointer return _igManager->getEntityType(t.GetEntityKind(), t.GetDomain(), t.GetCountry(), t.GetCategory(), t.GetSubCategory(), t.GetSpecific(), t.GetExtra()); } At the moment, our ig_config file looks like this: (As found in this message) <entity_types> <entity name="testcube" id="1.2.222.4.14.0.0"> <path>ig/entities/e_test/testcube.node</path> </entity> <entity name="lcm1e" id= "1.3.222.5.17.0.0"> <path>assets/lcm1e/lcm1e.node</path> </entity> <!-- == more entities == --> </entity_types> Our problem is, every time we launch the application, the value returned by the function 'getEntityType' is different, and we don't know how to correctly set the entityType to the entity for the mesh to show. The call to 'entity->setEntity(entityType)' doesn't show anything on our application. We also double-checked all the .node files that are being used and all are ok. Any insight on what could be the problem? PD: We tried substituting the id with a single number and tried to load it directly, and then the setEntity is working as it should (model shows correctly on screen). Using Unigine 2.9.0.2, btw. Link to comment
morbid Posted November 8, 2019 Share Posted November 8, 2019 Hi Enrique, Are you using DISConnector from the SDK or the modified plugin? In 2.9 there was a bug and you use patched files from this thread: How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
enrique.trilles Posted November 8, 2019 Author Share Posted November 8, 2019 Hi. We are using the source you provided us in this ticket: https://developer.unigine.com/en/personal/support-ticket/2174 We didn't change the plugin; simply compiled it agains't our custom KDIS library. The IG Interface is the one on the version 2.9.0.2. Here is an updated version of the code, with a more precise location of the problem: { // Forced value for testing purposes KDIS::DATA_TYPE::EntityType t = KDIS::DATA_TYPE::EntityType(1, 3, 222, 5, 17, 0, 0); // EntityStatePDUrcv callback int64_t entityType = FindEntityType("lcm1e"); int64_t entityType2 = GetInternalEntityType(t); Log::message("Find value: %lld\tgetEntityType value: %lld\n", entityType, entityType2); // << entityType shows correct model. // << entityType2 DOES NOT show model (does nothing). if(entity->GetType() != entityType2) { entity->SetType(entityType2); } } // Functions are just our wrappers for the IG ManagerInterface int64_t FindEntityType(const char* name) { _igManager->findEntityType(name); } int64_t GetInternalEntityType(KDIS::DATA_TYPE::EntityType& type) { return _igManager->getEntityType(type.GetEntityKind(), type.GetDomain(), type.GetCountry(), type.GetCategory(), type.GetSubCategory(), type.GetSpecific(), type.GetExtra()); } The ig_config file remains the same: <entity_types> <entity name="testcube" id="1.2.222.4.14.0.0"> <path>ig/entities/e_test/testcube.node</path> </entity> <entity name="lcm1e" id="1.3.222.5.17.0.0"> <path>assets/lcm1e/lcm1e.node</path> </entity> <!-- == more entities == --> </entity_types> And this is the log output: Especial mention to the getEntityType value that it changes with each run of the program. Link to comment
morbid Posted November 11, 2019 Share Posted November 11, 2019 Agian, please, check the mentioned IG patch first, then test your code. Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
enrique.trilles Posted November 11, 2019 Author Share Posted November 11, 2019 Hi. After trying the patch you mentioned on that post, it seems to work correctly now. Thanks for your time. Link to comment
Recommended Posts