Jump to content

[SOLVED] Permanent pointing UP child node (V2.4.1.)


photo

Recommended Posts

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
  • silent changed the title to [SOLVED] Permanent pointing UP child node (V2.4.1.)
×
×
  • Create New...