Jump to content

DIS Entity Marking ?


photo

Recommended Posts

Posted

Hi,

How can we get access to an entity DIS marking?

- with 2.13?

- with 2.15.1?

Thanks!

Posted

Should have been more specific: I'm looking for API function or code sample to access the DIS entity marking, for both 2.13 and 2.15.1 (in case the api changed).

I couldn't find it in the doc.

Thanks!

Posted

we do not read or store EntityMarking value

Posted (edited)

OK, so first I'd suggest to add Marking support in a future version.

Second, I need to access it for a current project, so, how can I intercept the Entity PDU and then match it to an existing IG entity* ?

For future reference, here is the code I used:

Map<int, String> entitiesMarking;
int SystemLogic::init()
{
	// Note: this code is here because Unigine does not give acces to Entity Marking
	// To be removed when Unigine API is updated...
	if (auto dis = IG::DIS::Connector::get())
		dis->setCallbackOnRecvPacket( // 2.13; for 2.15 use addReceivePacketCallback
            KDIS::DATA_TYPE::ENUMS::Entity_State_PDU_Type,
            MakeCallback(this, &SystemLogic::on_receive_Entity_State_PDU)
        );

	return 1;
}
void SystemLogic::on_receive_Entity_State_PDU(KDIS::PDU::Header* packet)
{
	KDIS::PDU::Entity_State_PDU* es = static_cast<KDIS::PDU::Entity_State_PDU*>(packet);
	entitiesMarking[es->GetEntityIdentifier().GetEntityID()] = es->GetEntityMarking().GetEntityMarkingString().c_str();
}

Only problem now is you deliver a kdis.dll but not the kdis.lib! (so I have to recompile KDIS in my project, which is a risk in case the lib is not exactly the same as you used for the dll generation, for example if you have patched it).

Thanks!

Edited by Amerio.Stephane
Posted
Quote

OK, so first I'd suggest to add Marking support in a future version.

Got it! Already in our TODO list for the future releaeses.

Regarding the kdis.lib - you can find our version in attachment (2.15). Hope that helps :)

Thanks!

kdis_lib.zip

  • Thanks 1

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

×
×
  • Create New...