Call to Camera::getUserObjectBindings is ambiguous

Minor issues with the Ogre API that can be trivial to fix
Post Reply
User avatar
Ogre Magi
Gnoblar
Posts: 4
Joined: Wed Feb 05, 2014 1:34 pm

Call to Camera::getUserObjectBindings is ambiguous

Post by Ogre Magi »

I'm wondering if no one ever used Camera::getUserObjectBindings at all since the call to it is ambiguous. This is because both Ogre::Renderable and Ogre::MovableObject define member function getUserObjectBindings and Ogre::Frustum inherits from both of them. Since Ogre::Camera inherits from Ogre::Frustum call to this method is ambiguous.

It seems like user binding code is duplicated for some reason, not obvious to me. Is user really supposed to cast Camera* into MovableObject * before using this method?

I am using Ogre 1.10 unstable and I use user object bindings to separate/connect logical game world objects and ogre scene objects.

EDIT:

Code: Select all

// This does not compile, because call to getUserObjectBindings is ambiguous (camera is of type Ogre::Camera *)
camera->getUserObjectBindings().setUserAny(Ogre::Any(userData));

Code: Select all

// This compiles
((Ogre::MovableObject *)camera)->getUserObjectBindings().setUserAny(Ogre::Any(userData));
Post Reply