I have a two SceneNode (NodePsiRot and NodeFiRot) that are constantly moving on a scene. I need to know a distance between these two objects on every frame while they are moving. Is it correct how I am doint that :
Ogre::Vector3 r=NodePsiRot->getPosition();
Ogre::Vector3 f=NodeFiRot->getPosition();
Ogre::Real Dist = r.distance(f);
Or may be there is a easier way ?
best
levan
Distance between two objects
- tod
- Troll
- Posts: 1394
- Joined: Wed Aug 02, 2006 9:41 am
- Location: Bucharest
- x 94
- Contact:
Re: Distance between two objects
Ogre Node position is relative to parent node. In this case it doesn't matter though.
It's ok to get distance that way, but it's better to use square distance.
It's ok to get distance that way, but it's better to use square distance.