rotate a particle emitter

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

rotate a particle emitter

Post by katze555 »

i have a particle emitter and i attach the particlescenenode to another node. (seParent()) but i dont want the emitter to rotate while attaching it to the parent. can i prevent it from rotating?? or can i rotate it back after attaching it?
________
Healthy living advice
Last edited by katze555 on Thu Feb 24, 2011 7:41 am, edited 1 time in total.
SG57
Posts: 66
Joined: Fri May 18, 2007 5:51 am

Post by SG57 »

There is no way that I am aware of but the fastest way to achieve what you want is to NOT set a parent, instead set the position of the particle system scenenode each cycle to the position of the parent you initially wanted. This means you lose the features of it being a child of node (automatic removal and visibility).
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

Post by katze555 »

the problem is, the position of the particle effect is not the position of the parent, the parent (a bone) is rotating and movingall the time, so its very hard so keep the position of the particleeffect without setting it as a child
________
LAMBORGHINI V10
Last edited by katze555 on Thu Feb 24, 2011 7:41 am, edited 1 time in total.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It seems you could implement a scene node similar to a dummy scene node that would ignore the rotation of its parent. You could do this by inheriting from ISceneNode and overriding updateAbsolutePosition() to ignore the rotation of the parent scene node (if any).

Then you just need to attach one of these nodes to the parent node, and attach the particle system to that.

Travis
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

Post by katze555 »

the problem is i want it to rotate with the parent later, but i dont want tochange its rotation while attaching it
________
VAPORIZER REVIEW
Last edited by katze555 on Thu Feb 24, 2011 7:41 am, edited 1 time in total.
katze555
Posts: 28
Joined: Tue Mar 23, 2010 7:13 pm

Post by katze555 »

i think i got it:

Code: Select all

 _ps->setParent(bone);
_ps->setRotation((-1)*_ps->getParent()->getAbsoluteTransformation().getRotationDegrees());
this neutralizes the rotation coming from the parent.
the other problem is now i need to do the same with the position...
________
Mexico Hotels
Post Reply