How can i transform MOGRE variable to OGRE [Solved]
i hava some problem,
i need transform Mogre::sceneManager to Ogre::sceneManager in managed c++,
for my unmanaged C++ lib (depend ogre)
but i can't transform Mogre's scenemanager that use static_cast<Ogre::sceneManager> ,
how can i to do it ?
If you in the objects browser, there is a type cast operator in all Mogre objects :
public static implicit operator Ogre.SceneManager*(Mogre.SceneManager t)
Member of Mogre.SceneManager
So, in your code, you can simple use a C-Style cast to get the Ogre::SceneManager*. Here is a snippet of my code.
static List<Mogre::SceneNode^>^ FindNodesIn(Mogre::SceneManager^ sm, Mogre::Sphere^ sphere)
Ogre::SceneManager* osm = (Ogre::SceneManager*)sm;
thx a lot,
i try transform success, it's can call getName(), but can't call getRootNode(),
cause i use difference ogre version,(MOGRE 0.2.0 & OGRE 1.4.5 @@)
so i replace correct ogre version. it running now,
thx again ^^
Hey very nice...
theres is others mogre class with this cast implicit operator??
Best is to look in the object browser in VS2005. Press CTRL+J in Visual Studio, go in the Mogre namespace. Look a the classes and look for "operator [...]".
With the exception of some frequently used math classes such as Matrix3/4, Vector3/4, Quaternion, etc. All the Mogre objects wraps Ogre objects and potentially have this type cast operator.
ok thanks.. this a great feature for integrate mogre with existing plugins like NxOgre or PLSM2