dongju.jeong Posted April 17, 2020 Share Posted April 17, 2020 update() If the host sends an Entity packet that does not move, the IG creates an Entity in the wrong place. However, if I change the parameter value of the positioning function every frame, it is created normally. ( ex] cano.SetAlt(0 +i) ) This experimented with my Host sample, not Hemu. Which option is wrong in IG? Is it related to interpolation? Link to comment
Amerio.Stephane Posted April 17, 2020 Share Posted April 17, 2020 I think if the entity is not moving at all (hence sending just once packet), it should not have its interpolation bit set. Link to comment
dongju.jeong Posted April 18, 2020 Author Share Posted April 18, 2020 (edited) I sent this packet every frame. I just fixed the entity in one place without moving it. Edited April 18, 2020 by dongju.jeong Link to comment
dongju.jeong Posted April 28, 2020 Author Share Posted April 28, 2020 (edited) I think this problem caused the clamp problem. Because when I made an entity that didn't move, not only was the clamp not applied, but the generating location was wrong.However, when some movement was applied, the position and clamp were applied normally. This was done as I intended. this is not. //======================================================================================== When I checked the location, I found a different value than the one sent by the host. cigi packet's value is normal. Log::message("%f, %f\n", vd->getPosition().x, vd->getPosition().y); // it is same with host's value. Edited April 28, 2020 by dongju.jeong Link to comment
cash-metall Posted April 28, 2020 Share Posted April 28, 2020 On 4/17/2020 at 9:48 AM, dongju.jeong said: Is it related to interpolation? may be. please try to check with cano.SetSmoothingEn(0); I need a little time to check out this at 2.9 with a custom host. Link to comment
morbid Posted April 28, 2020 Share Posted April 28, 2020 Hello Dong Ju, From our perspective there's no issue on the IG's or the engine's sides. As far as I understood, you wrote a custom host application based on a cigi_ccl_src_ver_3_3_3 library. We performed a test both with HEMU and custom host app, coordinates were correct. To check the case with HEMU we changed two lines (default_latitude and default_longitude) in hemu/default/Terrain.def file. Then wrote debug output for the IG application: void AppSystemLogic::init_cigi() { int index = Engine::get()->findPlugin("CIGIConnector"); // check CIGIConnector plugin load if (index < 0) return; // get CIGI interface cigi = (IG::CIGI::ConnectorInterface*)Engine::get()->getPluginData(index); cigi->setReceivePacketCallback(IG::CIGI::CIGI_OPCODE_ENTITY_CONTROL, MakeCallback(this, &AppSystemLogic::entity_control)); } void AppSystemLogic::entity_control(IG::CIGI::ICigiEntityControl * control) { int id = control->getEntityID(); Log::message(" (%d)cigi geopos %f %f\n", id, control->getPosition().x, control->getPosition().y); auto entity_pos = ig_manager->getEntity(id)->getGeoPosition(); Log::message(" (%d)ig geopos %f %f\n", id, entity_pos.x, entity_pos.y); auto world = ig_manager->getEntity(id)->getNode()->getWorldPosition(); auto geo = ig_manager->getConverter()->worldToGeodetic(world); Log::message(" (%d)engine geopos %f %f\n", id, geo.x, geo.y); } This code will output into the console three lines: Coordinates received from the host application Coordinates kept by IG after the package was applied Coordinates of the airplane node This is what we get: (1)cigi geopos 36.000000 12.000000 (1)ig geopos 36.00000 12.000000 (1)engine geopos 36.000000 12.000000 Then we ran a test with custom host: CigiEntityCtrlV3_3 entctrl; entctrl.SetAlpha(255); entctrl.SetAnimationDir(CigiEntityCtrlV3_3::Forward); entctrl.SetAnimationLoopMode(CigiEntityCtrlV3_3::Continuous); entctrl.SetAnimationState(CigiEntityCtrlV3_3::Stop); entctrl.SetAttachState(CigiEntityCtrlV3_3::Detach); entctrl.SetParentID(0); entctrl.SetCollisionDetectEn(CigiEntityCtrlV3_3::Disable); entctrl.SetEntityID(_data->_cigiEntityId); entctrl.SetEntityState(CigiEntityCtrlV3_3::Active); entctrl.SetEntityType(200); entctrl.SetGrndClamp(CigiEntityCtrlV3_3::AltAttClamp); entctrl.SetInheritAlpha(CigiEntityCtrlV3_3::NoInherit); entctrl.SetLat(36); entctrl.SetLon(12); entctrl.SetAlt(2000); entctrl.SetYaw(_yaw); entctrl.SetPitch(_pitch); entctrl.SetRoll(_roll); entctrl.SetSmoothingEn(0); // You don't have this line And get the very same result as before: (22)cigi geopos 36.000000 12.000000 (22)ig geopos 35.999974 12.000000 (22)engine geopos 35.999974 12.000000 At this point we do not observe any issues unless something was missed or you have anything to add. Thanks! 2 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
dongju.jeong Posted April 28, 2020 Author Share Posted April 28, 2020 (edited) after Script loading and World loading, value is changed. is there any doubts? Or can you test it with my project? Edited April 28, 2020 by dongju.jeong Link to comment
morbid Posted April 28, 2020 Share Posted April 28, 2020 Let's check the following: Which mode is set for TerrainGlobal? Flat or curved? Terrain becomes curved when it's a child node for GeodeticPivot. Is "Flat" flag enabled in the GeodeticPivot parameters? What lat/long/alt are used for GeodeticPivot? 1 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
dongju.jeong Posted May 7, 2020 Author Share Posted May 7, 2020 (edited) hello. I use GeodeticPivot like this. and I generated terrain with turn off curved option. Edited May 7, 2020 by dongju.jeong Link to comment
cash-metall Posted May 8, 2020 Share Posted May 8, 2020 We found what was the problem! You create an entity before loading the world. At this time, the pivot geodetic does not exist, and IG operates in world coordinate mode, because it does not know how to interpret geo-coordinates. After loading the world, the positions of entities are not updated automatically. But when you request a geolocation, the world coordinates are converted to geocoordinates. You can solve this by re-sending the package with geocoordinates, or just create an entity after loading the world. 1 Link to comment
dongju.jeong Posted May 11, 2020 Author Share Posted May 11, 2020 thank you so much. This is work when I send Entitiy packet after loading the world. Can I know what it means to resend a packet with geocordinate? I kept sending the same Entity packet to every frame before and after the world load. but the same problem had appeared. I don't think this is what your solution means. Link to comment
morbid Posted May 12, 2020 Share Posted May 12, 2020 On 5/11/2020 at 8:37 AM, dongju.jeong said: Can I know what it means to resend a packet with geocordinate? I'm sorry, this wouldn't work in a straightforward way. You can do this as follows: Send entity control packet with 0,0,0 coordinates Send entity control again with correct coordinates This should be done once after world was loaded. However, the best solution here is to create an entity after the world was loaded. Thanks. 1 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
Recommended Posts