Gmarquez Posted August 31, 2021 Share Posted August 31, 2021 Hi there! I have a node which can move and rotate freely and a particle system as child of this node. I need that the particle system always point to up (+Z) when the parent is rotating freely. I have try this childNode.get()->setWorldDirection(parentNode.get()->getWorldDirection(), Unigine::Math::vec3(0.0f, 0.0f, 1.0f) To preserve the direction of the orientation/direction of the parent over the child I'm setting the direction of the child to the same of the parent, but forcing the up direction as a constant vec3 pointing to +Z. This is not working propertly, I have try similar solutions, all of them related to preserve the fordward direction and force the local rotation of the child to be always pointing to up. The good point is that the child node is in the local (0, 0, 0) of the parent, I know that this is an advantage and could simplfy the problem. If I could know the quaternion rotaion of the parent in the previous frame, maybe I could do a counter rotation, Could this be know? Could somebody point me to another solution? Thanks and best regards. Link to comment
Gmarquez Posted August 31, 2021 Author Share Posted August 31, 2021 I think I have found a solution using this https://math.stackexchange.com/questions/60511/quaternion-for-an-object-that-to-point-in-a-direction When the parent node moves very fast, the particle system do some wierd behaviour, but it's always pointing Up 1 Link to comment
Recommended Posts