Reply To: C++ Engine
Home › Forums › TimelineFX Module › C++ Engine › Reply To: C++ Engine
TonC
Hi Damucz… 🙂
This library is great, thanks! It’s given us a big “legup”. 🙂
I’m seeing some differences with emitters that use a “stretch” effect though. The effect in-game doesn’t look the same as the effect in the editor.
I think I’ve maybe found the source of the issue:
I notice that in “UpdateSpawns” in TLFXEmitter.cpp (line 1271 approx) the scale is set to something like:
e->SetScaleY((GetEmitterScaleX(0) * e->GetGSizeX() * (e->GetWidth() + (fabsf(e->GetSpeed()) * GetEmitterStretch(0) * _parentEffect->GetCurrentStretch()))) / _image->GetWidth());
where the GetEmitterStretch(0) is multiplied by the e->GetSpeed() term…
and in “ControlParticle” in TLFXEmitter.cpp (line 1704 approx) the scale is then set to:
e->_scaleY = (GetEmitterScaleX(e->_age, (float)e->_lifeTime) * e->_gSizeX * ( e->_width + (Vector2::GetDistance(0, 0, e->_speedVec.x, e->_speedVec.y) * GetEmitterStretch(e->_age, (float)e->_lifeTime) * _parentEffect->GetCurrentStretch()))) / _image->GetWidth();
where the GetEmitterStretch(0) is multiplied by the Vector2::GetDistance(0, 0, e->_speedVec.x, e->_speedVec.y) term.
If I change the Vector2::GetDistance(0, 0, e->_speedVec.x, e->_speedVec.y) calls to e->GetSpeed() the effect looks the same as in the editor.
What do you think?
Thanks again for the lib. 🙂
TonC.