[Resolved] Ensuring emitter is in the right direction

I have a ParticleEmitter to display fire from a torch. It is given a initial velocity in Z direction (which is ‘up’ in the game’s world). It’s attached to the torch which is then attached to a hand and so on up the tree.

My question is how do I ensure the initial velocity remains in the Z direction irrespective of rotation of parent node? If the character falls over or moves its arm the fire should still go up.

Do I need to add a control that looks for rotation in parents and cancels it in local coords? Or is there a way to specify the velocity in world coords?

One technique would be to attach it to the root rather than torch and have a control that tracks the torch’s location and moves the fire. Is that the right way to achieve this?

It is without a doubt the easiest way.

My main concern with this approach is that it’s re-calculating the translation every update cycle rather only when the parent is moved or rotated. That seems pretty inefficient to me. Is my concern misplaced?

Yes,

very, the positions send to opengl are anyway global and transformed each frame to a camera relative view.

Or in short you think about saving a non measurable fraction of calculations by making your own life way harder.

classic case of overoptimize.

Premature optimization is the root of all evil - Donald Knuth

Try it. Always with optimization: Try it. Then fix it if you can measure that it actually has an impact.