const Ogre::Vector3 Mesh::getWorldSpacePosition(const Ogre::Vector3& ObjectSpacePosition) const { Ogre::Matrix4 mWorldMatrix; if (mCreated) { #if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7 mWorldMatrix = mEntity->getParentSceneNode()->_getFullTransform(); #else mEntity->getParentSceneNode()->getWorldTransforms(&mWorldMatrix); #endif } else { Ogre::SceneNode *mTmpSN = new Ogre::SceneNode(0); mTmpSN->setPosition(mHydrax->getPosition()); #if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR >= 7 mWorldMatrix = mTmpSN->_getFullTransform(); #else mTmpSN->getWorldTransforms(&mWorldMatrix); #endif delete mTmpSN; } return mWorldMatrix.transformAffine(ObjectSpacePosition); }
const Ogre::Vector3 Mesh::getWorldSpacePosition(const Ogre::Vector3& ObjectSpacePosition) const { Ogre::Matrix4 mWorldMatrix; if (mCreated) { mWorldMatrix = mEntity->getParentSceneNode()->_getFullTransform(); } else { Ogre::SceneNode *mTmpSN = new Ogre::SceneNode(0); mTmpSN->setPosition(mHydrax->getPosition()); mWorldMatrix = mTmpSN->_getFullTransform(); delete mTmpSN; } return mWorldMatrix.transformAffine(ObjectSpacePosition); }