I've been bashing my head for at least 2 hours over an issue which I haven't been able to fix. I am trying to update a particle emitters direction so particles always come out at a certain vector (in this case 0, 1, 0) from a parent object.
So if the parent object rotates in any dimension the particles still appear to be coming out of the top of the object.
Code: Select all
irr::core::vector3df direction(0, 1, 0);
irr::core::vector3df centre(0, 0, 0);
direction.rotateXYBy(parent->getGraphicsObject()->getRotation().Z, centre);
direction.rotateXZBy(parent->getGraphicsObject()->getRotation().Y, centre);
direction.rotateYZBy(parent->getGraphicsObject()->getRotation().X, centre);
this->emitter->setDirection(direction);I find a picture helps;

Basically the two engines in green should have the two flame emitters firing as the red lines indicate. The engines have a rotation of (0, 0, 90) which the above code picks up and rotates the direction so it's horizontal not vertical. But it still doesn't rotate around the Y axis.
I know this is probably a very stupid mistake on my part but I cant work it out, any help is greatly appreciated.
