Jump to content

[SOLVED] apply interpolation


photo

Recommended Posts

not use cigi, 
when I control entity(create,translate,rotate...) by used the ig_manager in Unigine, Is there a way to apply IG's interpolation?

 

In the past, I got the answer that to apply the setinterpolation(false) function when operating the entity directly in the unigine.

On 4/17/2020 at 7:22 PM, cash-metall said:

Hello dongju! 
you need turn off interpolation for work with entity transformation directly without cigi. 


IG::IEntity * sample = AppSystemLogic::ig_manager->getEntity(222);
sample->setType(200);
sample->setInterpolation(0); // <== turn off interpolation
sample->setCollision(1);
sample->setRotationEuler(Unigine::Math::vec3(89, 0, 0));
sample->setGeoPosition(AppSystemLogic::ig_manager->getConverter()->worldToGeodetic(Unigine::Math::Vec3(0, 3, 1500)));

 

 

Link to comment

Hi! 
please tell more: in which case would you like to use interpolation?

Interpolation was used in case when host frequency is not equal to IG frequency. or if several network packets are lost. But if you move the entity directly, you can do it in every frame.

  • Like 1
Link to comment

ig_manager->setInterpolation(0);
    ig_manager->setInterpolationPeriod(0.2); // 200 ms
    ig_manager->setExtrapolationPeriod(0); // 0 ms, disabled
    ig_manager->setInterpolationLerp(1);
    ig_manager->setInterpolationLerpFactor(0.2);

Because of these functions, I thought that extrapolation and interpolation were applied periodically.

Can I know exactly what the interpolation period and Lerp function mean?

 

Link to comment

 

image.png

Interpolation is needed when ig and host operate at different frequencies.

Then the host sends a timestamp with the position. IG interpolates the position between known frames. to calculate intermediate frames, IG takes all points during interpolation time. 

If no new positions have been received, IG will extrapolate the position during the extrapolation time.

 

In your case, you are working inside the IG. You have the ability to set a position in each frame. without interpolation and extrapolation.

  • Like 1
Link to comment
  • silent changed the title to [SOLVED] apply interpolation
×
×
  • Create New...