Normally a wrapper (like OgreDotNet, which uses SWIG) will create a new .NET object each time you need access to a native object, and the class type of the .NET object will be that of the method's return type (the wrapper cannot know which subclass the native object actually is). To address this issue the OGRE's source is modified and the OGRE classes are interconnected to the MOGRE classes. Instead of MOGRE creating a new .NET object each time you need to access an OGRE object, the OGRE object itself creates the appropriate .NET object the first time it is requested and returns it in subsequent requests.
This allows for checking equality of objects (example code is in C#):
Camera cam1 = sceneMgr.CreateCamera("PlayerCam"); Camera cam2 = sceneMgr.GetCamera("PlayerCam"); bool areEqual = (cam1 == cam2); //areEqual is true
And returning the correct subclass:
MovableObject object = sceneNode.GetAttachedObject(0); if (object is Entity) { ... } else if (object is Camera) { ... } else { ... }
Because of the modifications to OGRE's source, in order to use a native plugin with MOGRE (like the Paging Scene Manager) you have to recompile it using the modified OGRE's include files.