0

I know it's an unusual way to search this kind of feature, but is it possible to set an automatic transformations link from one SceneNode to an other ?

For example, if I link a SceneNode A to a SceneNode B, and if I apply a translation on the SceneNode A, the SceneNode B has to receive the same translation. As if SceneNode B was the child of SceneNode A. But it's not.

?

DevMultiTech
  • 353
  • 3
  • 15

2 Answers2

0

The general idea is this:

::Ogre::SceneNode* ChildSceneNode = parentNode.createChildSceneNode()

Then the child scene node inherits the transformations from the parent. Move the parent and the child moves too.

Jay
  • 13,803
  • 4
  • 42
  • 69
0

If a parent-child relation is no option for you (and you said so in your comments), then you are stuck with handling it yourself by either:

a) Keeping track of all changes of the node you want to follow yourself

b) Using an Ogre::Node::Listener that you can attach to the node you want to track (the "parent") and the once an update event is fired, you update the tracking ("child") node as well:

API: setListener(..) of Ogre::Scenenode

API: nodeUpdated(..) of Ogre::Node::Listener

Philip Allgaier
  • 3,505
  • 2
  • 26
  • 53