Code: Select all
Ogre::SceneNode *node1 = Scene->getRootSceneNode()->createChildSceneNode(node1Name);
node1->attachObject(entity1);
Ogre::SceneNode *node2 = node1->createChildSceneNode(node2Name);
Ogre::SceneNode *node3 = node2->createChildSceneNode(node3Name);
node3->attachObject(entity2);
node3->setPosition(20.0f, 0.0f, 0.0f);
I checked the position of each single node with the following code:
Code: Select all
cout << "node 1 Position: " << node1->getPosition() << "\n";
cout << "node 1 Orientation: " <<node1->getOrientation() << "\n";
cout << "node 2 Position: " << node2->getPosition() << "\n";
cout << "node 2 Orientation: " << node2->getOrientation() << "\n";
cout << "node 3 Position: " << node3->getPosition() << "\n";
cout << "node 3 Orientation: " << node3->getOrientation() << "\n";
The position and orientation of the camera are:node 1 Position: Vector3(0, 0, 0)
node 1 Orientation: Quaternion(1, 0, 0, 0)
node 2 Position: Vector3(0, 0, 0)
node 2 Orientation: Quaternion(1, 0, 0, 0)
node 3 Position: Vector3(20, 0, 0)
node 3 Orientation: Quaternion(1, 0, 0, 0)
Is this a normal behavior?Camera Position: Vector3(0, 0, 19.875)
Camera Orientation: Quaternion(1, 0, -0, -0)
Is there something wrong in my code?